1.00.26
C++ Standard Airline IT Object Library
Toggle main menu visibility
Loading...
Searching...
No Matches
PolicyKey.cpp
Go to the documentation of this file.
1
// //////////////////////////////////////////////////////////////////////
2
// Import section
3
// //////////////////////////////////////////////////////////////////////
4
// STL
5
#include <cassert>
6
#include <sstream>
7
// Boost.Serialization
8
#include <boost/archive/text_iarchive.hpp>
9
#include <boost/archive/text_oarchive.hpp>
10
#include <boost/serialization/access.hpp>
11
// StdAir
12
#include <
stdair/basic/BasConst_Inventory.hpp
>
13
#include <
stdair/bom/PolicyKey.hpp
>
14
15
namespace
stdair
{
16
17
// ////////////////////////////////////////////////////////////////////
18
PolicyKey::PolicyKey() : _policyCode (
DEFAULT_POLICY_CODE
) {
19
assert (
false
);
20
}
21
22
// ////////////////////////////////////////////////////////////////////
23
PolicyKey::PolicyKey (
const
PolicyKey& iPolicyKey)
24
: _policyCode (iPolicyKey._policyCode) {
25
}
26
27
// ////////////////////////////////////////////////////////////////////
28
PolicyKey::PolicyKey (
const
PolicyCode_T
& iPolicyCode)
29
: _policyCode (iPolicyCode) {
30
}
31
32
// ////////////////////////////////////////////////////////////////////
33
PolicyKey::~PolicyKey
() {
34
}
35
36
// ////////////////////////////////////////////////////////////////////
37
void
PolicyKey::toStream
(std::ostream& ioOut)
const
{
38
ioOut <<
"PolicyKey: "
<<
toString
();
39
}
40
41
// ////////////////////////////////////////////////////////////////////
42
void
PolicyKey::fromStream
(std::istream& ioIn) {
43
}
44
45
// ////////////////////////////////////////////////////////////////////
46
const
std::string
PolicyKey::toString
()
const
{
47
std::ostringstream oStr;
48
oStr << _policyCode;
49
return
oStr.str();
50
}
51
52
// ////////////////////////////////////////////////////////////////////
53
void
PolicyKey::serialisationImplementationExport()
const
{
54
std::ostringstream oStr;
55
boost::archive::text_oarchive oa (oStr);
56
oa << *
this
;
57
}
58
59
// ////////////////////////////////////////////////////////////////////
60
void
PolicyKey::serialisationImplementationImport() {
61
std::istringstream iStr;
62
boost::archive::text_iarchive ia (iStr);
63
ia >> *
this
;
64
}
65
66
// ////////////////////////////////////////////////////////////////////
67
template
<
class
Archive>
68
void
PolicyKey::serialize
(Archive& ioArchive,
69
const
unsigned
int
iFileVersion) {
74
ioArchive & _policyCode;
75
}
76
77
// ////////////////////////////////////////////////////////////////////
78
// Explicit template instantiation
79
namespace
ba =
boost::archive
;
80
template
void
PolicyKey::serialize<ba::text_oarchive>
(ba::text_oarchive&,
81
unsigned
int
);
82
template
void
PolicyKey::serialize<ba::text_iarchive>
(ba::text_iarchive&,
83
unsigned
int
);
84
// ////////////////////////////////////////////////////////////////////
85
86
}
BasConst_Inventory.hpp
PolicyKey.hpp
stdair
Handle on the StdAir library context.
Definition
BasChronometer.cpp:9
stdair::PolicyCode_T
std::string PolicyCode_T
Definition
stdair_basic_types.hpp:47
stdair::DEFAULT_POLICY_CODE
const PolicyCode_T DEFAULT_POLICY_CODE
boost::archive
Definition
FlightDate.hpp:21
stdair::PolicyKey::toString
const std::string toString() const
Definition
PolicyKey.cpp:46
stdair::PolicyKey::~PolicyKey
~PolicyKey()
Definition
PolicyKey.cpp:33
stdair::PolicyKey::toStream
void toStream(std::ostream &ioOut) const
Definition
PolicyKey.cpp:37
stdair::PolicyKey::serialize
void serialize(Archive &ar, const unsigned int iFileVersion)
Definition
PolicyKey.cpp:68
stdair::PolicyKey::fromStream
void fromStream(std::istream &ioIn)
Definition
PolicyKey.cpp:42
Generated for StdAir by
1.17.0