10 |
#include "plugins/StatusPlugin.h" |
#include "plugins/StatusPlugin.h" |
11 |
#include "plugins/ListPlugin.h" |
#include "plugins/ListPlugin.h" |
12 |
#include "plugins/HostStatusPlugin.h" |
#include "plugins/HostStatusPlugin.h" |
13 |
|
#include "plugins/WeatherPlugin.h" |
14 |
|
#include "plugins/UrlTriggerPlugin.h" |
15 |
|
|
16 |
typedef std::map<std::string, Plugin*>::iterator MapIterator; |
typedef std::map<std::string, Plugin*>::iterator MapIterator; |
17 |
|
|
28 |
{ |
{ |
29 |
if (plugin != 0) |
if (plugin != 0) |
30 |
{ |
{ |
31 |
std::string command = plugin->GetCommand(); |
if (plugin->IsHelper()) |
32 |
|
{ |
33 |
if ( _plugins[ command ] == 0) |
_helper_plugins.push_back(plugin); |
34 |
_plugins[ command ] = plugin; |
} |
35 |
else |
else |
36 |
Logger::logMessage( std::string("AddPlugin() -- already have a plugin called ") + command); |
{ |
37 |
|
std::string command = plugin->GetCommand(); |
38 |
|
|
39 |
|
if ( _plugins[ command ] == 0) |
40 |
|
_plugins[ command ] = plugin; |
41 |
|
else |
42 |
|
Logger::logMessage( std::string("AddPlugin() -- already have a plugin called ") + command); |
43 |
|
} |
44 |
} |
} |
45 |
else |
else |
46 |
{ |
{ |
65 |
|
|
66 |
static HostStatusPlugin hoststatus; |
static HostStatusPlugin hoststatus; |
67 |
|
|
68 |
|
static WeatherPlugin weather; |
69 |
|
|
70 |
|
static UrlTriggerPlugin urltrigger("tou", "http://t-hoerup.dk/test.php"); |
71 |
|
|
72 |
for(MapIterator it = _plugins.begin(); it != _plugins.end(); ++it) |
for(MapIterator it = _plugins.begin(); it != _plugins.end(); ++it) |
73 |
{ |
{ |
74 |
Plugin* pl = (*it).second; |
Plugin* pl = (*it).second; |