CIRCT 24.0.0git
Loading...
Searching...
No Matches
esi::UnknownReadChannelPort Class Reference

Instantiated when a backend does not know how to create a read channel. More...

#include <Ports.h>

Inheritance diagram for esi::UnknownReadChannelPort:
Collaboration diagram for esi::UnknownReadChannelPort:

Public Member Functions

 UnknownReadChannelPort (const Type *type, std::string errmsg)
void connect (ReadCallback callback, const ConnectOptions &options=ConnectOptions()) override
void connect (FlatReadCallback callback, const ConnectOptions &options=ConnectOptions()) override
 Connect a compatibility callback which receives flattened MessageData objects.
void connect (const ConnectOptions &options=ConnectOptions()) override
 Connect to the channel in polling mode.
std::future< MessageData > readAsync () override
 Asynchronous polling read.
Public Member Functions inherited from esi::ReadChannelPort
 ReadChannelPort (const Type *type)
virtual void disconnect () override
 Disconnect the channel.
virtual bool isConnected () const override
virtual void read (MessageData &outData)
 Specify a buffer to read into.
void setMaxDataQueueMsgs (uint64_t maxMsgs)
 Set maximum number of messages to store in the dataQueue.
Public Member Functions inherited from esi::ChannelPort
 ChannelPort (const Type *type)
virtual ~ChannelPort ()
bool poll ()
 Poll for incoming data.
size_t getFrameSizeBytes () const
 Get the size of each frame in bytes.
const Type * getType () const
const WindowType * getWindowType () const
 If this port carries a windowed type, return the original WindowType (whose intoType is what getType() returns).

Protected Attributes

std::string errmsg
Protected Attributes inherited from esi::ReadChannelPort
volatile Mode mode
std::unique_ptr< SegmentedMessageData > translatedMessage
 If a translated message has been assembled but not yet consumed, retain ownership here so retries present the same message object.
std::vector< uint8_t > translationBuffer
 Window translation support.
size_t nextFrameIndex = 0
 Index of the next expected frame (for multi-frame windows).
std::vector< uint8_t > listDataBuffer
 For list fields: accumulated list data across frames.
bool accumulatingListData = false
 Flag to track whether we're in the middle of accumulating list data.
uint64_t maxDataQueueMsgs = DefaultMaxDataQueueMsgs
std::optional< detail::PollingBuffer< MessageData > > pollingState
std::mutex callbackMutex
 Synchronizes callback revocation during disconnect.
std::condition_variable callbackCv
size_t activeCallbacks = 0
Protected Attributes inherited from esi::ChannelPort
const Type * type
std::unique_ptr< TranslationInfo > translationInfo

Additional Inherited Members

Public Types inherited from esi::ReadChannelPort
using ReadCallback
 Primary callback API for raw reads.
using FlatReadCallback = std::function<bool(MessageData)>
 Compatibility callback API for callers which want flattened message bytes instead of the owning segmented message object.
Static Public Attributes inherited from esi::ReadChannelPort
static constexpr uint64_t DefaultMaxDataQueueMsgs = 32
 Default max data queue size set at connect time.
Protected Types inherited from esi::ReadChannelPort
enum  Mode { Disconnected , Callback , Polling }
 Indicates the current mode of the channel. More...
Protected Member Functions inherited from esi::ReadChannelPort
bool invokeCallback (std::unique_ptr< SegmentedMessageData > &msg)
 Invoke the currently registered callback.
void resetTranslationState ()
 Reset translation state buffers and indices.
bool translateIncoming (MessageData &data)
 Translate incoming data if the port type is a window type.
Protected Member Functions inherited from esi::ChannelPort
virtual bool pollImpl ()
 Method called by poll() to actually poll the channel if the channel is connected.
virtual void connectImpl (const ConnectOptions &options)
 Called by all connect methods to let backends initiate the underlying connections.

Detailed Description

Instantiated when a backend does not know how to create a read channel.

Definition at line 610 of file Ports.h.

Constructor & Destructor Documentation

◆ UnknownReadChannelPort()

esi::UnknownReadChannelPort::UnknownReadChannelPort ( const Type * type,
std::string errmsg )
inline

Definition at line 612 of file Ports.h.

References errmsg, esi::ReadChannelPort::ReadChannelPort(), and esi::ChannelPort::type.

Member Function Documentation

◆ connect() [1/3]

void esi::UnknownReadChannelPort::connect ( const ConnectOptions & options = ConnectOptions())
inlineoverridevirtual

Connect to the channel in polling mode.

Reimplemented from esi::ReadChannelPort.

Definition at line 623 of file Ports.h.

References errmsg.

◆ connect() [2/3]

void esi::UnknownReadChannelPort::connect ( FlatReadCallback callback,
const ConnectOptions & options = ConnectOptions() )
inlineoverridevirtual

Connect a compatibility callback which receives flattened MessageData objects.

This adapts the primary segmented callback path.

Reimplemented from esi::ReadChannelPort.

Definition at line 619 of file Ports.h.

References esi::ReadChannelPort::callback, and errmsg.

◆ connect() [3/3]

void esi::UnknownReadChannelPort::connect ( ReadCallback callback,
const ConnectOptions & options = ConnectOptions() )
inlineoverridevirtual

Reimplemented from esi::ReadChannelPort.

Definition at line 615 of file Ports.h.

References esi::ReadChannelPort::callback, and errmsg.

◆ readAsync()

std::future< MessageData > esi::UnknownReadChannelPort::readAsync ( )
inlineoverridevirtual

Asynchronous polling read.

Throws if the port is disconnected or currently connected in callback mode.

Reimplemented from esi::ReadChannelPort.

Definition at line 626 of file Ports.h.

References errmsg.

Member Data Documentation

◆ errmsg

std::string esi::UnknownReadChannelPort::errmsg
protected

Definition at line 631 of file Ports.h.

Referenced by connect(), connect(), connect(), readAsync(), and UnknownReadChannelPort().


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