|
Open Model Railroad Network (OpenMRN)
|
Helper class that acts as a data sink for a stream receiver. More...
#include <async_stream_test_helper.hxx>
Public Member Functions | |
| void | send (ByteBuffer *msg, unsigned prio) override |
| Entry point to the flow. | |
| string | qtake () |
| Takes a single element from the queue, and releases it. | |
Public Member Functions inherited from FlowInterface< ByteBuffer > | |
| virtual Pool * | pool () |
| virtual ByteBuffer * | type_helper () |
| This function is never user in the code, but GDB can use it to infer the correct message types. | |
| ByteBuffer * | alloc () |
| Synchronously allocates a message buffer from the pool of this flow. | |
| void | alloc_async (Executable *target) |
| Asynchronously allocates a message buffer from the pool of this flow. | |
Public Attributes | |
| string | data |
| Bytes that arrived so far. | |
| Q | q |
| Holds buffers. | |
| bool | keepBuffers_ {false} |
| if true, the buffers are added to the queue instead of unref'ed. | |
Additional Inherited Members | |
Public Types inherited from FlowInterface< ByteBuffer > | |
| typedef ByteBuffer | message_type |
| Stores the message template type for external reference. | |
Static Public Member Functions inherited from FlowInterface< ByteBuffer > | |
| static ByteBuffer * | cast_alloc (QMember *entry) |
| Down casts and initializes an asynchronous allocation result to the appropriate flow's buffer type. | |
Helper class that acts as a data sink for a stream receiver.
This class collects the bytes in a string. By default the stream is unthrottled (all buffers are immediately freed), but there are provisions to let the test manually drive how fast the incoming data buffers get freed.
Definition at line 25 of file async_stream_test_helper.hxx.
|
inline |
Takes a single element from the queue, and releases it.
Definition at line 45 of file async_stream_test_helper.hxx.
|
inlineoverridevirtual |
Entry point to the flow.
Users of the flow should call this mehtod to send a buffer to the flow.
| message | buffer to send to the flow |
| priority | which priority back the flow should process it. Lower numbers mean process earlier. |
Implements FlowInterface< ByteBuffer >.
Definition at line 34 of file async_stream_test_helper.hxx.
| string openlcb::CollectData::data |
Bytes that arrived so far.
Definition at line 28 of file async_stream_test_helper.hxx.
| bool openlcb::CollectData::keepBuffers_ {false} |
if true, the buffers are added to the queue instead of unref'ed.
Definition at line 32 of file async_stream_test_helper.hxx.
| Q openlcb::CollectData::q |
Holds buffers.
Definition at line 30 of file async_stream_test_helper.hxx.