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 | ||
10 | #include "serializeservicecontainer.h" | |
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") | |
21 | ||
e0080b78 BS |
22 | |
23 | SerializeServiceContainer::SerializeServiceContainer() | |
24 | { | |
25 | } | |
26 | ||
27 | ||
28 | SerializeServiceContainer::~SerializeServiceContainer() | |
29 | { | |
30 | } | |
31 | ||
32 | /** | |
33 | * Serialize function needed by boost/serialization to define which members should be stored as the object state. | |
34 | * In this case the STL list of Service pointers will be serialized. | |
35 | * @param ar Archive | |
36 | * @param version Version | |
37 | */ | |
ca5d6889 | 38 | /* |
e0080b78 BS |
39 | template<class Archive> |
40 | void SerializeServiceContainer::serialize(Archive & ar, const unsigned int version) | |
41 | { | |
42 | ar & ContainingServices; | |
43 | } | |
ca5d6889 | 44 | */ |
e0080b78 BS |
45 | |
46 | void SerializeServiceContainer::add_service(Service::Ptr service) | |
47 | { | |
48 | ContainingServices.push_back(service); | |
49 | } | |
50 | ||
51 | ||
52 | std::list<Service::Ptr> SerializeServiceContainer::get_containing_services() const | |
53 | { | |
54 | return ContainingServices; | |
55 | } |