BlinkenArea - GitList
Repositories
Blog
Wiki
Blinker
Code
Commits
Branches
Tags
Search
Tree:
7eaa394
Branches
Tags
master
Blinker
src
noarch
SenderDest.h
simplified sender module a lot, support only one protocol per instance
Stefan Schuermans
commited
7eaa394
at 2011-12-04 14:49:17
SenderDest.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 SENDERDEST_H #define SENDERDEST_H #include <string> #include "Directory.h" #include "File.h" #include "Module.h" #include "Sender.h" #include "SettingFile.h" namespace Blinker { /// static destination of a stream sender template<typename ADDR, typename SOCK> class Sender<ADDR, SOCK>::Dest { public: /** * @brief constructor * @param[in] sender owning sender object * @param[in] dirBase base directory * @param[in] pNoFrameData protocol data for "no frame" packet * (empty if unknown) */ Dest(Sender &sender, const Directory &dirBase, const std::string *pNoFrameData); /// destructor ~Dest(); private: /// copy constructor disabled Dest(const Dest &that); /// assignment operator disabled const Dest & operator=(const Dest &that); public: /// check for update of configuration void updateConfig(); /** * @brief set current protocol data * @param[in] pData protocol data to send to address (empty if unkown) */ void setProtoData(const std::string *pData); protected: /// (re-)get address void getAddr(); /** * @brief send protocol data to address * @param[in] pData protocol data to send to address (empty if unknown) */ void send(const std::string *pData); protected: Sender &m_sender; ///< owning sender object SettingFile m_fileAddr; ///< address file ADDR m_addr; ///< address bool m_haveAddr; ///< if address is available const std::string *m_pNoFrameData; ///< protocol data for "no frame" packet const std::string *m_pData; ///< protocol data to send to address }; // class Sender<ADDr, SOCK>::Dest } // namespace Blinker #endif // #ifndef SENDERDEST_H