BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
baf52da
Branches
Tags
master
Blinker
src
noarch
ModuleMgr_impl.h
put all managers in one structure to simplify adding managers
Stefan Schuermans
commited
baf52da
at 2011-12-22 11:32:05
ModuleMgr_impl.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 BLINKER_MODULEMGR_IMPL_H #define BLINKER_MODULEMGR_IMPL_H #include <list> #include "Directory.h" #include "ListTracker.h" #include "ListTracker_impl.h" #include "Mgrs.h" #include "Module.h" #include "ModuleMgr.h" #include "ModuleMgrCntr.h" #include "ModuleMgrCntr_impl.h" #include "TimeCallee.h" namespace Blinker { /** * @brief constructor * @param[in] mgrs managers * @param[in] dirBase base directory */ template<typename MODULE> ModuleMgr<MODULE>::ModuleMgr(Mgrs &mgrs, const Directory &dirBase): m_mgrs(mgrs), m_dirBase(dirBase), m_moduleListTracker(*this, dirBase) { m_moduleListTracker.init(); // request call in 1s m_mgrs.m_callMgr.requestTimeCall(this, Time::now() + Time(1)); } /// destructor template<typename MODULE> ModuleMgr<MODULE>::~ModuleMgr() { m_moduleListTracker.clear(); } /// callback when requested time reached template<typename MODULE> void ModuleMgr<MODULE>::timeCall() { updateConfig(); // request next call in 1s m_mgrs.m_callMgr.requestTimeCall(this, Time::now() + Time(1)); } /// check for update of configuration template<typename MODULE> void ModuleMgr<MODULE>::updateConfig() { // module list update m_moduleListTracker.updateConfig(); } } // namespace Blinker #endif // #ifndef BLINKER_MODULEMGR_IMPL_H