BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
0fee1b0
Branches
Tags
master
Blinker
src
noarch
Priority.h
implemented specialized setting files for different data types, simplified input/output stream handling in modules
Stefan Schuermans
commited
0fee1b0
at 2011-12-04 20:46:14
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 "OutStreamFile.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(); /** * @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(); protected: Directory m_dirInputs; ///< input stream directory OutStreamFile m_fileOutStream; ///< output stream name file InList m_inList; ///< current input list InListIt m_itCurIn; ///< current input }; // class Priority } // namespace Blinker #endif // #ifndef PRIORITY_H