Simo 0.0.1
Loading...
Searching...
No Matches
Simo::Ports::CallbackInPort< Payload, ReturnType > Class Template Reference

#include <Port.h>

Inheritance diagram for Simo::Ports::CallbackInPort< Payload, ReturnType >:
Simo::Port Simo::Ports::CallbackContractInPort< Payload, ReturnType, Contract >

Public Types

using Callback = std::function<ReturnType(Payload)>
Public Types inherited from Simo::Port
using TypeId = boost::typeindex::type_index

Public Member Functions

 CallbackInPort (Callback callback)
bool connect (Port *other) override
void callback (Callback callback)
bool has_callback () const
Public Member Functions inherited from Simo::Port
template<typename Self>
TypeId get_type_id (this Self &)
 Utility to the get type of class. Need the type at compile time.
std::string_view name () const
void name (const std::string_view name)

Protected Member Functions

void receive (Payload payload)
std::optional< ReturnType > receive (Payload payload)

Protected Attributes

Callback callback_
Protected Attributes inherited from Simo::Port
std::string name_

Friends

class CallbackOutPort< Payload, ReturnType >

Detailed Description

template<typename Payload, typename ReturnType>
class Simo::Ports::CallbackInPort< Payload, ReturnType >

Templated output port that receives payloads from a CallbackInPort of the same type and invokes a callback for each payload.

Member Function Documentation

◆ connect()

template<typename Payload, typename ReturnType>
bool Simo::Ports::CallbackInPort< Payload, ReturnType >::connect ( Port * other)
nodiscardoverridevirtual

Implements Simo::Port.


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