Subversion Repositories HomeAutomation

Rev

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

Rev 1599 Rev 1601
Line 26... Line 26...
26
#include <boost/shared_ptr.hpp>
26
#include <boost/shared_ptr.hpp>
27
#include <boost/signals2.hpp>
27
#include <boost/signals2.hpp>
28
 
28
 
29
#include "logging/Logger.h"
29
#include "logging/Logger.h"
30
#include "broker/Subscriber.h"
30
#include "broker/Subscriber.h"
-
 
31
 
-
 
32
#include "timer/Subscriber.h"
31
 
33
 
32
#include "Node.h"
34
#include "Node.h"
33
#include "Module.h"
35
#include "Module.h"
34
 
36
 
35
namespace atom {
37
namespace atom {
36
namespace can {
38
namespace can {
37
 
39
 
38
class Manager : public broker::Subscriber
40
class Manager : public broker::Subscriber, public timer::Subscriber
39
{
41
{
40
public:
42
public:
41
    typedef boost::shared_ptr<Manager> Pointer;
43
    typedef boost::shared_ptr<Manager> Pointer;
42
    typedef std::map<Node::Id, Node::Pointer> NodeList;
44
    typedef std::map<Node::Id, Node::Pointer> NodeList;
43
    typedef std::map<Module::FullId, Module::Pointer> ModuleList;
45
    typedef std::map<Module::FullId, Module::Pointer> ModuleList;
Line 45... Line 47...
45
    virtual ~Manager();
47
    virtual ~Manager();
46
   
48
   
47
    static Pointer Instance();
49
    static Pointer Instance();
48
    static void Create();
50
    static void Create();
49
    static void Delete();
51
    static void Delete();
50
   
52
   
51
private:
53
private:
52
    static Pointer instance_;
54
    static Pointer instance_;
-
 
55
   
-
 
56
    timer::TimerId timer_id_;
53
   
57
   
54
    NodeList nodes_;
58
    NodeList nodes_;
55
    ModuleList modules_;
59
    ModuleList modules_;
56
   
60
   
57
    Manager();
61
    Manager();
58
   
62
   
59
    void SlotOnMessageHandler(broker::Message::Pointer message);
63
    void SlotOnMessageHandler(broker::Message::Pointer message);
-
 
64
    void SlotOnTimeoutHandler(timer::TimerId timer_id, bool repeat);
60
   
65
   
61
    Node::Pointer GetNode(Node::Id node_id);
66
    Node::Pointer GetNode(Node::Id node_id);
62
    Module::Pointer GetModule(Module::Id module_id, std::string module_name, std::string class_name);
67
    Module::Pointer GetModule(Module::Id module_id, std::string module_name, std::string class_name);
63
    void RemoveModules(Node::Id node_id);
68
    void RemoveModules(Node::Id node_id);
64
    void RequestModules(Node::Id node_id);
69
    void RequestModules(Node::Id node_id);