BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
72afe56
Branches
Tags
master
Blinker
src
noarch
ModuleMgr.h
split ModuleMgr.h into declaration and implementation files
Stefan Schuermans
commited
72afe56
at 2011-12-11 00:04:04
ModuleMgr.h
Blame
History
Raw
/* Blinker Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org> Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html a blinkenarea.org project */ #ifndef MODULEMGR_H #define MODULEMGR_H #include <list> #include "CallMgr.h" #include "Directory.h" #include "Module.h" #include "StreamMgr.h" #include "TimeCallee.h" namespace Blinker { /// manager for modules of one type template<typename MODULE> class ModuleMgr: public TimeCallee { protected: /// module list entry struct Entry { std::string m_name; ///< name of module MODULE *m_pModule; ///< module object Entry(const std::string &name); ///< constructor void createModule(ModuleMgr &mgr); ///< create module void destroyModule(); ///< destroy module }; /// module list typedef std::list<Entry> ModuleList; public: /** * @brief constructor * @param[in] callMgr callback manager * @param[in] streamMgr stream manager * @param[in] dirBase base directory */ ModuleMgr(CallMgr &callMgr, StreamMgr &streamMgr, const Directory &dirBase); /// destructor ~ModuleMgr(); private: /// copy constructor disabled ModuleMgr(const ModuleMgr &that); /// assignment operator disabled const ModuleMgr & operator=(const ModuleMgr &that); public: /// callback when requsted time reached virtual void timeCall(); protected: /// check for update of configuration void updateConfig(); /// light update of module list, i.e. call all modules in current list void updateModuleListLight(); /// full update of module list, i.e. scan all subdirs in base directory void updateModuleListFull(); protected: CallMgr &m_callMgr; ///< callback manager StreamMgr &m_streamMgr; ///< stream manager Directory m_dirBase; ///< base directory ModuleList m_moduleList; ///< module list }; // class ModuleMgr } // namespace Blinker #endif // #ifndef MODULEMGR_H