rogue
Loading...
Searching...
No Matches
Application.h
Go to the documentation of this file.
1
17#ifndef __ROGUE_PROTOCOLS_RSSI_APPLICATION_H__
18#define __ROGUE_PROTOCOLS_RSSI_APPLICATION_H__
19#include "rogue/Directives.h"
20
21#include <stdint.h>
22
23#include <atomic>
24#include <memory>
25
28
29namespace rogue {
30namespace protocols {
31namespace rssi {
32
33class Controller;
34
53 // RSSI controller backend. Weak to avoid a cycle with Controller::app_.
54 std::weak_ptr<rogue::protocols::rssi::Controller> cntl_;
55
57 protected:
58 std::thread* thread_ = nullptr;
59 std::atomic<bool> threadEn_{false};
61
62 private:
63 // Worker thread entry point.
64 void runThread();
65
66 public:
77 static std::shared_ptr<rogue::protocols::rssi::Application> create();
78
80 static void setup_python();
81
90
93
102 void setController(std::shared_ptr<rogue::protocols::rssi::Controller> cntl);
103
112 void stop();
113
124 std::shared_ptr<rogue::interfaces::stream::Frame> acceptReq(uint32_t size, bool zeroCopyEn);
125
130 void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame);
131};
132
133// Convienence
134typedef std::shared_ptr<rogue::protocols::rssi::Application> ApplicationPtr;
135
136} // namespace rssi
137} // namespace protocols
138}; // namespace rogue
139
140#endif
Stream master endpoint.
Definition Master.h:65
Stream slave endpoint and default frame pool.
Definition Slave.h:72
RSSI application-side endpoint.
Definition Application.h:52
static void setup_python()
Registers Python bindings for this class.
void acceptFrame(std::shared_ptr< rogue::interfaces::stream::Frame > frame)
Accepts a frame from upstream application logic.
~Application()
Destroys the application endpoint.
void setController(std::shared_ptr< rogue::protocols::rssi::Controller > cntl)
Attaches the RSSI controller.
std::shared_ptr< rogue::interfaces::stream::Frame > acceptReq(uint32_t size, bool zeroCopyEn)
Allocates a frame for upstream writers.
static std::shared_ptr< rogue::protocols::rssi::Application > create()
Creates an RSSI application endpoint.
Application()
Constructs an RSSI application endpoint.
void stop()
Stops and joins the outbound worker thread.
RSSI protocol controller.
Definition Controller.h:65
std::shared_ptr< rogue::protocols::rssi::Application > ApplicationPtr