PPI: Remove specializations from documentation
[senf.git] / PPI / Events.hh
index cb21dd7..1b99c4b 100644 (file)
@@ -25,7 +25,8 @@
 #define HH_Events_ 1
 
 // Custom includes
-#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <vector>
+#include "Scheduler/ClockService.hh"
 #include "predecl.hh"
 
 //#include "Events.mpp"
@@ -64,23 +65,62 @@ namespace ppi {
 
         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, ClockService::clock_type time);
+        void callback(EventArg event);
+
+    private:
+        detail::EventBinding<EventType> & binding();
     };
+    
+#ifndef DOXYGEN
+
+    template <class Self>
+    class EventImplementationHelper<void,Self>
+    {
+    protected:
+        void callback(ClockService::clock_type time);
+        void callback();
+
+    private:
+        detail::EventBinding<void> & binding();
+    };
+
+#endif
 
     template <class EventType>
     class EventImplementation
-        : public EventDescriptor
+        : public EventDescriptor, 
+          public EventImplementationHelper< EventType, EventImplementation<EventType> >
     {
     public:
         typedef EventType Event;
         typedef typename detail::EventArgType<EventType>::type EventArg;
 
+        module::Module & module() const;
+        EventManager & manager() const;
+        
     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);
@@ -88,6 +128,7 @@ namespace ppi {
         detail::EventBinding<Event> * binding_;
 
         friend class EventManager;
+        friend class EventImplementationHelper< EventType, EventImplementation<EventType> >;
     };
 
 }}