CIRCT 23.0.0git
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
esi::SerialListTypeDeserializer< T > Class Template Reference

Reusable serial-list window deserializer. More...

#include <TypedPorts.h>

Inheritance diagram for esi::SerialListTypeDeserializer< T >:
Inheritance graph
[legend]
Collaboration diagram for esi::SerialListTypeDeserializer< T >:
Collaboration graph
[legend]

Public Types

using Base = QueuedDecodeTypeDeserializer< T >
 
using OutputCallback = typename Base::OutputCallback
 
using DecodedOutputs = typename Base::DecodedOutputs
 
- Public Types inherited from esi::QueuedDecodeTypeDeserializer< T >
using OutputCallback = detail::TypedReadOwnedCallback< T >
 
using DecodedOutputs = std::vector< std::unique_ptr< T > >
 

Public Member Functions

 SerialListTypeDeserializer (OutputCallback output)
 
- Public Member Functions inherited from esi::QueuedDecodeTypeDeserializer< T >
 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.
 

Private Types

using header_frame = typename T::header_frame
 
using data_frame = typename T::data_frame
 
using count_type = typename T::count_type
 

Private Member Functions

DecodedOutputs decode (std::unique_ptr< SegmentedMessageData > &msg) override
 Decode one raw message into zero or more typed outputs.
 

Private Attributes

std::vector< uint8_t > partial_
 
std::optional< header_framepending_header_
 
std::vector< data_framepending_frames_
 
count_type remaining_ = 0
 

Static Private Attributes

static constexpr size_t kFrameSize = sizeof(data_frame)
 

Additional Inherited Members

Detailed Description

template<typename T>
class esi::SerialListTypeDeserializer< T >

Reusable serial-list window deserializer.

Walks the serial-list multi-burst protocol used by codegen'd window helpers – zero or more header(N>0) + N data bursts terminated by a header(0) footer – and emits a fully-formed T instance built from the accumulated header fields and data frames.

T must be a generated window helper that exposes:

T typically declares SerialListTypeDeserializer<T> as a friend so the template can reach the (private) header_frame definition; the helpers themselves can stay private as well.

Definition at line 340 of file TypedPorts.h.

Member Typedef Documentation

◆ Base

template<typename T >
using esi::SerialListTypeDeserializer< T >::Base = QueuedDecodeTypeDeserializer<T>

Definition at line 342 of file TypedPorts.h.

◆ count_type

template<typename T >
using esi::SerialListTypeDeserializer< T >::count_type = typename T::count_type
private

Definition at line 352 of file TypedPorts.h.

◆ data_frame

template<typename T >
using esi::SerialListTypeDeserializer< T >::data_frame = typename T::data_frame
private

Definition at line 351 of file TypedPorts.h.

◆ DecodedOutputs

template<typename T >
using esi::SerialListTypeDeserializer< T >::DecodedOutputs = typename Base::DecodedOutputs

Definition at line 344 of file TypedPorts.h.

◆ header_frame

template<typename T >
using esi::SerialListTypeDeserializer< T >::header_frame = typename T::header_frame
private

Definition at line 350 of file TypedPorts.h.

◆ OutputCallback

template<typename T >
using esi::SerialListTypeDeserializer< T >::OutputCallback = typename Base::OutputCallback

Definition at line 343 of file TypedPorts.h.

Constructor & Destructor Documentation

◆ SerialListTypeDeserializer()

template<typename T >
esi::SerialListTypeDeserializer< T >::SerialListTypeDeserializer ( OutputCallback  output)
inlineexplicit

Definition at line 346 of file TypedPorts.h.

Member Function Documentation

◆ decode()

template<typename T >
DecodedOutputs esi::SerialListTypeDeserializer< T >::decode ( std::unique_ptr< SegmentedMessageData > &  msg)
inlineoverrideprivatevirtual

Member Data Documentation

◆ kFrameSize

template<typename T >
constexpr size_t esi::SerialListTypeDeserializer< T >::kFrameSize = sizeof(data_frame)
staticconstexprprivate

Definition at line 356 of file TypedPorts.h.

Referenced by esi::SerialListTypeDeserializer< T >::decode().

◆ partial_

template<typename T >
std::vector<uint8_t> esi::SerialListTypeDeserializer< T >::partial_
private

Definition at line 414 of file TypedPorts.h.

Referenced by esi::SerialListTypeDeserializer< T >::decode().

◆ pending_frames_

template<typename T >
std::vector<data_frame> esi::SerialListTypeDeserializer< T >::pending_frames_
private

Definition at line 416 of file TypedPorts.h.

Referenced by esi::SerialListTypeDeserializer< T >::decode().

◆ pending_header_

template<typename T >
std::optional<header_frame> esi::SerialListTypeDeserializer< T >::pending_header_
private

Definition at line 415 of file TypedPorts.h.

Referenced by esi::SerialListTypeDeserializer< T >::decode().

◆ remaining_

template<typename T >
count_type esi::SerialListTypeDeserializer< T >::remaining_ = 0
private

Definition at line 417 of file TypedPorts.h.

Referenced by esi::SerialListTypeDeserializer< T >::decode().


The documentation for this class was generated from the following file: