BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
ce10d4f
Branches
Tags
master
Blinker
src
noarch
Printer.cpp
implemented base class for modules minor whitespace fixes
Stefan Schuermans
commited
ce10d4f
at 2011-10-24 19:31:39
Printer.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 <iostream> #include <stdlib.h> #include <string> #include <BlinkenLib/BlinkenFrame.h> #include "CallMgr.h" #include "Directory.h" #include "File.h" #include "Module.h" #include "Printer.h" #include "SettingFile.h" #include "StreamMgr.h" #include "StreamRecv.h" namespace Blinker { /** * @brief constructor * @param[in] callMgr callback manager * @param[in] streamMgr stream manager * @param[in] dirBase base directory */ Printer::Printer(CallMgr &callMgr, StreamMgr &streamMgr, const Directory &dirBase): Module(callMgr, streamMgr, dirBase), m_fileInStream(dirBase.getFile("instream")), m_pInStream(NULL) { // get input stream m_fileInStream.getStr(m_nameInStream); m_pInStream = &m_streamMgr.refStream(m_nameInStream); // attach to input stream if (m_pInStream) m_pInStream->attach(this); } /// virtual destructor Printer::~Printer() { // detach from input stream if (m_pInStream) m_pInStream->detach(this); // unreference stream m_pInStream = NULL; m_streamMgr.unrefStream(m_nameInStream); } /// check for update of configuration void Printer::updateConfig() { // TODO } /** * @brief set current frame * @param[in] pFrame current frame */ void Printer::setFrame(stBlinkenFrame *pFrame) { char *str = BlinkenFrameToString(pFrame); std::cout << str; free(str); } /// set current frame to none void Printer::setNoFrame() { std::cout << "no frame" << std::endl; } } // namespace Blinker