#define HH_Events_ 1
// Custom includes
+#include <vector>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include "predecl.hh"
virtual bool v_isRegistered() = 0;
+ void notifyThrottle();
+ void notifyUnthrottle();
+
+ void registerRoute(ForwardingRoute & route);
+
bool enabled_;
+
+ typedef std::vector<ForwardingRoute*> Routes;
+ Routes routes_;
+
+ friend class ForwardingRoute;
+ };
+
+ template <class EventType, class Self>
+ class EventImplementationHelper
+ {
+ protected:
+ typedef typename detail::EventArgType<EventType>::type EventArg;
+
+ void callback(EventArg event, boost::posix_time::ptime time);
+ void callback(EventArg event);
+
+ private:
+ detail::EventBinding<EventType> & binding();
+ };
+
+ template <class Self>
+ class EventImplementationHelper<void,Self>
+ {
+ protected:
+ void callback(boost::posix_time::ptime time);
+ void callback();
+
+ private:
+ detail::EventBinding<void> & binding();
};
template <class EventType>
class EventImplementation
- : public EventDescriptor
+ : public EventDescriptor,
+ public EventImplementationHelper< EventType, EventImplementation<EventType> >
{
public:
typedef EventType Event;
protected:
EventImplementation();
- void callback(EventArg event, boost::posix_time::ptime time);
- void callback(EventArg event);
-
private:
virtual bool v_isRegistered();
void setBinding(detail::EventBinding<Event> & binding);
detail::EventBinding<Event> * binding_;
friend class EventManager;
+ friend class EventImplementationHelper< EventType, EventImplementation<EventType> >;
};
}}