PPI: fixed module destruction on shutdown if EventManger is already destroyed (like...
[senf.git] / senf / PPI / EventManager.hh
index fcca5da..a9bcc2b 100644 (file)
@@ -32,6 +32,7 @@
 #define HH_SENF_PPI_EventManager_ 1
 
 // Custom includes
+#include <boost/utility.hpp>
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <senf/Scheduler/ClockService.hh>
 #include "predecl.hh"
@@ -51,6 +52,7 @@ namespace ppi {
         responsibility of an external component (the Scheduler)
       */
     class EventManager
+        : boost::noncopyable
     {
     public:
         //-////////////////////////////////////////////////////////////////////////
@@ -69,6 +71,7 @@ namespace ppi {
         //\{
 
         static EventManager & instance();
+        static bool alive();
 
         // default default constructor
         // default copy constructor
@@ -86,6 +89,9 @@ namespace ppi {
     protected:
 
     private:
+        EventManager();
+        ~EventManager();
+
         template <class Descriptor>
         void registerEvent(module::Module & module,
                            typename Callback<Descriptor>::type callback,
@@ -101,6 +107,8 @@ namespace ppi {
 
         ClockService::clock_type eventTime_;
 
+        static bool alive_;
+
         friend class detail::EventBindingBase;
         friend class module::Module;
         friend class EventDescriptor;