Packets: Fix VariantParser invalid parser access bug
[senf.git] / PPI / Module.hh
index 9c19e6c..97f1c11 100644 (file)
@@ -24,8 +24,8 @@
     \brief Module public header 
 */
 
-#ifndef HH_Module_
-#define HH_Module_ 1
+#ifndef HH_SENF_PPI_Module_
+#define HH_SENF_PPI_Module_ 1
 
 // Custom includes
 #include <vector>
@@ -33,6 +33,7 @@
 #include <boost/ptr_container/ptr_vector.hpp>
 #include "../Scheduler/ClockService.hh"
 #include "predecl.hh"
+#include "ModuleManager.hh"
 
 //#include "Module.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
@@ -157,6 +158,13 @@ namespace module {
                 event.enable();
             }
 
+            void v_init() {
+                // Optional. Called after before running the module but after connections have been
+                // set up. This is either directly before senf::ppi::run() or senf::ppi::init() is
+                // called or, for modules created while the PPI is already running, after returning
+                // from all event handlers but before going back to the event loop.
+            }
+
         };
         \endcode
 
@@ -167,7 +175,7 @@ namespace module {
         \see \ref ppi_modules
      */
     class Module
-        : boost::noncopyable
+        : ModuleManager::Initializable, boost::noncopyable
     {
     public:
         virtual ~Module();
@@ -289,8 +297,13 @@ namespace module {
 
     private:
 #endif
-        void init();
-        virtual void v_init();
+        virtual void v_init();          ///< Called after module setup
+                                        /**< This member is called directly before the PPI (resumes)
+                                             execution. It is called after connections have been
+                                             setup before entering the PPI main loop. 
+
+                                             You may overload this member. Your overload should
+                                             always call the base-class implementation. */
 
 #ifndef DOXYGEN
     public: