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

Interprocess communication decorator. More...

#include <interprocess_decorator.hpp>

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

Public Member Functions

 InterprocessDecorator (std::unique_ptr< AbstractIntegrator< S > > integrator, InterprocessConfig config={})
 Construct interprocess decorator.
 
 ~InterprocessDecorator ()
 Destructor ensures proper cleanup.
 
void step (typename IntegratorDecorator< S >::state_type &state, typename IntegratorDecorator< S >::time_type dt) override
 Override step to handle IPC during integration.
 
void integrate (typename IntegratorDecorator< S >::state_type &state, typename IntegratorDecorator< S >::time_type dt, typename IntegratorDecorator< S >::time_type end_time) override
 Override integrate to handle IPC during integration.
 
void set_receive_callback (std::function< void(const S &, typename IntegratorDecorator< S >::time_type)> callback)
 Set callback for received data.
 
bool send_state (const S &state, typename IntegratorDecorator< S >::time_type time)
 Send state data to other processes.
 
const IPCStatsget_statistics () const
 Get current IPC statistics.
 
void reset_statistics ()
 Reset IPC statistics.
 
bool is_connected () const
 Check if channel is connected.
 
std::string get_status () const
 Get channel status.
 
InterprocessConfigconfig ()
 Access and modify interprocess configuration.
 
const InterprocessConfigconfig () const
 
- Public Member Functions inherited from diffeq::core::composable::IntegratorDecorator< S >
 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)
 

Additional Inherited Members

- Public Types inherited from diffeq::core::composable::IntegratorDecorator< S >
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 &)>
 
- Protected Member Functions inherited from diffeq::core::AbstractIntegrator< S >
void advance_time (time_type dt)
 
- Protected Attributes inherited from diffeq::core::composable::IntegratorDecorator< S >
std::unique_ptr< base_typewrapped_integrator_
 
- Protected Attributes inherited from diffeq::core::AbstractIntegrator< S >
system_function sys_
 
time_type current_time_
 

Detailed Description

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

Interprocess communication decorator.

This decorator provides comprehensive IPC capabilities with the following features:

  • Multiple IPC methods (shared memory, named pipes, sockets)
  • Producer/consumer and bidirectional communication
  • Synchronous and asynchronous operation modes
  • Reliability features (acknowledgments, retries, error correction)
  • Performance optimization (batching, compression)

Key Design Principles:

  • Single Responsibility: ONLY handles interprocess communication
  • Flexible: Multiple IPC methods and configurations
  • Robust: Error handling and reliability features
  • Performance: Optimized for low-latency communication

Definition at line 567 of file interprocess_decorator.hpp.

Constructor & Destructor Documentation

◆ InterprocessDecorator()

template<system_state S>
diffeq::core::composable::InterprocessDecorator< S >::InterprocessDecorator ( std::unique_ptr< AbstractIntegrator< S > >  integrator,
InterprocessConfig  config = {} 
)
inlineexplicit

Construct interprocess decorator.

Parameters
integratorThe integrator to wrap
configInterprocess configuration (validated on construction)
Exceptions
std::invalid_argumentif config is invalid

Definition at line 598 of file interprocess_decorator.hpp.

◆ ~InterprocessDecorator()

Destructor ensures proper cleanup.

Definition at line 613 of file interprocess_decorator.hpp.

Member Function Documentation

◆ config() [1/2]

Access and modify interprocess configuration.

Definition at line 743 of file interprocess_decorator.hpp.

◆ config() [2/2]

template<system_state S>
const InterprocessConfig & diffeq::core::composable::InterprocessDecorator< S >::config ( ) const
inline

Definition at line 744 of file interprocess_decorator.hpp.

◆ get_statistics()

template<system_state S>
const IPCStats & diffeq::core::composable::InterprocessDecorator< S >::get_statistics ( ) const
inline

Get current IPC statistics.

Definition at line 715 of file interprocess_decorator.hpp.

◆ get_status()

template<system_state S>
std::string diffeq::core::composable::InterprocessDecorator< S >::get_status ( ) const
inline

Get channel status.

Definition at line 736 of file interprocess_decorator.hpp.

◆ integrate()

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

Override integrate to handle IPC during integration.

Definition at line 646 of file interprocess_decorator.hpp.

Here is the call graph for this function:

◆ is_connected()

template<system_state S>
bool diffeq::core::composable::InterprocessDecorator< S >::is_connected ( ) const
inline

Check if channel is connected.

Definition at line 729 of file interprocess_decorator.hpp.

◆ reset_statistics()

template<system_state S>
void diffeq::core::composable::InterprocessDecorator< S >::reset_statistics ( )
inline

Reset IPC statistics.

Definition at line 722 of file interprocess_decorator.hpp.

◆ send_state()

template<system_state S>
bool diffeq::core::composable::InterprocessDecorator< S >::send_state ( const S &  state,
typename IntegratorDecorator< S >::time_type  time 
)
inline

Send state data to other processes.

Parameters
stateCurrent state
timeCurrent time
Returns
true if successful

Definition at line 675 of file interprocess_decorator.hpp.

Here is the caller graph for this function:

◆ set_receive_callback()

template<system_state S>
void diffeq::core::composable::InterprocessDecorator< S >::set_receive_callback ( std::function< void(const S &, typename IntegratorDecorator< S >::time_type)>  callback)
inline

Set callback for received data.

Parameters
callbackFunction to call when data is received

Definition at line 665 of file interprocess_decorator.hpp.

◆ step()

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

Override step to handle IPC during integration.

Definition at line 623 of file interprocess_decorator.hpp.

Here is the call graph for this function:

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