DiffEq - Modern C++ ODE Integration Library 1.0.0
High-performance C++ library for solving ODEs with async signal processing
Loading...
Searching...
No Matches
diffeq::realtime::RealtimeIntegrator< S, T > Class Template Reference

Real-time integrator with signal processing capabilities. More...

#include <realtime_integrator.hpp>

Inheritance diagram for diffeq::realtime::RealtimeIntegrator< S, T >:
Collaboration diagram for diffeq::realtime::RealtimeIntegrator< S, T >:

Classes

struct  RealtimeConfig
 Configuration for real-time operation. More...
 

Public Types

using base_type = core::AbstractIntegrator< S, T >
 
using state_type = typename base_type::state_type
 
using time_type = typename base_type::time_type
 
using value_type = typename base_type::value_type
 
using system_function = typename base_type::system_function
 
template<typename U >
using signal_type = RealtimeSignal< U >
 
using control_signal = signal_type< communication::RobotControlMessage >
 
using financial_signal = signal_type< communication::FinancialSignalMessage >
 
using parameter_signal = signal_type< std::unordered_map< std::string, double > >
 
using state_output_signal = signal_type< state_type >
 
- Public Types inherited from diffeq::core::AbstractIntegrator< S >
using state_type = S
 
using time_type = typename S::value_type
 
using value_type = typename S::value_type
 
using system_function = std::function< void(time_type, const state_type &, state_type &)>
 

Public Member Functions

 RealtimeIntegrator (std::unique_ptr< core::AbstractIntegrator< S, T > > base_integrator, RealtimeConfig config={})
 
 RealtimeIntegrator (const RealtimeIntegrator &)=delete
 
RealtimeIntegratoroperator= (const RealtimeIntegrator &)=delete
 
 RealtimeIntegrator (RealtimeIntegrator &&) noexcept=default
 
RealtimeIntegratoroperator= (RealtimeIntegrator &&) noexcept=default
 
void start_realtime ()
 Start real-time operation.
 
void shutdown ()
 Stop real-time operation.
 
void step (state_type &state, time_type dt) override
 Enhanced step function with signal processing.
 
void integrate (state_type &state, time_type dt, time_type end_time) override
 Enhanced integrate function with real-time capabilities.
 
template<typename ControlData >
void send_control_signal (ControlData &&data, double priority=1.0)
 Send control signal (for robotics applications)
 
template<typename FinancialData >
void send_financial_signal (FinancialData &&data, double priority=1.0)
 Send financial signal (for quantitative trading)
 
void update_parameters (const std::unordered_map< std::string, double > &params)
 Update system parameters dynamically.
 
void emergency_stop ()
 Emergency stop - immediately halt integration.
 
state_type get_current_state () const
 Get current state (thread-safe)
 
void setup_process_connector (communication::ProcessConnector::ConnectionConfig config)
 Set up process connector for inter-process communication.
 
template<typename SignalT , SignalHandler< SignalT > Handler>
void register_signal_handler (SignalType type, Handler &&handler)
 Register signal handler for specific signal type.
 
- Public Member Functions inherited from diffeq::core::AbstractIntegrator< S >
 AbstractIntegrator (system_function sys)
 
time_type current_time () const
 
void set_time (time_type t)
 
void set_system (system_function sys)
 

Additional Inherited Members

- Protected Member Functions inherited from diffeq::core::AbstractIntegrator< S >
void advance_time (time_type dt)
 
- Protected Attributes inherited from diffeq::core::AbstractIntegrator< S >
system_function sys_
 
time_type current_time_
 

Detailed Description

template<system_state S, can_be_time T = double>
class diffeq::realtime::RealtimeIntegrator< S, T >

Real-time integrator with signal processing capabilities.

This class extends the basic integrator functionality with:

  • Real-time signal processing for control and financial applications
  • Async communication with external processes
  • Event-driven parameter updates
  • High-performance state output
  • Safety mechanisms and emergency stops

Definition at line 183 of file realtime_integrator.hpp.

Member Typedef Documentation

◆ base_type

template<system_state S, can_be_time T = double>
using diffeq::realtime::RealtimeIntegrator< S, T >::base_type = core::AbstractIntegrator<S, T>

Definition at line 185 of file realtime_integrator.hpp.

◆ control_signal

template<system_state S, can_be_time T = double>
using diffeq::realtime::RealtimeIntegrator< S, T >::control_signal = signal_type<communication::RobotControlMessage>

Definition at line 195 of file realtime_integrator.hpp.

◆ financial_signal

template<system_state S, can_be_time T = double>
using diffeq::realtime::RealtimeIntegrator< S, T >::financial_signal = signal_type<communication::FinancialSignalMessage>

Definition at line 196 of file realtime_integrator.hpp.

◆ parameter_signal

template<system_state S, can_be_time T = double>
using diffeq::realtime::RealtimeIntegrator< S, T >::parameter_signal = signal_type<std::unordered_map<std::string, double> >

Definition at line 197 of file realtime_integrator.hpp.

◆ signal_type

template<system_state S, can_be_time T = double>
template<typename U >
using diffeq::realtime::RealtimeIntegrator< S, T >::signal_type = RealtimeSignal<U>

Definition at line 193 of file realtime_integrator.hpp.

◆ state_output_signal

template<system_state S, can_be_time T = double>
using diffeq::realtime::RealtimeIntegrator< S, T >::state_output_signal = signal_type<state_type>

Definition at line 198 of file realtime_integrator.hpp.

◆ state_type

template<system_state S, can_be_time T = double>
using diffeq::realtime::RealtimeIntegrator< S, T >::state_type = typename base_type::state_type

Definition at line 186 of file realtime_integrator.hpp.

◆ system_function

template<system_state S, can_be_time T = double>
using diffeq::realtime::RealtimeIntegrator< S, T >::system_function = typename base_type::system_function

Definition at line 189 of file realtime_integrator.hpp.

◆ time_type

template<system_state S, can_be_time T = double>
using diffeq::realtime::RealtimeIntegrator< S, T >::time_type = typename base_type::time_type

Definition at line 187 of file realtime_integrator.hpp.

◆ value_type

template<system_state S, can_be_time T = double>
using diffeq::realtime::RealtimeIntegrator< S, T >::value_type = typename base_type::value_type

Definition at line 188 of file realtime_integrator.hpp.

Constructor & Destructor Documentation

◆ RealtimeIntegrator()

template<system_state S, can_be_time T = double>
diffeq::realtime::RealtimeIntegrator< S, T >::RealtimeIntegrator ( std::unique_ptr< core::AbstractIntegrator< S, T > >  base_integrator,
RealtimeConfig  config = {} 
)
inlineexplicit

Definition at line 214 of file realtime_integrator.hpp.

◆ ~RealtimeIntegrator()

Definition at line 232 of file realtime_integrator.hpp.

Member Function Documentation

◆ emergency_stop()

template<system_state S, can_be_time T = double>
void diffeq::realtime::RealtimeIntegrator< S, T >::emergency_stop ( )
inline

Emergency stop - immediately halt integration.

Definition at line 368 of file realtime_integrator.hpp.

Here is the call graph for this function:

◆ get_current_state()

template<system_state S, can_be_time T = double>
state_type diffeq::realtime::RealtimeIntegrator< S, T >::get_current_state ( ) const
inline

Get current state (thread-safe)

Definition at line 384 of file realtime_integrator.hpp.

◆ integrate()

template<system_state S, can_be_time T = double>
void diffeq::realtime::RealtimeIntegrator< S, T >::integrate ( state_type &  state,
time_type  dt,
time_type  end_time 
)
inlineoverridevirtual

Enhanced integrate function with real-time capabilities.

Reimplemented from diffeq::core::AbstractIntegrator< S >.

Definition at line 310 of file realtime_integrator.hpp.

Here is the call graph for this function:

◆ register_signal_handler()

template<system_state S, can_be_time T = double>
template<typename SignalT , SignalHandler< SignalT > Handler>
void diffeq::realtime::RealtimeIntegrator< S, T >::register_signal_handler ( SignalType  type,
Handler &&  handler 
)
inline

Register signal handler for specific signal type.

Definition at line 427 of file realtime_integrator.hpp.

◆ send_control_signal()

template<system_state S, can_be_time T = double>
template<typename ControlData >
void diffeq::realtime::RealtimeIntegrator< S, T >::send_control_signal ( ControlData &&  data,
double  priority = 1.0 
)
inline

Send control signal (for robotics applications)

Definition at line 328 of file realtime_integrator.hpp.

Here is the caller graph for this function:

◆ send_financial_signal()

template<system_state S, can_be_time T = double>
template<typename FinancialData >
void diffeq::realtime::RealtimeIntegrator< S, T >::send_financial_signal ( FinancialData &&  data,
double  priority = 1.0 
)
inline

Send financial signal (for quantitative trading)

Definition at line 342 of file realtime_integrator.hpp.

◆ setup_process_connector()

template<system_state S, can_be_time T = double>
void diffeq::realtime::RealtimeIntegrator< S, T >::setup_process_connector ( communication::ProcessConnector::ConnectionConfig  config)
inline

Set up process connector for inter-process communication.

Definition at line 392 of file realtime_integrator.hpp.

◆ shutdown()

template<system_state S, can_be_time T = double>
void diffeq::realtime::RealtimeIntegrator< S, T >::shutdown ( )
inline

Stop real-time operation.

Definition at line 262 of file realtime_integrator.hpp.

◆ start_realtime()

template<system_state S, can_be_time T = double>
void diffeq::realtime::RealtimeIntegrator< S, T >::start_realtime ( )
inline

Start real-time operation.

Definition at line 245 of file realtime_integrator.hpp.

Here is the caller graph for this function:

◆ step()

template<system_state S, can_be_time T = double>
void diffeq::realtime::RealtimeIntegrator< S, T >::step ( state_type &  state,
time_type  dt 
)
inlineoverridevirtual

Enhanced step function with signal processing.

Implements diffeq::core::AbstractIntegrator< S >.

Definition at line 286 of file realtime_integrator.hpp.

Here is the caller graph for this function:

◆ update_parameters()

template<system_state S, can_be_time T = double>
void diffeq::realtime::RealtimeIntegrator< S, T >::update_parameters ( const std::unordered_map< std::string, double > &  params)
inline

Update system parameters dynamically.

Definition at line 355 of file realtime_integrator.hpp.


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