CIRCT 21.0.0git
|
Instantiated when a backend does not know how to create a read channel. More...
#include <Ports.h>
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< MessageData > | readAsync () override |
Asynchronous read. | |
![]() | |
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. | |
![]() | |
ChannelPort (const Type *type) | |
virtual | ~ChannelPort () |
bool | poll () |
Poll for incoming data. | |
const Type * | getType () const |
Protected Attributes | |
std::string | errmsg |
![]() | |
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< MessageData > | dataQueue |
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. | |
![]() | |
const Type * | type |
Additional Inherited Members | |
![]() | |
static constexpr uint64_t | DefaultMaxDataQueueMsgs = 32 |
Default max data queue size set at connect time. | |
![]() | |
enum | Mode { Disconnected , Callback , Polling } |
Indicates the current mode of the channel. More... | |
![]() | |
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. | |
Instantiated when a backend does not know how to create a read channel.
|
inline |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Connect to the channel in polling mode.
Reimplemented from esi::ReadChannelPort.
Definition at line 212 of file Ports.h.
References errmsg.
|
inlineoverridevirtual |
Asynchronous read.
Reimplemented from esi::ReadChannelPort.
Definition at line 215 of file Ports.h.
References errmsg.
|
protected |
Definition at line 220 of file Ports.h.
Referenced by connect(), connect(), and readAsync().