tin  1.5.9
tsm::runtime::output_port< Event, Source > Struct Template Reference

#include <actor.h>

Collaboration diagram for tsm::runtime::output_port< Event, Source >:
Collaboration graph

Public Types

using event_type = Event
 Event type produced by this port. More...
 
using source_type = Source
 Actor or adapter type referenced by this port. More...
 

Public Member Functions

constexpr output_port (Source &source)
 
bool try_receive (Event &event) const requires actor_source< Source
 

Public Attributes

bool Event
 

Detailed Description

template<typename Event, typename Source>
struct tsm::runtime::output_port< Event, Source >

Non-owning typed egress view for an actor source.

output_port narrows access to one event type. A link can receive values from this port without being able to mutate unrelated source state.

Member Typedef Documentation

◆ event_type

template<typename Event , typename Source >
using tsm::runtime::output_port< Event, Source >::event_type = Event

Event type produced by this port.

◆ source_type

template<typename Event , typename Source >
using tsm::runtime::output_port< Event, Source >::source_type = Source

Actor or adapter type referenced by this port.

Constructor & Destructor Documentation

◆ output_port()

template<typename Event , typename Source >
constexpr tsm::runtime::output_port< Event, Source >::output_port ( Source &  source)
inlineexplicitconstexpr

Bind the port to an existing source.

The caller owns source; the port stores only a pointer and must not outlive the referenced object.

Member Function Documentation

◆ try_receive()

template<typename Event , typename Source >
bool tsm::runtime::output_port< Event, Source >::try_receive ( Event event) const

Try to receive one event from the source.

Returns true and writes event when a value is available. Returns false without requiring progress when the source is currently empty.

Member Data Documentation

◆ Event

template<typename Event , typename Source >
bool tsm::runtime::output_port< Event, Source >::Event
Initial value:
{
return source_->try_receive(event)

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