|
DiffEq - Modern C++ ODE Integration Library 1.0.0
High-performance C++ library for solving ODEs with async signal processing
|
Event decorator - adds event-driven feedback capabilities to any integrator. More...
#include <event_decorator.hpp>


Public Member Functions | |
| EventDecorator (std::unique_ptr< AbstractIntegrator< S, T > > integrator, EventConfig config={}) | |
| Construct event decorator. | |
| ~EventDecorator () | |
| Destructor ensures proper cleanup. | |
| void | step (typename IntegratorDecorator< S, T >::state_type &state, T dt) override |
| Override step to handle events during integration. | |
| void | integrate (typename IntegratorDecorator< S, T >::state_type &state, T dt, T end_time) override |
| Override integrate to handle events during integration. | |
| void | register_event_handler (EventTrigger trigger, std::function< void(S &, T)> handler) |
| Register event handler for specific trigger type. | |
| void | trigger_event (const std::string &event_id, EventPriority priority, std::function< void(S &, T)> handler, std::vector< uint8_t > data={}) |
| Trigger custom event. | |
| void | submit_sensor_data (const std::string &sensor_id, const std::vector< double > &values, double confidence=1.0) |
| Submit sensor data. | |
| void | submit_control_feedback (const std::string &control_id, const S &target_state, const S ¤t_state) |
| Submit control feedback. | |
| void | set_state_condition (std::function< bool(const S &, T)> condition, std::function< void(S &, T)> handler, EventPriority priority=EventPriority::NORMAL) |
| Set state-based event condition. | |
| void | set_threshold_event (size_t state_index, double threshold, bool crossing_direction, std::function< void(S &, T)> handler) |
| Set threshold crossing event. | |
| const EventStats & | get_statistics () const |
| Get event statistics. | |
| void | reset_statistics () |
| Reset event statistics. | |
| const std::vector< Event< S, T > > & | get_event_history () const |
| Get event history. | |
| void | clear_event_history () |
| Clear event history. | |
| std::map< std::string, SensorData< T > > | get_sensor_data () const |
| Get current sensor data. | |
| std::map< std::string, ControlFeedback< S, T > > | get_control_feedback () const |
| Get current control feedback. | |
| EventConfig & | config () |
| Access and modify event configuration. | |
| const EventConfig & | config () 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_type & | wrapped () |
| Access to wrapped integrator for advanced use. | |
| const base_type & | wrapped () 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_type > | wrapped_integrator_ |
Protected Attributes inherited from diffeq::core::AbstractIntegrator< S > | |
| system_function | sys_ |
| time_type | current_time_ |
Event decorator - adds event-driven feedback capabilities to any integrator.
This decorator provides comprehensive event-driven capabilities with the following features:
Key Design Principles:
Definition at line 237 of file event_decorator.hpp.
|
inlineexplicit |
Construct event decorator.
| integrator | The integrator to wrap |
| config | Event configuration (validated on construction) |
| std::invalid_argument | if config is invalid |
Definition at line 270 of file event_decorator.hpp.
|
inline |
Destructor ensures proper cleanup.
Definition at line 289 of file event_decorator.hpp.
|
inline |
Clear event history.
Definition at line 474 of file event_decorator.hpp.
|
inline |
Access and modify event configuration.
Definition at line 497 of file event_decorator.hpp.
|
inline |
Definition at line 498 of file event_decorator.hpp.
|
inline |
Get current control feedback.
Definition at line 489 of file event_decorator.hpp.
|
inline |
Get event history.
Definition at line 467 of file event_decorator.hpp.
|
inline |
Get current sensor data.
Definition at line 481 of file event_decorator.hpp.
|
inline |
Get event statistics.
Definition at line 452 of file event_decorator.hpp.
|
inlineoverride |
Override integrate to handle events during integration.
Definition at line 314 of file event_decorator.hpp.
|
inline |
Register event handler for specific trigger type.
Definition at line 330 of file event_decorator.hpp.

|
inline |
Reset event statistics.
Definition at line 459 of file event_decorator.hpp.
|
inline |
Set state-based event condition.
| condition | Function that returns true when event should trigger |
| handler | Event handler function |
| priority | Event priority |
Definition at line 408 of file event_decorator.hpp.

|
inline |
Set threshold crossing event.
| state_index | Index of state variable to monitor |
| threshold | Threshold value |
| crossing_direction | true for upward crossing, false for downward |
| handler | Event handler function |
Definition at line 426 of file event_decorator.hpp.

|
inlineoverride |
Override step to handle events during integration.
Definition at line 297 of file event_decorator.hpp.
|
inline |
Submit control feedback.
| control_id | Control identifier |
| target_state | Target state |
| current_state | Current state |
Definition at line 387 of file event_decorator.hpp.

|
inline |
Submit sensor data.
| sensor_id | Sensor identifier |
| values | Sensor values |
| confidence | Confidence level (0.0 to 1.0) |
Definition at line 363 of file event_decorator.hpp.

|
inline |
Trigger custom event.
| event_id | Unique event identifier |
| priority | Event priority |
| handler | Event handler function |
| data | Optional event data |
Definition at line 341 of file event_decorator.hpp.
