-
Notifications
You must be signed in to change notification settings - Fork 85
/
serialization.hpp
48 lines (41 loc) · 1.28 KB
/
serialization.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* File: serialization.hpp
* Author: arseny.bushev@gmail.com
*
* Created on 16 февраля 2017 г., 21:24
*/
#ifndef BIDDER_SERIALIZATION_HPP
#define BIDDER_SERIALIZATION_HPP
#include <boost/serialization/set.hpp>
#include <boost/serialization/vector.hpp>
#include "examples/matchers/geo_campaign.hpp"
#include "campaign_data.hpp"
#include "examples/matchers/ad.hpp"
#include "examples/matchers/geo.hpp"
#include "examples/campaign/serialization.hpp"
//Non-Intrusive boost serialization implementation
namespace boost { namespace serialization {
template<class Archive>
void serialize(Archive & ar, Ad & value, const unsigned int version) {
ar & value.ad_id;
ar & value.campaign_id;
ar & value.width;
ar & value.height;
ar & value.position;
ar & value.max_bid_micros;
ar & value.code;
}
template<class Archive>
void serialize(Archive & ar, Geo & value, const unsigned int version) {
ar & value.geo_id;
ar & value.city;
ar & value.country;
ar & value.record;
}
template<class Archive>
void serialize(Archive & ar, GeoCampaign & value, const unsigned int version) {
ar & value.geo_id;
ar & value.campaign_id;
}
}}
#endif /* BIDDER_SERIALIZATION_HPP */