xronos-sdk 0.5.0
Xronos C++ SDK
Loading...
Searching...
No Matches
xronos::sdk::InputPort< T > Class Template Reference

A reactor element for receiving messages from other reactors. More...

#include <xronos/sdk/port.hh>

Inheritance diagram for xronos::sdk::InputPort< T >:
[legend]

Public Member Functions

 InputPort (std::string_view name, ReactorContext context)
 Constructor.
Public Member Functions inherited from xronos::sdk::Element
auto name () const noexcept -> const std::string &
 Get the element's name.
auto fqn () const noexcept -> const std::string &
 Get the element's fully qualified name.
auto add_attribute (std::string_view key, const AttributeValue &value) noexcept -> bool
 Annotate an element with an attribute.
template<std::ranges::input_range R>
requires requires(std::ranges::range_value_t<R> pair) { { pair.first } -> std::convertible_to<std::string_view>; { pair.second } -> std::convertible_to<AttributeValue>; }
auto add_attributes (const R &range) noexcept -> bool
 Annotate an element with multiple attributes.
auto add_attributes (std::initializer_list< std::pair< std::string_view, AttributeValue > > attributes) -> bool
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
virtual ~Element ()=default
 Virtual destructor.

Detailed Description

template<class T>
class xronos::sdk::InputPort< T >

A reactor element for receiving messages from other reactors.

Input ports can be used as a reaction trigger and provide an interface for reactors to receive messages from other reactors.

Input ports may be connected to other ports so that messages are forwarded automatically (see Environment::connect() and Reactor::connect()).

Other reactors may also use input ports as a reaction effect allowing an external reaction handler to send messages directly to the port.

Template Parameters
TThe value type associated with messages.

Constructor & Destructor Documentation

◆ InputPort()

template<class T>
xronos::sdk::InputPort< T >::InputPort ( std::string_view name,
ReactorContext context )

Constructor.

Parameters
nameThe name of the port.
contextThe containing reactor's context.

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