rogue
Loading...
Searching...
No Matches
CombinerV2.h
Go to the documentation of this file.
1
17#ifndef __ROGUE_PROTOCOLS_BATCHER_COMBINER_V2_H__
18#define __ROGUE_PROTOCOLS_BATCHER_COMBINER_V2_H__
19#include "rogue/Directives.h"
20
21#include <stdint.h>
22
23#include <memory>
24#include <mutex>
25#include <vector>
26
27#include "rogue/Logging.h"
31
32namespace rogue {
33namespace protocols {
34namespace batcher {
35
51 std::shared_ptr<rogue::Logging> log_;
52
53 // Queued frames waiting to be batched.
54 std::vector<std::shared_ptr<rogue::interfaces::stream::Frame> > queue_;
55
56 // Sequence counter.
57 uint8_t seq_;
58
59 // Mutex for queue access.
60 std::mutex mtx_;
61
62 public:
64 static void setup_python();
65
70 static std::shared_ptr<rogue::protocols::batcher::CombinerV2> create();
71
75 CombinerV2();
76
79
84 void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame);
85
93 void sendBatch();
94
99 uint32_t getCount();
100};
101
102// Convenience
103typedef std::shared_ptr<rogue::protocols::batcher::CombinerV2> CombinerV2Ptr;
104} // namespace batcher
105} // namespace protocols
106} // namespace rogue
107#endif
Stream master endpoint.
Definition Master.h:65
Stream slave endpoint and default frame pool.
Definition Slave.h:72
Combines individual frames into a batcher v2 super-frame.
Definition CombinerV2.h:50
static std::shared_ptr< rogue::protocols::batcher::CombinerV2 > create()
Creates a CombinerV2 instance.
CombinerV2()
Constructs a CombinerV2 instance.
uint32_t getCount()
Returns the number of frames currently queued.
void acceptFrame(std::shared_ptr< rogue::interfaces::stream::Frame > frame)
Accepts a frame and immediately queues it for batching.
void sendBatch()
Builds and sends a batcher v2 super-frame from all queued frames.
static void setup_python()
Registers Python bindings for this class.
~CombinerV2()
Destroys the combiner.
std::shared_ptr< rogue::protocols::batcher::CombinerV2 > CombinerV2Ptr
Definition CombinerV2.h:103