Rev 1609 | Rev 1625 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1609 | Rev 1619 | ||
|---|---|---|---|
| Line 33... | Line 33... | ||
| 33 | #include "broker/Manager.h" |
33 | #include "broker/Manager.h" |
| 34 | #include "can/Manager.h" |
34 | #include "can/Manager.h" |
| 35 | #include "can/Network.h" |
35 | #include "can/Network.h" |
| 36 | #include "can/Monitor.h" |
36 | #include "can/Monitor.h" |
| 37 | #include "vm/Manager.h" |
37 | #include "vm/Manager.h" |
| - | 38 | #include "storage/Manager.h" |
|
| 38 | 39 | ||
| 39 | #include "vm/plugin/System.h" |
40 | #include "vm/plugin/System.h" |
| 40 | #include "vm/plugin/Timer.h" |
41 | #include "vm/plugin/Timer.h" |
| 41 | #include "vm/plugin/Module.h" |
42 | #include "vm/plugin/Module.h" |
| 42 | #include "vm/plugin/Console.h" |
43 | #include "vm/plugin/Console.h" |
| - | 44 | #include "vm/plugin/Storage.h" |
|
| 43 | 45 | ||
| 44 | using namespace atom; |
46 | using namespace atom; |
| 45 | 47 | ||
| 46 | logging::Logger LOG("Main"); |
48 | logging::Logger LOG("Main"); |
| 47 | std::vector<broker::Subscriber::Pointer> subscribers; |
49 | std::vector<broker::Subscriber::Pointer> subscribers; |
| Line 93... | Line 95... | ||
| 93 | } |
95 | } |
| 94 | 96 | ||
| 95 | LOG.Info("Deamon mode entered successfully!"); |
97 | LOG.Info("Deamon mode entered successfully!"); |
| 96 | } |
98 | } |
| 97 | 99 | ||
| - | 100 | storage::Manager::Create(); |
|
| 98 | timer::Manager::Create(); |
101 | timer::Manager::Create(); |
| 99 | broker::Manager::Create(); |
102 | broker::Manager::Create(); |
| 100 | net::Manager::Create(); |
103 | net::Manager::Create(); |
| 101 | can::Protocol::Create(); |
104 | can::Protocol::Create(); |
| 102 | can::Manager::Create(); |
105 | can::Manager::Create(); |
| 103 | vm::Manager::Create(); |
106 | vm::Manager::Create(); |
| - | 107 | ||
| - | 108 | if (config::Manager::Instance()->Exist("StoragePath")) |
|
| - | 109 | { |
|
| - | 110 | storage::Manager::Instance()->SetRootPath(config::Manager::Instance()->GetAsString("StoragePath")); |
|
| - | 111 | } |
|
| 104 | 112 | ||
| 105 | if (config::Manager::Instance()->Exist("ProtocolFile")) |
113 | if (config::Manager::Instance()->Exist("ProtocolFile")) |
| 106 | { |
114 | { |
| 107 | can::Protocol::Instance()->Load(config::Manager::Instance()->GetAsString("ProtocolFile")); |
115 | can::Protocol::Instance()->Load(config::Manager::Instance()->GetAsString("ProtocolFile")); |
| 108 | } |
116 | } |
| Line 119... | Line 127... | ||
| 119 | if (config::Manager::Instance()->Exist("CommandPort")) |
127 | if (config::Manager::Instance()->Exist("CommandPort")) |
| 120 | { |
128 | { |
| 121 | vm::Manager::Instance()->AddPlugin(vm::Plugin::Pointer(new vm::plugin::Console(config::Manager::Instance()->GetAsInt("CommandPort")))); |
129 | vm::Manager::Instance()->AddPlugin(vm::Plugin::Pointer(new vm::plugin::Console(config::Manager::Instance()->GetAsInt("CommandPort")))); |
| 122 | } |
130 | } |
| 123 | 131 | ||
| - | 132 | vm::Manager::Instance()->AddPlugin(vm::Plugin::Pointer(new vm::plugin::Storage())); |
|
| 124 | vm::Manager::Instance()->AddPlugin(vm::Plugin::Pointer(new vm::plugin::Timer())); |
133 | vm::Manager::Instance()->AddPlugin(vm::Plugin::Pointer(new vm::plugin::Timer())); |
| 125 | vm::Manager::Instance()->AddPlugin(vm::Plugin::Pointer(new vm::plugin::Module())); |
134 | vm::Manager::Instance()->AddPlugin(vm::Plugin::Pointer(new vm::plugin::Module())); |
| 126 | 135 | ||
| 127 | if (config::Manager::Instance()->Exist("ScriptPath")) |
136 | if (config::Manager::Instance()->Exist("ScriptPath")) |
| 128 | { |
137 | { |
| Line 159... | Line 168... | ||
| 159 | can::Manager::Delete(); |
168 | can::Manager::Delete(); |
| 160 | vm::Manager::Delete(); |
169 | vm::Manager::Delete(); |
| 161 | can::Protocol::Delete(); |
170 | can::Protocol::Delete(); |
| 162 | broker::Manager::Delete(); |
171 | broker::Manager::Delete(); |
| 163 | net::Manager::Delete(); |
172 | net::Manager::Delete(); |
| - | 173 | storage::Manager::Delete(); |
|
| 164 | } |
174 | } |
| 165 | 175 | ||
| 166 | void Handler(int status) |
176 | void Handler(int status) |
| 167 | { |
177 | { |
| 168 | std::string signal_name = "Unknown"; |
178 | std::string signal_name = "Unknown"; |