/* Blinker
Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org>
Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
a blinkenarea.org project */
#ifndef STREAMMGR_H
#define 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