/* Blinker
Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org>
Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
a blinkenarea.org project */
#ifndef SENDER_H
#define SENDER_H
#include <list>
#include <string>
#include <BlinkenLib/BlinkenFrame.h>
#include "CallMgr.h"
#include "Directory.h"
#include "File.h"
#include "Module.h"
#include "SettingFile.h"
#include "StreamMgr.h"
#include "StreamRecv.h"
namespace Blinker {
/// stream sender
template<typename ADDR, typename SOCK>
class Sender: public Module, public StreamRecv
{
protected:
/// static destination
struct Dest {
std::string m_name; ///< name of static destination
SettingFile m_file; ///< setting file object
ADDR m_addr; ///< parsed address
Dest(const std::string &name, const File &file); ///< constructor
bool parse(); ///< parse address from current file
};
/// static destinations
typedef std::list<Dest> Dests;
public:
/**
* @brief constructor
* @param[in] callMgr callback manager
* @param[in] streamMgr stream manager
* @param[in] dirBase base directory
*/
Sender(CallMgr &callMgr, StreamMgr &streamMgr, const Directory &dirBase);
/// virtual destructor
virtual ~Sender();