Commit | Line | Data |
---|---|---|
e0080b78 BS |
1 | /** @file |
2 | * @brief SerializeServiceContainer class implementation. This class contains Service objects in a list for serialization. | |
3 | * | |
4 | * | |
5 | * | |
6 | * @copyright Intra2net AG | |
7 | * @license GPLv2 | |
8 | */ | |
9 | ||
4de6a9b8 | 10 | #include "serializeservicecontainer.hpp" |
e0080b78 | 11 | |
4311991c BS |
12 | // Following boost macros are needed for serialization of derived classes through a base class pointer (Service *). |
13 | BOOST_CLASS_EXPORT_GUID(ServiceOds, "ServiceOds") | |
14 | BOOST_CLASS_EXPORT_GUID(ServiceDhs, "ServiceDhs") | |
15 | BOOST_CLASS_EXPORT_GUID(ServiceDyns, "ServiceDyns") | |
16 | BOOST_CLASS_EXPORT_GUID(ServiceDyndns, "ServiceDyndns") | |
17 | BOOST_CLASS_EXPORT_GUID(ServiceEasydns, "ServiceEasydns") | |
18 | BOOST_CLASS_EXPORT_GUID(ServiceTzo, "ServiceTzo") | |
19 | BOOST_CLASS_EXPORT_GUID(ServiceZoneedit, "ServiceZoneedit") | |
20 | BOOST_CLASS_EXPORT_GUID(ServiceGnudip, "ServiceGnudip") | |
ca28857e | 21 | BOOST_CLASS_EXPORT_GUID(ServiceGnudipFullhostname, "ServiceGnudipFullhostname") |
4311991c | 22 | |
e0080b78 BS |
23 | |
24 | SerializeServiceContainer::SerializeServiceContainer() | |
25 | { | |
26 | } | |
27 | ||
28 | ||
29 | SerializeServiceContainer::~SerializeServiceContainer() | |
30 | { | |
31 | } | |
32 | ||
33 | /** | |
34 | * Serialize function needed by boost/serialization to define which members should be stored as the object state. | |
35 | * In this case the STL list of Service pointers will be serialized. | |
36 | * @param ar Archive | |
37 | * @param version Version | |
38 | */ | |
ca5d6889 | 39 | /* |
e0080b78 BS |
40 | template<class Archive> |
41 | void SerializeServiceContainer::serialize(Archive & ar, const unsigned int version) | |
42 | { | |
43 | ar & ContainingServices; | |
44 | } | |
ca5d6889 | 45 | */ |
e0080b78 BS |
46 | |
47 | void SerializeServiceContainer::add_service(Service::Ptr service) | |
48 | { | |
49 | ContainingServices.push_back(service); | |
50 | } | |
51 | ||
52 | ||
53 | std::list<Service::Ptr> SerializeServiceContainer::get_containing_services() const | |
54 | { | |
55 | return ContainingServices; | |
56 | } |