7static constexpr uint8_t LOCAL_STREAM_ID = 0x3a;
8static constexpr uint8_t SRC_STREAM_ID = 0xa7;
14 for (
size_t i = 0; i < length; ++i)
37 data.append((
char *)msg->
data()->data_, msg->
data()->size());
49 string ret((
char *)b->
data()->data_, b->
data()->size());
DynamicPool * mainBufferPool
main buffer pool instance
BufferPtr< T > get_buffer_deleter(Buffer< T > *b)
Helper function to create a BufferPtr of an appropriate type without having to explicitly specify the...
AutoReleaseBuffer< T > BufferPtr
Smart pointer for buffers.
Base class for all QMember types that hold data in an expandable format.
Buffer< T > * ref()
Add another reference to the buffer.
void unref()
Decrement count.
T * data()
get a pointer to the start of the data.
void alloc(Buffer< BufferType > **result, Executable *flow=NULL)
Get a free item out of the pool.
This class implements a linked list "queue" of buffers.
void insert(QMember *item, unsigned index=0)
Add an item to the back of the queue.
QMember * next(unsigned index)
Get an item from the front of the queue.
Test base class for OpenLCB unittests that simulate two physical or virtual nodes talking to each oth...
#define HASSERT(x)
Checks that the value of expression x is true, else terminates the current process.
string get_payload_data(size_t length)
Generates some deterministic data to send via streams.
Helper class that acts as a data sink for a stream receiver.
string qtake()
Takes a single element from the queue, and releases it.
string data
Bytes that arrived so far.
void send(ByteBuffer *msg, unsigned prio) override
Entry point to the flow.
bool keepBuffers_
if true, the buffers are added to the queue instead of unref'ed.