Commit | Line | Data |
---|---|---|
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 *). | |
34 | BOOST_CLASS_EXPORT_GUID(ServiceOds, "ServiceOds") | |
35 | BOOST_CLASS_EXPORT_GUID(ServiceDhs, "ServiceDhs") | |
36 | BOOST_CLASS_EXPORT_GUID(ServiceDyns, "ServiceDyns") | |
37 | BOOST_CLASS_EXPORT_GUID(ServiceDyndns, "ServiceDyndns") | |
38 | BOOST_CLASS_EXPORT_GUID(ServiceEasydns, "ServiceEasydns") | |
39 | BOOST_CLASS_EXPORT_GUID(ServiceTzo, "ServiceTzo") | |
40 | BOOST_CLASS_EXPORT_GUID(ServiceZoneedit, "ServiceZoneedit") | |
41 | BOOST_CLASS_EXPORT_GUID(ServiceGnudip, "ServiceGnudip") | |
42 | ||
e0080b78 BS |
43 | |
44 | class SerializeServiceContainer | |
45 | { | |
46 | ||
47 | private: | |
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 | |
58 | public: | |
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 |