/* Blinker
Copyright 2011-2014 Stefan Schuermans <stefan@blinkenarea.org>
Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
a blinkenarea.org project */
#ifndef BLINKER_CALLMGR_H
#define BLINKER_CALLMGR_H
#include <map>
#include <set>
#include "Io.h"
#include "IoCallee.h"
#include "Time.h"
#include "TimeCallee.h"
namespace Blinker {
/// callback manager, calls back at certain time or events
class CallMgr
{
protected:
/// set of I/O callees to call for a certain I/O object
typedef std::set<IoCallee *> IoCallees;
/// what set of I/O callees to call for a certain I/O object
typedef std::map<Io *, IoCallees> IoMap;
/// set of time callees to call at a certain time
typedef std::set<TimeCallee *> TimeCallees;
/// what set of time callees to call at a certain time
typedef std::map<Time, TimeCallees> TimeMap;
/// when to call a time callee
typedef std::map<TimeCallee *, Time> TimeCalleeMap;
public:
/// constructor
CallMgr();
/// destructor
~CallMgr();
private:
/// copy constructor disabled
CallMgr(const CallMgr &that);
/// assignment operator disabled
const CallMgr & operator=(const CallMgr &that);
public:
/**
* @brief cancel callback at read I/O event