CIRCT
20.0.0git
|
Services provide connections to 'bundles' – collections of named, unidirectional communication channels. More...
#include <Ports.h>
Public Member Functions | |
BundlePort (AppID id, std::map< std::string, ChannelPort & > channels) | |
Construct a port. More... | |
virtual | ~BundlePort ()=default |
AppID | getID () const |
Get the ID of the port. More... | |
WriteChannelPort & | getRawWrite (const std::string &name) const |
Get access to the raw byte streams of a channel. More... | |
ReadChannelPort & | getRawRead (const std::string &name) const |
const std::map< std::string, ChannelPort & > & | getChannels () const |
template<typename T > | |
T * | getAs () const |
Cast this Bundle port to a subclass which is actually useful. More... | |
bool | poll () |
Calls poll on all channels in the bundle and returns true if any of them returned true. More... | |
Static Public Member Functions | |
static bool | isWrite (BundleType::Direction bundleDir) |
Compute the direction of a channel given the bundle direction and the bundle port's direction. More... | |
Private Attributes | |
AppID | id |
std::map< std::string, ChannelPort & > | channels |
Services provide connections to 'bundles' – collections of named, unidirectional communication channels.
This class provides access to those ChannelPorts.
BundlePort::BundlePort | ( | AppID | id, |
std::map< std::string, ChannelPort & > | channels | ||
) |
|
virtualdefault |
|
inline |
|
inline |
Definition at line 205 of file Ports.h.
References channels.
Referenced by printPort(), and PYBIND11_MODULE().
|
inline |
Get the ID of the port.
Definition at line 197 of file Ports.h.
References id.
Referenced by printPort(), and PYBIND11_MODULE().
ReadChannelPort & BundlePort::getRawRead | ( | const std::string & | name | ) | const |
WriteChannelPort & BundlePort::getRawWrite | ( | const std::string & | name | ) | const |
Get access to the raw byte streams of a channel.
Intended for internal usage and binding to other languages (e.g. Python) which have their own message serialization code. Exposed publicly as an escape hatch, but ordinary users should not use. You have been warned.
Definition at line 25 of file Ports.cpp.
References channels.
Referenced by PYBIND11_MODULE().
|
inlinestatic |
Compute the direction of a channel given the bundle direction and the bundle port's direction.
Definition at line 188 of file Ports.h.
Referenced by esi::backends::trace::TraceAccelerator::Impl::requestChannelsFor(), and esi::backends::cosim::CosimAccelerator::requestChannelsFor().
|
inline |
|
private |
Definition at line 229 of file Ports.h.
Referenced by esi::services::CallService::Callback::Callback(), esi::services::FuncService::Function::Function(), getChannels(), getRawRead(), getRawWrite(), and poll().