35#ifndef BERTINI_DETAIL_OBSERVER_HPP
36#define BERTINI_DETAIL_OBSERVER_HPP
41#include <boost/fusion/adapted/std_tuple.hpp>
43#include <boost/fusion/algorithm/iteration/for_each.hpp>
44#include <boost/fusion/include/for_each.hpp>
57 { BOOST_TYPE_INDEX_REGISTER_CLASS
80 template<
class ObservedT>
82 { BOOST_TYPE_INDEX_REGISTER_CLASS
102 template<
class ObservedT,
template<
class>
class... ObserverTypes>
104 { BOOST_TYPE_INDEX_REGISTER_CLASS
114 using namespace boost::fusion;
115 auto f = [&e](
auto &obs) { obs.Observe(e); };
116 for_each(observers_, f);
119 std::tuple<ObserverTypes<ObservedT>...> observers_;
Strawman Event type, enabling polymorphism.
Definition detail/events.hpp:47
Strawman base class for Observer objects.
Definition observer.hpp:57
virtual void Observe(AnyEvent const &e)=0
Observe the observable object being observed. This is probably in response to NotifyObservers.
A class which can glob together observer types into a new, single observer type.
Definition observer.hpp:104
void Observe(AnyEvent const &e) override
Observe override which calls the overrides for the types you glued together.
Definition observer.hpp:112
Actual observer type, which you should derive from to extract custom information from observable type...
Definition observer.hpp:82
Contains the detail/events base types.