BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
552a4af
Branches
Tags
master
Blinker
src
noarch
ModuleMgr_impl.h
converted module manager to use list tracker
Stefan Schuermans
commited
552a4af
at 2011-12-11 00:38:00
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 MODULEMGR_IMPL_H #define MODULEMGR_IMPL_H #include <list> #include "CallMgr.h" #include "Directory.h" #include "ListTracker.h" #include "ListTracker_impl.h" #include "Module.h" #include "ModuleMgr.h" #include "ModuleMgrCntr.h" #include "ModuleMgrCntr_impl.h" #include "StreamMgr.h" #include "TimeCallee.h" namespace Blinker { /** * @brief constructor * @param[in] callMgr callback manager * @param[in] streamMgr stream manager * @param[in] dirBase base directory */ template<typename MODULE> ModuleMgr<MODULE>::ModuleMgr(CallMgr &callMgr, StreamMgr &streamMgr, const Directory &dirBase): m_callMgr(callMgr), m_streamMgr(streamMgr), m_dirBase(dirBase), m_moduleListTracker(*this, dirBase) { m_moduleListTracker.init(); // request call in 1s 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_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 MODULEMGR_IMPL_H