Do not invoke any webcheck url to often (once every 10 minutes will be the default).
[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
6beab33f 13#include "service.h"
ca5d6889 14#include "serializeservicecontainer.h"
88a594e8 15#include "logger.h"
6beab33f 16
6beab33f 17#include <boost/shared_ptr.hpp>
ca5d6889
BS
18#include <list>
19
6beab33f 20
6beab33f
BS
21class Serviceholder
22{
88a594e8 23
6beab33f 24private:
88a594e8 25
e0080b78 26 Logger::Ptr Log;
6beab33f 27
e0080b78
BS
28 std::list<Service::Ptr> OldServices; // Represents all old Services where the timeout isn't expired (in case the same Service is redefined).
29 std::list<Service::Ptr> Services; // Represents all active Services.
6beab33f 30
6beab33f
BS
31public:
32
88a594e8
BS
33 typedef boost::shared_ptr<Serviceholder> Ptr;
34
e8d4a6f8 35 Serviceholder(Logger::Ptr _log);
6beab33f
BS
36
37 ~Serviceholder();
38
e0080b78
BS
39 void add_service(Service::Ptr service);
40
41 int deserialize_services();
42
43 int serialize_services();
44
45 void delete_services();
6beab33f 46
e0080b78 47 std::list<Service::Ptr> get_services() const;
6beab33f
BS
48};
49
50#endif