// Custom includes
#include <vector>
-#include "../Scheduler/ClockService.hh"
+#include <senf/Scheduler/ClockService.hh>
#include "predecl.hh"
//#include "Events.mpp"
-///////////////////////////////hh.p////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
namespace senf {
namespace ppi {
-
+
+ namespace detail { class EventBindingBase; }
+
/** \defgroup event_group Events
Events provide notification of events outside the PPI framework: I/O activity, Timers
All events are derived from EventImplementation which is based on EventDescriptor.
\see EventImplementation \n
- \ref ppi_events
+ \ref ppi_events
*/
// Implementation: The concrete EventDescriptor implementation will need to set things up so
// some callback (within the EventDescriptor implementation) will be called when the event
// happens. This setup happens in 'v_enable()'. This internal handler sets up an EventType
- // instance if needed and calls 'callback()'.
+ // instance if needed and calls 'callback()'.
//
// 'callback()' will access the EventBinding wrapper to find the user-callback to signal. It
// will do any needed internal processing, call that user callback and clean up afterwards.
The EventDescriptor base-class provides an interface to control events.
\see \ref ppi_events
- */
+ */
class EventDescriptor
{
public:
void notifyUnthrottle();
void registerRoute(ForwardingRoute & route);
+ void unregisterRoute(ForwardingRoute & route);
bool enabled_;
bool throttled_;
typedef std::vector<ForwardingRoute*> Routes;
Routes routes_;
+ detail::EventBindingBase * binding_;
+
friend class ForwardingRoute;
+ friend class detail::EventBindingBase;
};
-
+
/** \brief Internal: Callback forwarders
*/
template <class EventType, class Self>
private:
detail::EventBinding<EventType> & binding();
};
-
+
#ifndef DOXYGEN
template <class Self>
/** \brief Event implementation base class
- EventImplementation provides the base-class for all Event implementations.
+ EventImplementation provides the base-class for all Event implementations.
\code
class SomeEvent : public EventImplementation<SomeEventArg>
{
void cb() {
// Build event argument
- SomeEventArg arg (...);
+ SomeEventArg arg (...);
// Call the event callback
callback(arg);
}
*/
template <class EventType>
class EventImplementation
- : public EventDescriptor,
+ : public EventDescriptor,
public EventImplementationHelper< EventType, EventImplementation<EventType> >
{
public:
module::Module & module() const; ///< Module in which the event is registered
EventManager & manager() const; ///< EventManager of the event
-
+
protected:
EventImplementation();
}}
-///////////////////////////////hh.e////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
#include "Events.cci"
//#include "Events.ct"
#include "Events.cti"