Commit | Line | Data |
---|---|---|
4545a371 BS |
1 | // |
2 | // C++ Implementation: updater | |
3 | // | |
4 | // Description: | |
5 | // | |
6 | // | |
7 | // Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009 | |
8 | // | |
9 | // Copyright: See COPYING file that comes with this distribution | |
10 | // | |
11 | // | |
12 | #include "updater.h" | |
13 | ||
14 | #include <boost/foreach.hpp> | |
15 | ||
527536b3 | 16 | |
4545a371 | 17 | Updater::Updater() |
4248e8ca | 18 | : conf(NULL) |
4545a371 BS |
19 | { |
20 | } | |
21 | ||
527536b3 | 22 | |
4545a371 BS |
23 | Updater::Updater(Config* conf) |
24 | { | |
25 | this->conf = conf; | |
26 | } | |
27 | ||
527536b3 | 28 | |
4545a371 BS |
29 | Updater::~Updater() |
30 | { | |
4248e8ca | 31 | conf = NULL; |
4545a371 BS |
32 | } |
33 | ||
527536b3 | 34 | |
4545a371 BS |
35 | void Updater::set_config(Config* conf) |
36 | { | |
37 | this->conf = conf; | |
38 | } | |
39 | ||
527536b3 | 40 | |
4545a371 BS |
41 | Config* Updater::get_config() |
42 | { | |
43 | return this->conf; | |
44 | } | |
45 | ||
527536b3 | 46 | |
4545a371 BS |
47 | void Updater::update_services() |
48 | { | |
49 | list<Service*> services = this->conf->get_services(); | |
50 | ||
51 | string ip = "192.168.1.1"; | |
52 | ||
53 | BOOST_FOREACH( Service * service, services ) | |
54 | { | |
55 | service->update(ip); | |
56 | } | |
57 | } |