BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
362c1f4
Branches
Tags
master
Blinker
src
common
SyncMgr.h
update copyright header
Stefan Schuermans
commited
362c1f4
at 2019-05-04 17:17:10
SyncMgr.h
Blame
History
Raw
/* Blinker Copyright 2011-2019 Stefan Schuermans <stefan@blinkenarea.org> Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html a blinkenarea.org project */ #ifndef BLINKER_SYNCMGR_H #define BLINKER_SYNCMGR_H #include <map> #include <string> #include "Sync.h" namespace Blinker { /// sync stream manager class SyncMgr { protected: /// sync stream map entry struct Entry { Sync m_sync; ///< the sync stream unsigned int m_refCnt; ///< reference count Entry(); ///< constructor }; /// map of sync streams typedef std::map<std::string, Entry> SyncMap; public: /// constructor SyncMgr(); /// destructor ~SyncMgr(); private: /// copy constructor disabled SyncMgr(const SyncMgr &that); /// assignment operator disabled const SyncMgr & operator=(const SyncMgr &that); public: /** * @brief reference sync stream * @param[in] name sync stream name * @return sync stream * * if the sync stream does not exists, it is created */ Sync & refSync(const std::string &name); /** * @brief unreference sync stream * @param[in] name sync stream name * * if the last reference is removed, the sync stream is deleted */ void unrefSync(const std::string &name); protected: /// map of sync streams SyncMap m_syncs; }; // class SyncMgr } // namespace Blinker #endif // #ifndef BLINKER_SYNCMGR_H