xronos-sdk 0.5.0
Xronos C++ SDK
Loading...
Searching...
No Matches
xronos::sdk::TestEnvironment Class Reference

A variant of the environment that is configured for testing. More...

#include <xronos/sdk/environment.hh>

Inheritance diagram for xronos::sdk::TestEnvironment:
[legend]

Public Member Functions

 TestEnvironment (Duration timeout=Duration::max())
 Constructor.
Public Member Functions inherited from xronos::sdk::Environment
 Environment ()
 Constructor.
 ~Environment ()
 Destructor.
void execute ()
 Execute the reactor program.
void request_shutdown ()
 Request the termination of a currently running reactor program.
auto context (std::source_location source_location=std::source_location::current()) noexcept -> EnvironmentContext
 Get a context object for constructing top-level reactors.
template<class T>
void connect (const InputPort< T > &from, const InputPort< T > &to)
 Connect two ports.
template<class T>
void connect (const OutputPort< T > &from, const OutputPort< T > &to)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
void connect (const OutputPort< T > &from, const InputPort< T > &to)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
void connect (const InputPort< T > &from, const InputPort< T > &to, Duration delay)
 Connect two ports with a delay.
template<class T>
void connect (const OutputPort< T > &from, const OutputPort< T > &to, Duration delay)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
void connect (const OutputPort< T > &from, const InputPort< T > &to, Duration delay)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void enable_telemetry (std::string_view application_name="xronos", std::string_view endpoint="localhost:4317")
 Enable collecting and sending telemetry data from the application.

Detailed Description

A variant of the environment that is configured for testing.

Uses a special mode of execution that skips waiting between executing events and instead processes events as fast as possible.

Constructor & Destructor Documentation

◆ TestEnvironment()

xronos::sdk::TestEnvironment::TestEnvironment ( Duration timeout = Duration::max())

Constructor.

Parameters
timeoutThe maximum amount of time to simulate before terminating.

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