BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
3032550
Branches
Tags
master
Blinker
src
noarch
CallMgr.h
first version, plays videos to stdout
Stefan Schuermans
commited
3032550
at 2011-10-23 11:37:40
CallMgr.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 CALLMGR_H #define CALLMGR_H #include <map> #include <set> #include "Time.h" #include "TimeCallee.h" namespace Blinker { /// callback manager, calls back at certain time or events class CallMgr { protected: /// set of time callees to call at a certain time typedef std::set<TimeCallee *> TimeCallees; /// what set of time callees to call at a certain time typedef std::map<Time, TimeCallees> TimeMap; /// when to call a time callee typedef std::map<TimeCallee *, Time> TimeCalleeMap; public: /// constructor CallMgr(); /// destructor ~CallMgr(); private: /// copy constructor disabled CallMgr(const CallMgr & that); /// assignment operator disabled const CallMgr& operator=(const CallMgr &that); public: /** * @brief cancel callback at certain time * @param[in] callee whom not to call */ void cancelTimeCall(TimeCallee *callee); /** * @brief request callback at certain time * @param[in] callee whom to call * @param[in] time when to call * * this cancels a previous time call request from callee */ void requestTimeCall(TimeCallee *callee, const Time &time); /// run call manager void run(); protected: /// what time callees to call at a certain time TimeMap m_times; /// when to call time callees TimeCalleeMap m_timeCallees; }; // class CallMgr } // namespace Blinker #endif // #ifndef CALLMGR_H