1 #ifndef __GTS_SYNCER_H__
2 #define __GTS_SYNCER_H__
8 #include <boost/function.hpp>
19 Timer(boost::function<void ()> callback, time_t interval);
24 time_t getInterval() const { return _interval; }
25 time_t getLastFire() const { return _lastFire; }
26 int getTimeout() const;
30 boost::function<void ()> _callback;
33 typedef std::list<Timer>::iterator TimerIterator;
34 typedef std::pair<Switch, TimerIterator> TimedSwitch;
38 Syncer(SettingsParser & sp,
42 void run(const bool & running, bool & reload);
45 SettingsParser & _settingsParser;
47 std::list<Timer> _timers;
48 std::list<TimedSwitch> _switches;
52 Timer & getNextTimer();
53 bool getSwitchesState(std::map<std::string, Switch> & switches);
54 bool getDBData(std::string & data) const;