tin  1.5.9
tsm::runtime::actor_link< Source, Sink > Struct Template Reference

#include <actor.h>

Collaboration diagram for tsm::runtime::actor_link< Source, Sink >:
Collaboration graph

Public Types

using event_type = typename Source::event_type
 Event type transferred by this link. More...
 

Public Member Functions

constexpr actor_link (Source &source, Sink &sink)
 
bool step ()
 
bool pending () const noexcept
 Report whether the link is holding one value for retry. More...
 

Detailed Description

template<typename Source, typename Sink>
struct tsm::runtime::actor_link< Source, Sink >

Typed handoff between one output port and one input port.

actor_link offers at most one value per step(). If the source produces a value but the sink rejects it, the link keeps that value in one pending slot and retries it on a later step.

Member Typedef Documentation

◆ event_type

template<typename Source , typename Sink >
using tsm::runtime::actor_link< Source, Sink >::event_type = typename Source::event_type

Event type transferred by this link.

Constructor & Destructor Documentation

◆ actor_link()

template<typename Source , typename Sink >
constexpr tsm::runtime::actor_link< Source, Sink >::actor_link ( Source &  source,
Sink &  sink 
)
inlineconstexpr

Bind the link to an existing source port and sink port.

The link is non-owning. The referenced ports must outlive the link.

Member Function Documentation

◆ pending()

template<typename Source , typename Sink >
bool tsm::runtime::actor_link< Source, Sink >::pending ( ) const
inlinenoexcept

Report whether the link is holding one value for retry.

◆ step()

template<typename Source , typename Sink >
bool tsm::runtime::actor_link< Source, Sink >::step ( )
inline

Try to offer one value from source to sink.

Returns true when a pending value is accepted by the sink or when a new source value is received and accepted. Returns false when no source value is available or the sink still rejects the pending value.


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