Subversion Repositories HomeAutomation

Rev

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

Rev 1598 Rev 1601
Line 22... Line 22...
22
#define CAN_NODE_H
22
#define CAN_NODE_H
23
 
23
 
24
#include <string>
24
#include <string>
25
 
25
 
26
#include <boost/shared_ptr.hpp>
26
#include <boost/shared_ptr.hpp>
-
 
27
 
-
 
28
#include <time.h>
27
 
29
 
28
namespace atom {
30
namespace atom {
29
namespace can {
31
namespace can {
30
 
32
 
31
class Node
33
class Node
32
{
34
{
33
public:
35
public:
34
    typedef boost::shared_ptr<Node> Pointer;
36
    typedef boost::shared_ptr<Node> Pointer;
35
    typedef unsigned int Id;
37
    typedef unsigned int Id;
36
   
38
   
37
    typedef enum
39
    typedef enum
38
    {
40
    {
39
        STATE_OFFLINE,
41
        STATE_OFFLINE,
40
        STATE_ONLINE,
42
        STATE_ONLINE,
41
        STATE_PENDING,
43
        STATE_PENDING,
Line 46... Line 48...
46
    virtual ~Node();
48
    virtual ~Node();
47
   
49
   
48
    Id GetId();
50
    Id GetId();
49
    State GetState();
51
    State GetState();
50
    void SetState(State state);
52
    void SetState(State state);
-
 
53
   
-
 
54
    bool CheckTimeout();
-
 
55
    void ResetTimeout();
51
   
56
   
52
private:
57
private:
53
    Id id_;
58
    Id id_;
54
    State state_;
59
    State state_;
-
 
60
    time_t last_active_;
55
};
61
};
56
 
62
 
57
}; // namespace can
63
}; // namespace can
58
}; // namespace atom
64
}; // namespace atom
59
 
65