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::composable::IntegratorDecorator< S > Class Template Reference

Base decorator interface for integrator enhancements. More...

#include <integrator_decorator.hpp>

Inheritance diagram for diffeq::core::composable::IntegratorDecorator< S >:
Collaboration diagram for diffeq::core::composable::IntegratorDecorator< S >:

Public Types

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
 
- 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

 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_typewrapped ()
 Access to wrapped integrator for advanced use.
 
const base_typewrapped () const
 
bool has_wrapped_integrator () const
 Check if wrapped integrator exists.
 
- 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)
 

Protected Attributes

std::unique_ptr< base_typewrapped_integrator_
 
- Protected Attributes inherited from diffeq::core::AbstractIntegrator< S >
system_function sys_
 
time_type current_time_
 

Additional Inherited Members

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

Detailed Description

template<system_state S>
class diffeq::core::composable::IntegratorDecorator< S >

Base decorator interface for integrator enhancements.

This provides the foundation for the decorator pattern, allowing facilities to be stacked independently without tight coupling.

Design Principles:

  • High Cohesion: Each decorator focuses on single responsibility
  • Low Coupling: Decorators combine without dependencies
  • Delegation: Forwards calls to wrapped integrator by default
  • Extensibility: Easy to add new decorators without modification

Definition at line 22 of file integrator_decorator.hpp.

Member Typedef Documentation

◆ base_type

Definition at line 24 of file integrator_decorator.hpp.

◆ state_type

template<system_state S>
using diffeq::core::composable::IntegratorDecorator< S >::state_type = typename base_type::state_type

Definition at line 25 of file integrator_decorator.hpp.

◆ system_function

template<system_state S>
using diffeq::core::composable::IntegratorDecorator< S >::system_function = typename base_type::system_function

Definition at line 27 of file integrator_decorator.hpp.

◆ time_type

template<system_state S>
using diffeq::core::composable::IntegratorDecorator< S >::time_type = typename base_type::time_type

Definition at line 26 of file integrator_decorator.hpp.

Constructor & Destructor Documentation

◆ IntegratorDecorator()

template<system_state S>
diffeq::core::composable::IntegratorDecorator< S >::IntegratorDecorator ( std::unique_ptr< base_type integrator)
inlineexplicit

Construct decorator wrapping another integrator.

Parameters
integratorThe integrator to wrap (takes ownership)

Definition at line 37 of file integrator_decorator.hpp.

Member Function Documentation

◆ current_time()

template<system_state S>
time_type diffeq::core::composable::IntegratorDecorator< S >::current_time ( ) const
inlineoverride

Definition at line 54 of file integrator_decorator.hpp.

◆ has_wrapped_integrator()

template<system_state S>
bool diffeq::core::composable::IntegratorDecorator< S >::has_wrapped_integrator ( ) const
inline

Check if wrapped integrator exists.

Returns
true if wrapped integrator is valid

Definition at line 79 of file integrator_decorator.hpp.

◆ integrate()

template<system_state S>
void diffeq::core::composable::IntegratorDecorator< S >::integrate ( state_type &  state,
time_type  dt,
time_type  end_time 
)
inlineoverridevirtual

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

Definition at line 50 of file integrator_decorator.hpp.

◆ set_system()

template<system_state S>
void diffeq::core::composable::IntegratorDecorator< S >::set_system ( system_function  sys)
inlineoverride

Definition at line 63 of file integrator_decorator.hpp.

◆ set_time()

template<system_state S>
void diffeq::core::composable::IntegratorDecorator< S >::set_time ( time_type  t)
inlineoverride

Definition at line 58 of file integrator_decorator.hpp.

◆ step()

template<system_state S>
void diffeq::core::composable::IntegratorDecorator< S >::step ( state_type &  state,
time_type  dt 
)
inlineoverridevirtual

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

Definition at line 46 of file integrator_decorator.hpp.

◆ wrapped() [1/2]

Access to wrapped integrator for advanced use.

Returns
Reference to the wrapped integrator

Definition at line 72 of file integrator_decorator.hpp.

◆ wrapped() [2/2]

template<system_state S>
const base_type & diffeq::core::composable::IntegratorDecorator< S >::wrapped ( ) const
inline

Definition at line 73 of file integrator_decorator.hpp.

Member Data Documentation

◆ wrapped_integrator_

template<system_state S>
std::unique_ptr<base_type> diffeq::core::composable::IntegratorDecorator< S >::wrapped_integrator_
protected

Definition at line 30 of file integrator_decorator.hpp.


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