CIRCT 24.0.0git
Loading...
Searching...
No Matches
esi::services::ChannelService::FromHost Class Reference

A port which writes data to the accelerator (from_host). More...

#include <Services.h>

Inheritance diagram for esi::services::ChannelService::FromHost:
Collaboration diagram for esi::services::ChannelService::FromHost:

Public Member Functions

void connect ()
void write (const MessageData &data)
virtual std::optional< std::string > toString (bool oneLine=false) const override
Public Member Functions inherited from esi::services::ServicePort
virtual ~ServicePort ()=default
 BundlePort (AppID id, const BundleType *type, PortMap channels)
 Construct a port.
Public Member Functions inherited from esi::BundlePort
 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 FromHost * get (AppID id, const BundleType *type, WriteChannelPort &dataPort)
Static Public Member Functions inherited from esi::BundlePort
static bool isWrite (BundleType::Direction bundleDir)
 Compute the direction of a channel given the bundle direction and the bundle port's direction.

Private Attributes

WriteChannelPort * dataPort = nullptr
bool connected = false

Friends

class ChannelService

Additional Inherited Members

Protected Attributes inherited from esi::BundlePort
AppID id
const BundleType * type
PortMap channels

Detailed Description

A port which writes data to the accelerator (from_host).

Definition at line 347 of file Services.h.

Member Function Documentation

◆ connect()

void ChannelService::FromHost::connect ( )

Definition at line 274 of file Services.cpp.

References esi::BundlePort::channels, connected, dataPort, and esi::BundlePort::getRawWrite().

Referenced by NB_MODULE().

◆ get()

ChannelService::FromHost * ChannelService::FromHost::get ( AppID id,
const BundleType * type,
WriteChannelPort & dataPort )
static

Definition at line 269 of file Services.cpp.

References esi::BundlePort::type.

◆ toString()

virtual std::optional< std::string > esi::services::ChannelService::FromHost::toString ( bool oneLine = false) const
inlineoverridevirtual

Reimplemented from esi::services::ServicePort.

Definition at line 358 of file Services.h.

References esi::ChannelType::getInner(), esi::Type::toString(), and esi::BundlePort::type.

◆ write()

void ChannelService::FromHost::write ( const MessageData & data)

Definition at line 285 of file Services.cpp.

References connected, and dataPort.

◆ ChannelService

friend class ChannelService
friend

Definition at line 348 of file Services.h.

References ChannelService, dataPort, and esi::BundlePort::type.

Referenced by ChannelService.

Member Data Documentation

◆ connected

◆ dataPort

WriteChannelPort* esi::services::ChannelService::FromHost::dataPort = nullptr
private

Definition at line 366 of file Services.h.

Referenced by ChannelService, connect(), and write().


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