Last linter optimizations.
[bpdyndnsd] / src / serializeservicecontainer.h
CommitLineData
e0080b78
BS
1/** @file
2 * @brief SerializeServiceContainer class header. This class holds Service objects in a list for serialization.
3 *
4 *
5 *
6 * @copyright Intra2net AG
7 * @license GPLv2
8*/
9
10#ifndef SERIALIZESERVICECONTAINER_H
11#define SERIALIZESERVICECONTAINER_H
12
e0080b78
BS
13#include "service.h"
14#include "logger.h"
15
ca5d6889 16#include <boost/serialization/list.hpp>
c1b8cb79 17#include <boost/serialization/vector.hpp>
ca5d6889
BS
18#include <boost/serialization/shared_ptr.hpp>
19#include <boost/serialization/export.hpp>
20
e0080b78 21#include <boost/shared_ptr.hpp>
ca5d6889
BS
22#include <list>
23
24#include "service_dhs.h"
25#include "service_ods.h"
26#include "service_dyndns.h"
27#include "service_dyns.h"
28#include "service_easydns.h"
29#include "service_tzo.h"
30#include "service_zoneedit.h"
31#include "service_gnudip.h"
32
33// Following boost macros are needed for serialization of derived classes through a base class pointer (Service *).
34BOOST_CLASS_EXPORT_GUID(ServiceOds, "ServiceOds")
35BOOST_CLASS_EXPORT_GUID(ServiceDhs, "ServiceDhs")
36BOOST_CLASS_EXPORT_GUID(ServiceDyns, "ServiceDyns")
37BOOST_CLASS_EXPORT_GUID(ServiceDyndns, "ServiceDyndns")
38BOOST_CLASS_EXPORT_GUID(ServiceEasydns, "ServiceEasydns")
39BOOST_CLASS_EXPORT_GUID(ServiceTzo, "ServiceTzo")
40BOOST_CLASS_EXPORT_GUID(ServiceZoneedit, "ServiceZoneedit")
41BOOST_CLASS_EXPORT_GUID(ServiceGnudip, "ServiceGnudip")
42
e0080b78
BS
43
44class SerializeServiceContainer
45{
46
47private:
48
49 std::list<Service::Ptr> ContainingServices;
50
51 friend class boost::serialization::access;
52 template<class Archive>
ca5d6889
BS
53 void serialize(Archive & ar, const unsigned int version)
54 {
55 ar & ContainingServices;
56 }
e0080b78
BS
57
58public:
59
60 typedef boost::shared_ptr<SerializeServiceContainer> Ptr;
61
62 SerializeServiceContainer();
63
64 ~SerializeServiceContainer();
65
66 void add_service(Service::Ptr service);
67
68 std::list<Service::Ptr> get_containing_services() const;
69
70};
71
72#endif