-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExecuteCommandModule.cpp
More file actions
68 lines (48 loc) · 1.36 KB
/
Copy pathExecuteCommandModule.cpp
File metadata and controls
68 lines (48 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "ExecuteCommandModule.h"
#include "../../config/node_list.h"
using namespace dispatch::config;
using namespace dispatch::module;
namespace dispatch {
namespace module {
namespace execute {
ExecuteCommandModule::ExecuteCommandModule()
{
}
ExecuteCommandModule::~ExecuteCommandModule()
{
}
bool ExecuteCommandModule::preInitialize() {
return true;
}
bool ExecuteCommandModule::startup() {
vector<ExecuteCommandSpec>::iterator h_it;
for(h_it = commands.begin(); h_it < commands.end(); h_it++) {
ExecuteCommandHandler h(*h_it);
handlers.push_back(h);
}
return true;
}
bool ExecuteCommandModule::shutdown() {
return true;
}
bool ExecuteCommandModule::scanConfigNode(GConfigNode* node) {
string cmd = StringVariableHelper::getString(node, "command", 1, true);
string event_passing = StringVariableHelper::getString(node, "event_passing", 1, true);
out() <<
"ExecuteCommandModule: " <<
" command: " << cmd <<
" event_passing: " << event_passing <<
endl;
ExecuteCommandSpec spec(cmd, event_passing);
commands.push_back(spec);
return true;
}
}}} // end namespace dispatch::module::execute
extern "C" {
extern dispatch::module::DispatchModule* initialize_dispatch_module() {
return new dispatch::module::execute::ExecuteCommandModule();
}
extern void destroy_dispatch_module(dispatch::module::DispatchModule* ptr) {
delete ptr;
}
}