CIRCT 24.0.0git
Loading...
Searching...
No Matches
esi::services::FuncService::Function Class Reference

A function call which gets attached to a service port. More...

#include <Services.h>

Inheritance diagram for esi::services::FuncService::Function:
Collaboration diagram for esi::services::FuncService::Function:

Public Member Functions

void connect (const ChannelPort::ConnectOptions &options={})
std::future< MessageData > call (const MessageData &arg)
const esi::Type * getArgType () const
const esi::Type * getResultType () const
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 Function * get (AppID id, BundleType *type, WriteChannelPort &arg, ReadChannelPort &result)
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

std::mutex callMutex
WriteChannelPort * arg
ReadChannelPort * result
bool connected = false

Friends

class FuncService

Additional Inherited Members

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

Detailed Description

A function call which gets attached to a service port.

Definition at line 385 of file Services.h.

Member Function Documentation

◆ call()

std::future< MessageData > FuncService::Function::call ( const MessageData & arg)

Definition at line 330 of file Services.cpp.

References arg, callMutex, connected, and result.

Referenced by esiaccel.types.FunctionPort::__call__().

◆ connect()

void FuncService::Function::connect ( const ChannelPort::ConnectOptions & options = {})

◆ get()

FuncService::Function * FuncService::Function::get ( AppID id,
BundleType * type,
WriteChannelPort & arg,
ReadChannelPort & result )
static

Definition at line 308 of file Services.cpp.

References arg, result, and esi::BundlePort::type.

◆ getArgType()

const esi::Type * esi::services::FuncService::Function::getArgType ( ) const
inline

Definition at line 396 of file Services.h.

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

Referenced by toString().

◆ getResultType()

const esi::Type * esi::services::FuncService::Function::getResultType ( ) const
inline

Definition at line 401 of file Services.h.

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

Referenced by toString().

◆ toString()

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

Reimplemented from esi::services::ServicePort.

Definition at line 408 of file Services.h.

References getArgType(), getResultType(), and esi::Type::toString().

◆ FuncService

friend class FuncService
friend

Definition at line 386 of file Services.h.

References arg, FuncService, result, and esi::BundlePort::type.

Referenced by FuncService.

Member Data Documentation

◆ arg

WriteChannelPort* esi::services::FuncService::Function::arg
private

Definition at line 417 of file Services.h.

Referenced by call(), connect(), FuncService, and get().

◆ callMutex

std::mutex esi::services::FuncService::Function::callMutex
private

Definition at line 416 of file Services.h.

Referenced by call().

◆ connected

◆ result

ReadChannelPort* esi::services::FuncService::Function::result
private

Definition at line 418 of file Services.h.

Referenced by call(), connect(), FuncService, and get().


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