BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
587ae25
Branches
Tags
master
Blinker
src
noarch
StreamMgr.h
namespace for preprocessor constants
Stefan Schuermans
commited
587ae25
at 2011-12-14 20:23:49
StreamMgr.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_STREAMMGR_H #define BLINKER_STREAMMGR_H #include <map> #include <set> #include <string> #include "Stream.h" namespace Blinker { /// stream manager class StreamMgr { protected: /// stream map entry struct Entry { Stream m_stream; ///< the stream unsigned int m_refCnt; ///< reference count Entry(); ///< constructor }; /// map of streams typedef std::map<std::string, Entry> StreamMap; public: /// constructor StreamMgr(); /// destructor ~StreamMgr(); private: /// copy constructor disabled StreamMgr(const StreamMgr &that); /// assignment operator disabled const StreamMgr & operator=(const StreamMgr &that); public: /** * @brief reference stream * @param[in] name stream name * @return stream * * if the stream does not exists, it is created */ Stream & refStream(const std::string &name); /** * @brief unreference stream * @param[in] name stream name * * if the last reference is removed, the stream is deleted */ void unrefStream(const std::string &name); protected: /// map of streams StreamMap m_streams; }; // class StreamMgr } // namespace Blinker #endif // #ifndef BLINKER_STREAMMGR_H