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::async::AsyncIntegrator< S > Class Template Reference

Lightweight async integrator wrapper. More...

#include <async_integrator.hpp>

Classes

struct  Config
 Configuration for async operation. More...
 

Public Types

using base_integrator_type = core::AbstractIntegrator< S >
 
using state_type = typename base_integrator_type::state_type
 
using time_type = typename base_integrator_type::time_type
 
using value_type = typename base_integrator_type::value_type
 
using system_function = typename base_integrator_type::system_function
 
using step_callback = std::function< void(const state_type &, time_type)>
 
using parameter_callback = std::function< void(const std::string &, double)>
 
using emergency_callback = std::function< void()>
 

Public Member Functions

 AsyncIntegrator (std::unique_ptr< base_integrator_type > integrator, Config config={})
 
void start ()
 Start async operation.
 
void stop ()
 Stop async operation.
 
std::future< void > step_async (state_type &state, time_type dt)
 Async integration step.
 
std::future< void > integrate_async (state_type &state, time_type dt, time_type end_time)
 Async integration over time interval.
 
void step (state_type &state, time_type dt)
 Synchronous delegation to base integrator.
 
void integrate (state_type &state, time_type dt, time_type end_time)
 
time_type current_time () const
 
void set_time (time_type t)
 
void set_system (system_function sys)
 
void set_step_callback (step_callback callback)
 Register callbacks for different events.
 
void set_parameter_callback (parameter_callback callback)
 
void set_emergency_callback (emergency_callback callback)
 
std::future< void > update_parameter_async (const std::string &name, double value)
 Update parameter asynchronously.
 
void emergency_stop ()
 Emergency stop.
 
void reset_emergency_stop ()
 Reset emergency stop.
 
state_type get_current_state () const
 Get current state (thread-safe)
 

Detailed Description

template<system_state S>
class diffeq::async::AsyncIntegrator< S >

Lightweight async integrator wrapper.

This provides async capabilities without heavy communication dependencies. It uses only standard C++ facilities and focuses on the core integration functionality with minimal external dependencies.

Definition at line 149 of file async_integrator.hpp.

Member Typedef Documentation

◆ base_integrator_type

template<system_state S>
using diffeq::async::AsyncIntegrator< S >::base_integrator_type = core::AbstractIntegrator<S>

Definition at line 151 of file async_integrator.hpp.

◆ emergency_callback

template<system_state S>
using diffeq::async::AsyncIntegrator< S >::emergency_callback = std::function<void()>

Definition at line 160 of file async_integrator.hpp.

◆ parameter_callback

template<system_state S>
using diffeq::async::AsyncIntegrator< S >::parameter_callback = std::function<void(const std::string&, double)>

Definition at line 159 of file async_integrator.hpp.

◆ state_type

template<system_state S>
using diffeq::async::AsyncIntegrator< S >::state_type = typename base_integrator_type::state_type

Definition at line 152 of file async_integrator.hpp.

◆ step_callback

template<system_state S>
using diffeq::async::AsyncIntegrator< S >::step_callback = std::function<void(const state_type&, time_type)>

Definition at line 158 of file async_integrator.hpp.

◆ system_function

template<system_state S>
using diffeq::async::AsyncIntegrator< S >::system_function = typename base_integrator_type::system_function

Definition at line 155 of file async_integrator.hpp.

◆ time_type

template<system_state S>
using diffeq::async::AsyncIntegrator< S >::time_type = typename base_integrator_type::time_type

Definition at line 153 of file async_integrator.hpp.

◆ value_type

template<system_state S>
using diffeq::async::AsyncIntegrator< S >::value_type = typename base_integrator_type::value_type

Definition at line 154 of file async_integrator.hpp.

Constructor & Destructor Documentation

◆ AsyncIntegrator()

template<system_state S>
diffeq::async::AsyncIntegrator< S >::AsyncIntegrator ( std::unique_ptr< base_integrator_type integrator,
Config  config = {} 
)
inlineexplicit

Definition at line 172 of file async_integrator.hpp.

◆ ~AsyncIntegrator()

Definition at line 181 of file async_integrator.hpp.

Member Function Documentation

◆ current_time()

template<system_state S>
time_type diffeq::async::AsyncIntegrator< S >::current_time ( ) const
inline

Definition at line 286 of file async_integrator.hpp.

◆ emergency_stop()

template<system_state S>
void diffeq::async::AsyncIntegrator< S >::emergency_stop ( )
inline

Emergency stop.

Definition at line 319 of file async_integrator.hpp.

◆ get_current_state()

template<system_state S>
state_type diffeq::async::AsyncIntegrator< S >::get_current_state ( ) const
inline

Get current state (thread-safe)

Definition at line 336 of file async_integrator.hpp.

◆ integrate()

template<system_state S>
void diffeq::async::AsyncIntegrator< S >::integrate ( state_type &  state,
time_type  dt,
time_type  end_time 
)
inline

Definition at line 277 of file async_integrator.hpp.

◆ integrate_async()

template<system_state S>
std::future< void > diffeq::async::AsyncIntegrator< S >::integrate_async ( state_type &  state,
time_type  dt,
time_type  end_time 
)
inline

Async integration over time interval.

Definition at line 240 of file async_integrator.hpp.

◆ reset_emergency_stop()

template<system_state S>
void diffeq::async::AsyncIntegrator< S >::reset_emergency_stop ( )
inline

Reset emergency stop.

Definition at line 329 of file async_integrator.hpp.

◆ set_emergency_callback()

template<system_state S>
void diffeq::async::AsyncIntegrator< S >::set_emergency_callback ( emergency_callback  callback)
inline

Definition at line 301 of file async_integrator.hpp.

◆ set_parameter_callback()

template<system_state S>
void diffeq::async::AsyncIntegrator< S >::set_parameter_callback ( parameter_callback  callback)
inline

Definition at line 297 of file async_integrator.hpp.

◆ set_step_callback()

template<system_state S>
void diffeq::async::AsyncIntegrator< S >::set_step_callback ( step_callback  callback)
inline

Register callbacks for different events.

Definition at line 293 of file async_integrator.hpp.

◆ set_system()

template<system_state S>
void diffeq::async::AsyncIntegrator< S >::set_system ( system_function  sys)
inline

Definition at line 288 of file async_integrator.hpp.

◆ set_time()

template<system_state S>
void diffeq::async::AsyncIntegrator< S >::set_time ( time_type  t)
inline

Definition at line 287 of file async_integrator.hpp.

◆ start()

template<system_state S>
void diffeq::async::AsyncIntegrator< S >::start ( )
inline

Start async operation.

Definition at line 188 of file async_integrator.hpp.

◆ step()

template<system_state S>
void diffeq::async::AsyncIntegrator< S >::step ( state_type &  state,
time_type  dt 
)
inline

Synchronous delegation to base integrator.

Definition at line 264 of file async_integrator.hpp.

◆ step_async()

template<system_state S>
std::future< void > diffeq::async::AsyncIntegrator< S >::step_async ( state_type &  state,
time_type  dt 
)
inline

Async integration step.

Definition at line 218 of file async_integrator.hpp.

◆ stop()

template<system_state S>
void diffeq::async::AsyncIntegrator< S >::stop ( )
inline

Stop async operation.

Definition at line 201 of file async_integrator.hpp.

◆ update_parameter_async()

template<system_state S>
std::future< void > diffeq::async::AsyncIntegrator< S >::update_parameter_async ( const std::string &  name,
double  value 
)
inline

Update parameter asynchronously.

Definition at line 308 of file async_integrator.hpp.


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