File indexing completed on 2024-11-15 09:19:51
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
0023 #include <boost/function.hpp>
0024
0025 namespace boost {
0026 namespace numeric {
0027 namespace odeint {
0028
0029 template< class State , class Time >
0030 class observer_collection
0031 {
0032 public:
0033
0034 typedef boost::function< void( const State& , const Time& ) > observer_type;
0035 typedef std::vector< observer_type > collection_type;
0036
0037 void operator()( const State& x , Time t )
0038 {
0039 for( size_t i=0 ; i<m_observers.size() ; ++i )
0040 m_observers[i]( x , t );
0041 }
0042
0043 collection_type& observers( void ) { return m_observers; }
0044 const collection_type& observers( void ) const { return m_observers; }
0045
0046 private:
0047
0048 collection_type m_observers;
0049 };
0050
0051 }
0052 }
0053 }
0054
0055
0056 #endif