|
CIRCT 24.0.0git
|
Helper base class for stateful deserializers which may emit zero, one, or many typed outputs for each raw input message. More...
#include <TypedPorts.h>


Public Types | |
| using | OutputCallback = detail::TypedReadOwnedCallback<T> |
| using | DecodedOutputs = std::vector<std::unique_ptr<T>> |
Public Member Functions | |
| QueuedDecodeTypeDeserializer (OutputCallback output) | |
| virtual | ~QueuedDecodeTypeDeserializer ()=default |
| bool | push (std::unique_ptr< SegmentedMessageData > &msg) |
| Push one raw message into the deserializer. | |
| bool | poke () |
| Retry delivery of any typed outputs which were previously blocked by the client callback. | |
Protected Member Functions | |
| virtual DecodedOutputs | decode (std::unique_ptr< SegmentedMessageData > &msg)=0 |
| Decode one raw message into zero or more typed outputs. | |
Private Member Functions | |
| bool | pokeLocked () |
Private Attributes | |
| OutputCallback | output |
| std::queue< std::unique_ptr< T > > | pendingOutputs |
| std::mutex | mutex |
Helper base class for stateful deserializers which may emit zero, one, or many typed outputs for each raw input message.
Derived classes implement decode() and must consume the raw input message before returning. This base class handles retrying blocked typed outputs and preserving them in FIFO order until the client accepts them.
Definition at line 239 of file TypedPorts.h.
| using esi::QueuedDecodeTypeDeserializer< T >::DecodedOutputs = std::vector<std::unique_ptr<T>> |
Definition at line 242 of file TypedPorts.h.
| using esi::QueuedDecodeTypeDeserializer< T >::OutputCallback = detail::TypedReadOwnedCallback<T> |
Definition at line 241 of file TypedPorts.h.
|
inlineexplicit |
Definition at line 244 of file TypedPorts.h.
|
virtualdefault |
|
protectedpure virtual |
Decode one raw message into zero or more typed outputs.
Implementations must consume msg before returning, even when zero outputs are produced.
Implemented in esi::SerialListTypeDeserializer< T >, and SerialCoordOutputBatch::TypeDeserializer.
Referenced by esi::QueuedDecodeTypeDeserializer< SerialCoordOutputBatch >::push().
|
inline |
Retry delivery of any typed outputs which were previously blocked by the client callback.
Definition at line 284 of file TypedPorts.h.
|
inlineprivate |
Definition at line 297 of file TypedPorts.h.
Referenced by esi::QueuedDecodeTypeDeserializer< SerialCoordOutputBatch >::poke(), and esi::QueuedDecodeTypeDeserializer< SerialCoordOutputBatch >::push().
|
inline |
Push one raw message into the deserializer.
Returns false only when previously decoded typed outputs are still blocked on delivery. In that case msg is left untouched so the caller can retry it later.
Definition at line 254 of file TypedPorts.h.
|
private |
Definition at line 312 of file TypedPorts.h.
|
private |
Definition at line 310 of file TypedPorts.h.
Referenced by esi::QueuedDecodeTypeDeserializer< SerialCoordOutputBatch >::pokeLocked(), and esi::SerialListTypeDeserializer< T >::SerialListTypeDeserializer().
|
private |
Definition at line 311 of file TypedPorts.h.