DiffEq - Modern C++ ODE Integration Library 1.0.0
High-performance C++ library for solving ODEs with async signal processing
|
Timeout decorator - adds timeout protection to any integrator. More...
#include <timeout_decorator.hpp>
Public Member Functions | |
TimeoutDecorator (std::unique_ptr< AbstractIntegrator< S > > integrator, TimeoutConfig config={}) | |
Construct timeout decorator. | |
TimeoutResult | integrate_with_timeout (typename IntegratorDecorator< S >::state_type &state, typename IntegratorDecorator< S >::time_type dt, typename IntegratorDecorator< S >::time_type end_time) |
Main timeout-protected integration method. | |
void | integrate (typename IntegratorDecorator< S >::state_type &state, typename IntegratorDecorator< S >::time_type dt, typename IntegratorDecorator< S >::time_type end_time) override |
Override standard integrate to use timeout protection. | |
TimeoutConfig & | config () |
Access and modify timeout configuration. | |
const TimeoutConfig & | config () const |
void | update_config (TimeoutConfig new_config) |
Update timeout configuration with validation. | |
![]() | |
IntegratorDecorator (std::unique_ptr< base_type > integrator) | |
Construct decorator wrapping another integrator. | |
virtual | ~IntegratorDecorator ()=default |
Virtual destructor for proper cleanup. | |
void | step (state_type &state, time_type dt) override |
void | integrate (state_type &state, time_type dt, time_type end_time) override |
time_type | current_time () const override |
void | set_time (time_type t) override |
void | set_system (system_function sys) override |
base_type & | wrapped () |
Access to wrapped integrator for advanced use. | |
const base_type & | wrapped () const |
bool | has_wrapped_integrator () const |
Check if wrapped integrator exists. | |
![]() | |
AbstractIntegrator (system_function sys) | |
time_type | current_time () const |
void | set_time (time_type t) |
void | set_system (system_function sys) |
Additional Inherited Members | |
![]() | |
using | base_type = AbstractIntegrator< S > |
using | state_type = typename base_type::state_type |
using | time_type = typename base_type::time_type |
using | system_function = typename base_type::system_function |
![]() | |
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 &)> |
![]() | |
void | advance_time (time_type dt) |
![]() | |
std::unique_ptr< base_type > | wrapped_integrator_ |
![]() | |
system_function | sys_ |
time_type | current_time_ |
Timeout decorator - adds timeout protection to any integrator.
This decorator provides robust timeout protection with the following features:
Key Design Principles:
Definition at line 100 of file timeout_decorator.hpp.
|
inlineexplicit |
Construct timeout decorator.
integrator | The integrator to wrap |
config | Timeout configuration (validated on construction) |
std::invalid_argument | if config is invalid |
Definition at line 111 of file timeout_decorator.hpp.
|
inline |
Access and modify timeout configuration.
Definition at line 170 of file timeout_decorator.hpp.
|
inline |
Definition at line 171 of file timeout_decorator.hpp.
|
inlineoverride |
Override standard integrate to use timeout protection.
Definition at line 158 of file timeout_decorator.hpp.
|
inline |
Main timeout-protected integration method.
state | Initial state (modified in-place) |
dt | Time step |
end_time | Final integration time |
Definition at line 124 of file timeout_decorator.hpp.
|
inline |
Update timeout configuration with validation.
new_config | New configuration |
std::invalid_argument | if new config is invalid |
Definition at line 178 of file timeout_decorator.hpp.