Loading [MathJax]/extensions/tex2jax.js
CIRCT 21.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
esi::services::CallService::Callback Class Reference

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

#include <Services.h>

Inheritance diagram for esi::services::CallService::Callback:
Inheritance graph
[legend]
Collaboration diagram for esi::services::CallService::Callback:
Collaboration graph
[legend]

Public Member Functions

void connect (std::function< MessageData(const MessageData &)> callback, bool quick=false)
 Connect a callback to code which will be executed when the accelerator invokes the callback.
 
virtual std::optional< std::string > toString () 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.
 
WriteChannelPortgetRawWrite (const std::string &name) const
 Get access to the raw byte streams of a channel.
 
ReadChannelPortgetRawRead (const std::string &name) const
 
const PortMapgetChannels () 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 Callbackget (AcceleratorConnection &acc, AppID id, BundleType *type, WriteChannelPort &result, ReadChannelPort &arg)
 
- 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 Member Functions

 Callback (AcceleratorConnection &acc, AppID id, const BundleType *, PortMap channels)
 

Private Attributes

ReadChannelPortarg
 
WriteChannelPortresult
 
AcceleratorConnectionacc
 

Friends

class CallService
 

Additional Inherited Members

- Protected Attributes inherited from esi::BundlePort
AppID id
 
const BundleTypetype
 
PortMap channels
 

Detailed Description

A function call which gets attached to a service port.

Definition at line 304 of file Services.h.

Constructor & Destructor Documentation

◆ Callback()

CallService::Callback::Callback ( AcceleratorConnection acc,
AppID  id,
const BundleType type,
PortMap  channels 
)
private

Definition at line 233 of file Services.cpp.

Member Function Documentation

◆ connect()

void CallService::Callback::connect ( std::function< MessageData(const MessageData &)>  callback,
bool  quick = false 
)

Connect a callback to code which will be executed when the accelerator invokes the callback.

The 'quick' flag indicates that the callback is sufficiently fast that it could be called in the same thread as the port callback.

Definition at line 244 of file Services.cpp.

Referenced by registerCallbacks().

◆ get()

CallService::Callback * CallService::Callback::get ( AcceleratorConnection acc,
AppID  id,
BundleType type,
WriteChannelPort result,
ReadChannelPort arg 
)
static

Definition at line 237 of file Services.cpp.

◆ toString()

virtual std::optional< std::string > esi::services::CallService::Callback::toString ( ) const
inlineoverridevirtual

Reimplemented from esi::services::ServicePort.

Definition at line 320 of file Services.h.

References esi::BundleType::findChannel(), esi::Type::getID(), and esi::BundlePort::type.

Friends And Related Symbol Documentation

◆ CallService

friend class CallService
friend

Definition at line 305 of file Services.h.

Member Data Documentation

◆ acc

AcceleratorConnection& esi::services::CallService::Callback::acc
private

Definition at line 333 of file Services.h.

◆ arg

ReadChannelPort* esi::services::CallService::Callback::arg
private

Definition at line 331 of file Services.h.

◆ result

WriteChannelPort* esi::services::CallService::Callback::result
private

Definition at line 332 of file Services.h.


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