#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
+#include <boost/serialization/version.hpp>
+#include <boost/serialization/split_member.hpp>
#include <boost/shared_ptr.hpp>
#include <string>
friend class boost::serialization::access;
template<class Archive>
- void serialize(Archive & ar, const unsigned int version)
+ void save(Archive & ar, const unsigned int version) const
{
// protocol and hostname are the unique identifier for each service.
ar & Protocol;
ar & MaxUpdatesWithinInterval;
ar & MaxEqualUpdatesInSuccession;
ar & DNSCacheTTL;
+
+ // Activated was introduced with version 1.
ar & Activated;
}
+ template<class Archive>
+ void load(Archive & ar, const unsigned int version)
+ {
+ // protocol and hostname are the unique identifier for each service.
+ ar & Protocol;
+ ar & Hostname;
+ // lastupdated and actual_ip must also be serialized, cause these are essential infos of each service.
+ ar & LastUpdates;
+ ar & ActualIP;
+ ar & UpdateInterval;
+ ar & MaxUpdatesWithinInterval;
+ ar & MaxEqualUpdatesInSuccession;
+ ar & DNSCacheTTL;
+
+ // Activated was introduced with version 1.
+ if ( version >= 1 )
+ ar & Activated;
+ }
+ BOOST_SERIALIZATION_SPLIT_MEMBER()
Logger::Ptr Log;
bool operator!= (const Service& other) const;
};
+BOOST_CLASS_VERSION(Service,1)
+
#endif