X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FEventManager.hh;h=20535a03649f687184c445ff3f2d19175404fc1b;hb=bd9f9d3fd6fbcff0112a7bf48ab9284da9576b11;hp=46631e6d7946a7dac2921a0225cbbb0c60461b43;hpb=81ffa1c459b96dd44472bcef37e1e373934ee138;p=senf.git diff --git a/PPI/EventManager.hh b/PPI/EventManager.hh index 46631e6..20535a0 100644 --- a/PPI/EventManager.hh +++ b/PPI/EventManager.hh @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -23,12 +23,12 @@ /** \file \brief EventManager public header */ -#ifndef HH_EventManager_ -#define HH_EventManager_ 1 +#ifndef HH_SENF_PPI_EventManager_ +#define HH_SENF_PPI_EventManager_ 1 // Custom includes -#include #include +#include "../Scheduler/ClockService.hh" #include "predecl.hh" #include "detail/Callback.hh" #include "detail/EventBinding.hh" @@ -39,7 +39,11 @@ namespace senf { namespace ppi { - /** \brief + /** \brief Event registry and control + + The EventManager control event registration and manages global event parameters. The + EventManager controls event dispatch but does \e not control event generation. This is the + responsibility of an external component (the Scheduler) */ class EventManager { @@ -47,16 +51,13 @@ namespace ppi { /////////////////////////////////////////////////////////////////////////// // Types - template #ifndef DOXYGEN + // Somehow doxygen barfs on this definition + template struct Callback -#else - // This is SO stupid but doxygen must have some scoping problems if the - // struct is called 'Callback' and will hang in an endless loop somewhere - struct Callback_ -#endif - : public detail::Callback + : public detail::Callback {}; +#endif /////////////////////////////////////////////////////////////////////////// ///\name Structors and default members @@ -74,24 +75,28 @@ namespace ppi { ///@} /////////////////////////////////////////////////////////////////////////// + ClockService::clock_type now(); ///< Current time at last event dispatch + ClockService::clock_type time(); ///< Expected time of the last event + + protected: + + private: template void registerEvent(module::Module & module, typename Callback::type callback, Descriptor & descriptor); - boost::posix_time::ptime eventTime(); + void destroyModule(module::Module & module); - protected: - - private: typedef boost::ptr_vector EventRegistrations; EventRegistrations registrations_; - void eventTime(boost::posix_time::ptime time); + void eventTime(ClockService::clock_type time); - boost::posix_time::ptime eventTime_; + ClockService::clock_type eventTime_; friend class detail::EventBindingBase; + friend class module::Module; }; }}