Commit | Line | Data |
---|---|---|
6beab33f | 1 | /** @file |
e0080b78 | 2 | * @brief Serviceholder class header. This class holds Service and OldService lists. |
6beab33f BS |
3 | * |
4 | * | |
5 | * | |
6 | * @copyright Intra2net AG | |
7 | * @license GPLv2 | |
8 | */ | |
9 | ||
10 | #ifndef SERVICEHOLDER_H | |
11 | #define SERVICEHOLDER_H | |
12 | ||
4de6a9b8 BS |
13 | #include "service.hpp" |
14 | #include "serializeservicecontainer.hpp" | |
15 | #include "logger.hpp" | |
16 | #include "ip_addr_helper.hpp" | |
6beab33f | 17 | |
6beab33f | 18 | #include <boost/shared_ptr.hpp> |
ca5d6889 BS |
19 | #include <list> |
20 | ||
6beab33f | 21 | |
6beab33f BS |
22 | class Serviceholder |
23 | { | |
88a594e8 | 24 | |
6beab33f | 25 | private: |
88a594e8 | 26 | |
e0080b78 | 27 | Logger::Ptr Log; |
6beab33f | 28 | |
e0080b78 BS |
29 | std::list<Service::Ptr> OldServices; // Represents all old Services where the timeout isn't expired (in case the same Service is redefined). |
30 | std::list<Service::Ptr> Services; // Represents all active Services. | |
6beab33f | 31 | |
20399847 BS |
32 | IPAddrHelper::Ptr IPAddrHelp; |
33 | ||
6beab33f BS |
34 | public: |
35 | ||
88a594e8 BS |
36 | typedef boost::shared_ptr<Serviceholder> Ptr; |
37 | ||
31af6a2e BS |
38 | Serviceholder(); |
39 | ||
e8d4a6f8 | 40 | Serviceholder(Logger::Ptr _log); |
6beab33f BS |
41 | |
42 | ~Serviceholder(); | |
43 | ||
e0080b78 BS |
44 | void add_service(Service::Ptr service); |
45 | ||
46 | int deserialize_services(); | |
47 | ||
c730deea | 48 | int serialize_services() const; |
e0080b78 BS |
49 | |
50 | void delete_services(); | |
6beab33f | 51 | |
20399847 BS |
52 | void set_ip_addr_helper(IPAddrHelper::Ptr _ip_addr_helper); |
53 | ||
54 | IPAddrHelper::Ptr get_ip_addr_helper() const; | |
55 | ||
e0080b78 | 56 | std::list<Service::Ptr> get_services() const; |
6beab33f BS |
57 | }; |
58 | ||
59 | #endif |