rogue
Loading...
Searching...
No Matches
Transport.h
Go to the documentation of this file.
1
17#ifndef __ROGUE_PROTOCOLS_PACKETIZER_TRANSPORT_H__
18#define __ROGUE_PROTOCOLS_PACKETIZER_TRANSPORT_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 packetizer {
32
33class Controller;
34
53 // Packetizer controller endpoint.
54 std::shared_ptr<rogue::protocols::packetizer::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::packetizer::Transport> create();
78
80 static void setup_python();
81
89 Transport();
90
92 ~Transport();
93
103 void setController(std::shared_ptr<rogue::protocols::packetizer::Controller> cntl);
104
109 void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame);
110};
111
112// Convenience
113typedef std::shared_ptr<rogue::protocols::packetizer::Transport> TransportPtr;
114
115} // namespace packetizer
116} // namespace protocols
117}; // namespace rogue
118
119#endif
Stream master endpoint.
Definition Master.h:65
Stream slave endpoint and default frame pool.
Definition Slave.h:72
Packetizer transport endpoint.
Definition Transport.h:52
~Transport()
Destroys the packetizer transport endpoint.
Definition Transport.cpp:59
static std::shared_ptr< rogue::protocols::packetizer::Transport > create()
Creates a packetizer transport endpoint.
Definition Transport.cpp:39
void setController(std::shared_ptr< rogue::protocols::packetizer::Controller > cntl)
Attaches the packetizer controller.
Definition Transport.cpp:73
static void setup_python()
Registers Python bindings for this class.
Definition Transport.cpp:44
void acceptFrame(std::shared_ptr< rogue::interfaces::stream::Frame > frame)
Accepts a frame from the upstream stream interface.
Definition Transport.cpp:87
Transport()
Constructs a packetizer transport endpoint.
Definition Transport.cpp:56
std::shared_ptr< rogue::protocols::packetizer::Transport > TransportPtr
Definition Transport.h:113