BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
f0c104c
Branches
Tags
master
Blinker
src
noarch
OutStreamFile.cpp
implemented specialized setting files for different data types, simplified input/output stream handling in modules
Stefan Schuermans
commited
f0c104c
at 2011-12-04 20:10:37
OutStreamFile.cpp
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 */ #include "File.h" #include "OutStreamFile.h" #include "Stream.h" #include "StreamFile.h" #include "StreamMgr.h" namespace Blinker { /** * @brief constructor from path * @param[in] path path to file * @param[in] streamMgr stream manager */ OutStreamFile::OutStreamFile(const std::string &path, StreamMgr &streamMgr): StreamFile(path, streamMgr) { update(); } /** * @brief constructor from basic file * @param[in] file basic file object * @param[in] streamMgr stream manager */ OutStreamFile::OutStreamFile(const File &file, StreamMgr &streamMgr): StreamFile(file, streamMgr) { update(); } /// destructor OutStreamFile::~OutStreamFile() { setFrame(NULL); // set empty frame (stream is ending) // unreferencing stream happens in destructor of StreamFile } /** * @brief assignment operator * @param[in] file basic file object */ const OutStreamFile & OutStreamFile::operator=(const File &file) { setFrame(NULL); // set empty frame (stream is ending) StreamFile::operator=(file); return *this; } /// update, i.e. (re-)read file and reference new stream void OutStreamFile::update() { setFrame(NULL); // set empty frame (stream is ending) StreamFile::update(); } /** * @brief set current frame * @param[in] pFrame current frame (NULL for none) */ void OutStreamFile::setFrame(stBlinkenFrame *pFrame) { if (m_pStream) m_pStream->setFrame(pFrame); } } // namespace Blinker