BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
acfa3fd
Branches
Tags
master
Blinker
src
noarch
Priority.h
implemented priority based selector module
Stefan Schuermans
commited
acfa3fd
at 2011-11-21 22:01:04
Priority.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 PRIORITY_H #define PRIORITY_H #include <list> #include <string> #include <BlinkenLib/BlinkenFrame.h> #include "CallMgr.h" #include "Directory.h" #include "File.h" #include "Module.h" #include "SettingFile.h" #include "StreamMgr.h" namespace Blinker { /// a priority based stream selector class Priority: public Module { protected: /// input to priority based selector class Input; /// input list entry struct InEntry { std::string m_name; ///< name of input list entry Input *m_pInput; ///< input object InEntry(const std::string &name); ///< constructor }; /// input list typedef std::list<InEntry> InList; /// input list iterator typedef InList::const_reverse_iterator InListIt; public: /** * @brief constructor * @param[in] callMgr callback manager * @param[in] streamMgr stream manager * @param[in] dirBase base directory */ Priority(CallMgr &callMgr, StreamMgr &streamMgr, const Directory &dirBase); /// virtual destructor virtual ~Priority(); private: /// copy constructor disabled Priority(const Priority &that); /// assignment operator disabled const Priority & operator=(const Priority &that); public: /// check for update of configuration virtual void updateConfig(); protected: /// light update of input list, i.e. check all entries in current input list void updateInListLight(); /// full update of input list, i.e. scan subdirs in input list directory void updateInListFull(); /// get output stream void getOutStream(); /// release output stream void releaseOutStream(); /** * @brief select specific input (called by inputs) * @param[in] input input to select */ void select(const Input *pInput); /// select lower priority input (called by inputs) void selectLower(); /// send current frame to output stream void curFrame(); /** * @brief set current frame (also called by inputs) * @param[in] pFrame new frame to use */ void frame(stBlinkenFrame *pFrame); /// set current frame to "no frame" void noFrame(); protected: Directory m_dirInputs; ///< input stream directory SettingFile m_fileOutStream; ///< output stream name file InList m_inList; ///< current input list InListIt m_itCurIn; ///< current input std::string m_nameOutStream; ///< name of output stream Stream *m_pOutStream; ///< output stream }; // class Priority } // namespace Blinker #endif // #ifndef PRIORITY_H