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::core::TimeoutIntegrator< Integrator > Class Template Reference

Timeout-enabled integration wrapper. More...

#include <timeout_integrator.hpp>

Public Types

using integrator_type = Integrator
 
using state_type = typename Integrator::state_type
 
using time_type = typename Integrator::time_type
 

Public Member Functions

 TimeoutIntegrator (Integrator integrator, TimeoutConfig config={})
 Construct timeout integrator with an existing integrator.
 
template<typename... Args>
 TimeoutIntegrator (TimeoutConfig config, Args &&... args)
 Construct timeout integrator with integrator parameters.
 
IntegrationResult integrate_with_timeout (state_type &state, time_type dt, time_type end_time)
 Perform timeout-protected integration.
 
bool integrate_with_timeout_simple (state_type &state, time_type dt, time_type end_time, std::chrono::milliseconds timeout=std::chrono::milliseconds{0})
 Simple timeout integration (backwards compatibility)
 
Integrator & integrator ()
 Access the underlying integrator.
 
const Integrator & integrator () const
 
TimeoutConfigconfig ()
 Access timeout configuration.
 
const TimeoutConfigconfig () const
 

Detailed Description

template<typename Integrator>
class diffeq::core::TimeoutIntegrator< Integrator >

Timeout-enabled integration wrapper.

This class provides timeout protection for any integrator by wrapping the integration call in an async operation with configurable timeout.

Features:

  • Configurable timeout duration
  • Progress monitoring with callbacks
  • Detailed result information
  • Exception vs return value error handling
  • Compatible with all integrator types
Template Parameters
IntegratorThe integrator type to wrap

Definition at line 70 of file timeout_integrator.hpp.

Member Typedef Documentation

◆ integrator_type

template<typename Integrator >
using diffeq::core::TimeoutIntegrator< Integrator >::integrator_type = Integrator

Definition at line 72 of file timeout_integrator.hpp.

◆ state_type

template<typename Integrator >
using diffeq::core::TimeoutIntegrator< Integrator >::state_type = typename Integrator::state_type

Definition at line 73 of file timeout_integrator.hpp.

◆ time_type

template<typename Integrator >
using diffeq::core::TimeoutIntegrator< Integrator >::time_type = typename Integrator::time_type

Definition at line 74 of file timeout_integrator.hpp.

Constructor & Destructor Documentation

◆ TimeoutIntegrator() [1/2]

template<typename Integrator >
diffeq::core::TimeoutIntegrator< Integrator >::TimeoutIntegrator ( Integrator  integrator,
TimeoutConfig  config = {} 
)
inlineexplicit

Construct timeout integrator with an existing integrator.

Parameters
integratorThe integrator to wrap (moved)
configTimeout configuration

Definition at line 81 of file timeout_integrator.hpp.

◆ TimeoutIntegrator() [2/2]

template<typename Integrator >
template<typename... Args>
diffeq::core::TimeoutIntegrator< Integrator >::TimeoutIntegrator ( TimeoutConfig  config,
Args &&...  args 
)
inlineexplicit

Construct timeout integrator with integrator parameters.

Parameters
configTimeout configuration
argsArguments forwarded to integrator constructor

Definition at line 90 of file timeout_integrator.hpp.

Member Function Documentation

◆ config() [1/2]

template<typename Integrator >
TimeoutConfig & diffeq::core::TimeoutIntegrator< Integrator >::config ( )
inline

Access timeout configuration.

Returns
Reference to the timeout configuration

Definition at line 180 of file timeout_integrator.hpp.

◆ config() [2/2]

template<typename Integrator >
const TimeoutConfig & diffeq::core::TimeoutIntegrator< Integrator >::config ( ) const
inline

Definition at line 181 of file timeout_integrator.hpp.

◆ integrate_with_timeout()

template<typename Integrator >
IntegrationResult diffeq::core::TimeoutIntegrator< Integrator >::integrate_with_timeout ( state_type &  state,
time_type  dt,
time_type  end_time 
)
inline

Perform timeout-protected integration.

Parameters
stateState vector to integrate (modified in-place)
dtTime step size
end_timeFinal integration time
Returns
Integration result with timing and success information

Definition at line 100 of file timeout_integrator.hpp.

◆ integrate_with_timeout_simple()

template<typename Integrator >
bool diffeq::core::TimeoutIntegrator< Integrator >::integrate_with_timeout_simple ( state_type &  state,
time_type  dt,
time_type  end_time,
std::chrono::milliseconds  timeout = std::chrono::milliseconds{0} 
)
inline

Simple timeout integration (backwards compatibility)

Parameters
stateState vector to integrate
dtTime step size
end_timeFinal integration time
timeoutOptional timeout override
Returns
true if completed successfully, false if timed out

Definition at line 155 of file timeout_integrator.hpp.

◆ integrator() [1/2]

template<typename Integrator >
Integrator & diffeq::core::TimeoutIntegrator< Integrator >::integrator ( )
inline

Access the underlying integrator.

Returns
Reference to the wrapped integrator

Definition at line 173 of file timeout_integrator.hpp.

◆ integrator() [2/2]

template<typename Integrator >
const Integrator & diffeq::core::TimeoutIntegrator< Integrator >::integrator ( ) const
inline

Definition at line 174 of file timeout_integrator.hpp.


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