|
CIRCT 23.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 246 of file TypedPorts.h.
| using esi::QueuedDecodeTypeDeserializer< T >::DecodedOutputs = std::vector<std::unique_ptr<T> > |
Definition at line 249 of file TypedPorts.h.
| using esi::QueuedDecodeTypeDeserializer< T >::OutputCallback = detail::TypedReadOwnedCallback<T> |
Definition at line 248 of file TypedPorts.h.
|
inlineexplicit |
Definition at line 251 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< T >::push().
|
inline |
Retry delivery of any typed outputs which were previously blocked by the client callback.
Definition at line 291 of file TypedPorts.h.
References esi::QueuedDecodeTypeDeserializer< T >::mutex, and esi::QueuedDecodeTypeDeserializer< T >::pokeLocked().
|
inlineprivate |
Definition at line 304 of file TypedPorts.h.
References esi::QueuedDecodeTypeDeserializer< T >::output, and esi::QueuedDecodeTypeDeserializer< T >::pendingOutputs.
Referenced by esi::QueuedDecodeTypeDeserializer< T >::poke(), and esi::QueuedDecodeTypeDeserializer< T >::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 261 of file TypedPorts.h.
References esi::QueuedDecodeTypeDeserializer< T >::decode(), esi::QueuedDecodeTypeDeserializer< T >::mutex, esi::QueuedDecodeTypeDeserializer< T >::pendingOutputs, and esi::QueuedDecodeTypeDeserializer< T >::pokeLocked().
|
private |
Definition at line 319 of file TypedPorts.h.
Referenced by esi::QueuedDecodeTypeDeserializer< T >::poke(), and esi::QueuedDecodeTypeDeserializer< T >::push().
|
private |
Definition at line 317 of file TypedPorts.h.
Referenced by esi::QueuedDecodeTypeDeserializer< T >::pokeLocked().
|
private |
Definition at line 318 of file TypedPorts.h.
Referenced by esi::QueuedDecodeTypeDeserializer< T >::pokeLocked(), and esi::QueuedDecodeTypeDeserializer< T >::push().