X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FModuleManager.hh;h=08d1cce81f1b52cd44afa679d66e39e43fc9c7bc;hb=b52002fa2001e6472d6aa3dde263b85f654c6e8e;hp=abf7cbc9d6745f90957da69562e18f30d7d35063;hpb=f539f4271d470794a773a92bacd8ba086c9bc1cd;p=senf.git diff --git a/PPI/ModuleManager.hh b/PPI/ModuleManager.hh index abf7cbc..08d1cce 100644 --- a/PPI/ModuleManager.hh +++ b/PPI/ModuleManager.hh @@ -36,7 +36,10 @@ namespace senf { namespace ppi { - /** \brief + /** \brief Internal: Module management + + Every module is registered with the ModuleManager. The ModuleManager controls module + initialization and execution of the network. */ class ModuleManager { @@ -57,18 +60,29 @@ namespace ppi { ///@} /////////////////////////////////////////////////////////////////////////// - void registerModule(module::Module & module); - void unregisterModule(module::Module & module); - - void init(); - void run(); + void init(); ///< Called by senf::ppi::init() + void run(); ///< Called by senf::ppi::run() - protected: + bool running() const; ///< \c true, if the network is running private: + ModuleManager(); + + void registerModule(module::Module & module); + void unregisterModule(module::Module & module); + typedef std::vector ModuleRegistry; +#ifndef DOXYGEN + struct RunGuard; + friend class RunGuard; +#endif + ModuleRegistry moduleRegistry_; + bool running_; + bool terminate_; + + friend class module::Module; };