File indexing completed on 2025-07-12 08:21:32
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED
0020
0021 #include <vector>
0022 #include <functional>
0023
0024 namespace boost {
0025 namespace numeric {
0026 namespace odeint {
0027
0028 template< class State , class Time >
0029 class observer_collection
0030 {
0031 public:
0032
0033 typedef std::function< void( const State& , const Time& ) > observer_type;
0034 typedef std::vector< observer_type > collection_type;
0035
0036 void operator()( const State& x , Time t )
0037 {
0038 for( size_t i=0 ; i<m_observers.size() ; ++i )
0039 m_observers[i]( x , t );
0040 }
0041
0042 collection_type& observers( void ) { return m_observers; }
0043 const collection_type& observers( void ) const { return m_observers; }
0044
0045 private:
0046
0047 collection_type m_observers;
0048 };
0049
0050 }
0051 }
0052 }
0053
0054
0055 #endif