Get rid of the compiler warning about strict aliasing rule.
[bpdyndnsd] / src / serviceholder.h
CommitLineData
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
13#include <list>
14
15#include "service.h"
88a594e8 16#include "logger.h"
6beab33f 17
6beab33f
BS
18#include <boost/shared_ptr.hpp>
19
6beab33f
BS
20class Serviceholder
21{
88a594e8 22
6beab33f 23private:
88a594e8 24
e0080b78 25 Logger::Ptr Log;
6beab33f 26
e0080b78
BS
27 std::list<Service::Ptr> OldServices; // Represents all old Services where the timeout isn't expired (in case the same Service is redefined).
28 std::list<Service::Ptr> Services; // Represents all active Services.
6beab33f 29
6beab33f
BS
30public:
31
88a594e8
BS
32 typedef boost::shared_ptr<Serviceholder> Ptr;
33
e8d4a6f8 34 Serviceholder(Logger::Ptr _log);
6beab33f
BS
35
36 ~Serviceholder();
37
e0080b78
BS
38 void add_service(Service::Ptr service);
39
40 int deserialize_services();
41
42 int serialize_services();
43
44 void delete_services();
6beab33f 45
e0080b78 46 std::list<Service::Ptr> get_services() const;
6beab33f
BS
47};
48
49#endif