-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetective.h
45 lines (35 loc) · 1.12 KB
/
detective.h
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
#pragma once
#include "policeman.h"
#include "sportsman.h"
#include "serialization.h"
#include <boost/serialization/shared_ptr.hpp>
#include "class_helper.h"
class Detective: public Policeman, public Sportsman
{
public:
Detective();
Detective(std::string name, int age, int height, int weight, int rang, int number_of_investigate,
int salary, std::string gun, bool onDuty, std::string body_type,
std::string favorite_sport);
~Detective();
Helper helper;
Helper *helper_ptr = &helper;
Helper &helper_rf = helper;
int number_of_investigate;
int salary;
std::vector<int> favoriteNumbers;
void printInfo();
private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive &ar, const unsigned int version) {
ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Policeman);
ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Sportsman);
ar &BOOST_SERIALIZATION_NVP(favoriteNumbers);
ar &BOOST_SERIALIZATION_NVP(number_of_investigate);
ar &BOOST_SERIALIZATION_NVP(salary);
ar &BOOST_SERIALIZATION_NVP(helper);
ar &BOOST_SERIALIZATION_NVP(helper_ptr);
ar &BOOST_SERIALIZATION_NVP(helper_rf);
}
};