X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FModule.hh;h=c2faf562ab03ee662321de8e6ff0cda07cc57c50;hb=a4ebeef29f8eb69dc2dad10668d762540002b924;hp=1c6aba1f28e7179f78841e031f1d22dae434eba3;hpb=d8c2d9d478b8808e5b76e4688aea4f840b6a1df7;p=senf.git diff --git a/PPI/Module.hh b/PPI/Module.hh index 1c6aba1..c2faf56 100644 --- a/PPI/Module.hh +++ b/PPI/Module.hh @@ -33,6 +33,7 @@ #include #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,7 +297,13 @@ namespace module { private: #endif - virtual void init(); ///< Called just before the network is run + 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: