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

Services provide connections to 'bundles' – collections of named, unidirectional communication channels. More...

#include <Ports.h>

Inheritance diagram for esi::BundlePort:
Collaboration diagram for esi::BundlePort:

Public Member Functions

 BundlePort (AppID id, const BundleType *type, PortMap channels)
 Construct a port.
virtual ~BundlePort ()=default
AppID getID () const
 Get the ID of the port.
WriteChannelPort & getRawWrite (const std::string &name) const
 Get access to the raw byte streams of a channel.
ReadChannelPort & getRawRead (const std::string &name) const
const PortMap & getChannels () const
template<typename T>
T * getAs () const
 Cast this Bundle port to a subclass which is actually useful.
bool poll ()
 Calls poll on all channels in the bundle and returns true if any of them returned true.

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.

Protected Attributes

AppID id
const BundleType * type
PortMap channels

Detailed Description

Services provide connections to 'bundles' – collections of named, unidirectional communication channels.

This class provides access to those ChannelPorts.

Definition at line 637 of file Ports.h.

Constructor & Destructor Documentation

◆ BundlePort()

BundlePort::BundlePort ( AppID id,
const BundleType * type,
PortMap channels )

Construct a port.

Definition at line 39 of file Ports.cpp.

References channels, id, and type.

◆ ~BundlePort()

virtual esi::BundlePort::~BundlePort ( )
virtualdefault

Member Function Documentation

◆ getAs()

template<typename T>
T * esi::BundlePort::getAs ( ) const
inline

Cast this Bundle port to a subclass which is actually useful.

Returns nullptr if the cast fails.

Definition at line 665 of file Ports.h.

Referenced by aggregateHostmemBandwidthTest(), bandwidthWriteTest(), esi::findPortAsOrThrow(), hostmemReadBandwidthTest(), and hostmemWriteBandwidthTest().

◆ getChannels()

const PortMap & esi::BundlePort::getChannels ( ) const
inline

Definition at line 658 of file Ports.h.

References channels.

Referenced by NB_MODULE().

◆ getID()

AppID esi::BundlePort::getID ( ) const
inline

Get the ID of the port.

Definition at line 650 of file Ports.h.

References id.

Referenced by NB_MODULE().

◆ getRawRead()

ReadChannelPort & BundlePort::getRawRead ( const std::string & name) const

◆ getRawWrite()

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 42 of file Ports.cpp.

References channels.

Referenced by esi::services::CallService::Callback::connect(), esi::services::ChannelService::FromHost::connect(), esi::services::FuncService::Function::connect(), and NB_MODULE().

◆ isWrite()

bool esi::BundlePort::isWrite ( BundleType::Direction bundleDir)
inlinestatic

Compute the direction of a channel given the bundle direction and the bundle port's direction.

Definition at line 641 of file Ports.h.

References esi::BundleType::To.

Referenced by esi::backends::cosim::CosimEngine::createPort().

◆ poll()

bool esi::BundlePort::poll ( )
inline

Calls poll on all channels in the bundle and returns true if any of them returned true.

Definition at line 671 of file Ports.h.

References channels.

Member Data Documentation

◆ channels

◆ id

◆ type


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