CIRCT 21.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for esi::UnknownReadChannelPort:
Collaboration graph
[legend]

Public Member Functions

 UnknownReadChannelPort (const Type *type, std::string errmsg)
 
void connect (std::function< bool(MessageData)> callback, std::optional< unsigned > bufferSize=std::nullopt) override
 
void connect (std::optional< unsigned > bufferSize=std::nullopt) override
 Connect to the channel in polling mode.
 
std::future< MessageDatareadAsync () override
 Asynchronous read.
 
- Public Member Functions inherited from esi::ReadChannelPort
 ReadChannelPort (const Type *type)
 
virtual void disconnect () override
 
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.
 
const TypegetType () const
 

Protected Attributes

std::string errmsg
 
- Protected Attributes inherited from esi::ReadChannelPort
volatile Mode mode
 
std::function< bool(MessageData)> callback
 Backends call this callback when new data is available.
 
std::mutex pollingM
 Mutex to protect the two queues used for polling.
 
std::queue< MessageDatadataQueue
 Store incoming data here if there are no outstanding promises to be fulfilled.
 
uint64_t maxDataQueueMsgs
 Maximum number of messages to store in dataQueue. 0 means no limit.
 
std::queue< std::promise< MessageData > > promiseQueue
 Promises to be fulfilled when data is available.
 
- Protected Attributes inherited from esi::ChannelPort
const Typetype
 

Additional Inherited Members

- 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::ChannelPort
virtual bool pollImpl ()
 Method called by poll() to actually poll the channel if the channel is connected.
 
virtual void connectImpl (std::optional< unsigned > bufferSize)
 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 203 of file Ports.h.

Constructor & Destructor Documentation

◆ UnknownReadChannelPort()

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

Definition at line 205 of file Ports.h.

Member Function Documentation

◆ connect() [1/2]

void esi::UnknownReadChannelPort::connect ( std::function< bool(MessageData)>  callback,
std::optional< unsigned >  bufferSize = std::nullopt 
)
inlineoverridevirtual

Reimplemented from esi::ReadChannelPort.

Definition at line 208 of file Ports.h.

References errmsg.

◆ connect() [2/2]

void esi::UnknownReadChannelPort::connect ( std::optional< unsigned >  bufferSize = std::nullopt)
inlineoverridevirtual

Connect to the channel in polling mode.

Reimplemented from esi::ReadChannelPort.

Definition at line 212 of file Ports.h.

References errmsg.

◆ readAsync()

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

Asynchronous read.

Reimplemented from esi::ReadChannelPort.

Definition at line 215 of file Ports.h.

References errmsg.

Member Data Documentation

◆ errmsg

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

Definition at line 220 of file Ports.h.

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


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