Subversion Repositories HomeAutomation

Rev

Rev 1601 | Rev 1619 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1601 Rev 1604
Line 18... Line 18...
18
 
18
 
19
*/
19
*/
20
 
20
 
21
#ifndef VM_PLUGIN_TIMER_H
21
#ifndef VM_PLUGIN_TIMER_H
22
#define VM_PLUGIN_TIMER_H
22
#define VM_PLUGIN_TIMER_H
-
 
23
 
-
 
24
#include <set>
23
 
25
 
24
#include <boost/shared_ptr.hpp>
26
#include <boost/shared_ptr.hpp>
25
 
27
 
26
#include "vm/Plugin.h"
28
#include "vm/Plugin.h"
27
#include "logging/Logger.h"
29
#include "logging/Logger.h"
28
#include "timer/Subscriber.h"
30
#include "timer/types.h"
29
 
31
 
30
namespace atom {
32
namespace atom {
31
namespace vm {
33
namespace vm {
32
namespace plugin {
34
namespace plugin {
33
 
35
 
34
class Timer : public Plugin, public timer::Subscriber
36
class Timer : public Plugin
35
{
37
{
36
public:
38
public:
37
    typedef boost::shared_ptr<Timer> Pointer;
39
    typedef boost::shared_ptr<Timer> Pointer;
38
   
40
   
39
    Timer();
41
    Timer();
40
    virtual ~Timer();
42
    virtual ~Timer();
41
   
43
   
-
 
44
    void InitializeDone();
-
 
45
   
42
private:
46
private:
-
 
47
    typedef std::set<timer::TimerId> Timers;
43
    static logging::Logger LOG;
48
    static logging::Logger LOG;
44
   
49
 
-
 
50
    static Timers timers_;
-
 
51
   
45
    void SlotOnTimeoutHandler(timer::TimerId timer_id, bool repeat);
52
    void SlotOnTimeout(timer::TimerId timer_id, bool repeat);
46
   
53
   
47
    static Value Export_StartTimer(const v8::Arguments& args);
54
    static Value Export_StartTimer(const v8::Arguments& args);
48
    static Value Export_ClearTimer(const v8::Arguments& args);
55
    static Value Export_ClearTimer(const v8::Arguments& args);
49
};
56
};
50
 
57