rogue
Loading...
Searching...
No Matches
Application.h
Go to the documentation of this file.
1
17#ifndef __ROGUE_PROTOCOLS_PACKETIZER_APPLICATION_H__
18#define __ROGUE_PROTOCOLS_PACKETIZER_APPLICATION_H__
19#include "rogue/Directives.h"
20
21#include <stdint.h>
22
23#include <memory>
24
25#include "rogue/Queue.h"
28
29namespace rogue {
30namespace protocols {
31namespace packetizer {
32
33class Controller;
34
42 // Core module
43 std::shared_ptr<rogue::protocols::packetizer::Controller> cntl_;
44
45 // ID
46 uint8_t id_;
47
48 // Transmission thread
49 std::thread* thread_;
50 bool threadEn_;
51
52 // Thread background
53 void runThread();
54
55 // Application queue
57
58 public:
72 static std::shared_ptr<rogue::protocols::packetizer::Application> create(uint8_t id);
73
75 static void setup_python();
76
86 explicit Application(uint8_t id);
87
90
95 void setController(std::shared_ptr<rogue::protocols::packetizer::Controller> cntl);
96
101 void pushFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame);
102
113 std::shared_ptr<rogue::interfaces::stream::Frame> acceptReq(uint32_t size, bool zeroCopyEn);
114
119 void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame);
120};
121
122// Convenience
123typedef std::shared_ptr<rogue::protocols::packetizer::Application> ApplicationPtr;
124
125} // namespace packetizer
126} // namespace protocols
127}; // namespace rogue
128
129#endif
Thread-safe bounded queue with optional busy threshold.
Definition Queue.h:38
Stream master endpoint.
Definition Master.h:65
static std::shared_ptr< rogue::interfaces::stream::Master > create()
Creates a stream master.
Definition Master.cpp:40
Stream slave endpoint and default frame pool.
Definition Slave.h:72
Packetizer application endpoint.
Definition Application.h:41
void pushFrame(std::shared_ptr< rogue::interfaces::stream::Frame > frame)
Queues a frame for packetized transmission.
static void setup_python()
Registers Python bindings for this class.
std::shared_ptr< rogue::interfaces::stream::Frame > acceptReq(uint32_t size, bool zeroCopyEn)
Allocates a frame for upstream writers.
~Application()
Destroys the application endpoint.
void setController(std::shared_ptr< rogue::protocols::packetizer::Controller > cntl)
Attaches the packetizer controller.
void acceptFrame(std::shared_ptr< rogue::interfaces::stream::Frame > frame)
Accepts a frame from upstream application logic.
Packetizer base controller.
Definition Controller.h:45
std::shared_ptr< rogue::protocols::packetizer::Application > ApplicationPtr