3 boost/numeric/odeint/integrate/observer_collection.hpp
6 Collection of observers, which are all called during the evolution of the ODE.
9 Copyright 2011-2012 Karsten Ahnert
10 Copyright 2011-2012 Mario Mulansky
12 Distributed under the Boost Software License, Version 1.0.
13 (See accompanying file LICENSE_1_0.txt or
14 copy at http://www.boost.org/LICENSE_1_0.txt)
18 #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED
19 #define BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED
23 #include <boost/function.hpp>
29 template< class State , class Time >
30 class observer_collection
34 typedef boost::function< void( const State& , const Time& ) > observer_type;
35 typedef std::vector< observer_type > collection_type;
37 void operator()( const State& x , Time t )
39 for( size_t i=0 ; i<m_observers.size() ; ++i )
40 m_observers[i]( x , t );
43 collection_type& observers( void ) { return m_observers; }
44 const collection_type& observers( void ) const { return m_observers; }
48 collection_type m_observers;
52 } // namespace numeric
56 #endif // BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED