StdAir Logo  1.00.15
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
LegCabinKey.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
14
15namespace stdair {
16
17 // ////////////////////////////////////////////////////////////////////
18 LegCabinKey::LegCabinKey() : _cabinCode (DEFAULT_CABIN_CODE) {
19 assert (false);
20 }
21
22 // ////////////////////////////////////////////////////////////////////
23 LegCabinKey::LegCabinKey (const CabinCode_T& iCabinCode)
24 : _cabinCode (iCabinCode) {
25 }
26
27 // ////////////////////////////////////////////////////////////////////
28 LegCabinKey::LegCabinKey (const LegCabinKey& iKey)
29 : _cabinCode (iKey._cabinCode) {
30 }
31
32 // ////////////////////////////////////////////////////////////////////
35
36 // ////////////////////////////////////////////////////////////////////
37 void LegCabinKey::toStream (std::ostream& ioOut) const {
38 ioOut << "LegCabinKey: " << toString() << std::endl;
39 }
40
41 // ////////////////////////////////////////////////////////////////////
42 void LegCabinKey::fromStream (std::istream& ioIn) {
43 }
44
45 // ////////////////////////////////////////////////////////////////////
46 const std::string LegCabinKey::toString() const {
47 std::ostringstream oStr;
48 oStr << _cabinCode;
49 return oStr.str();
50 }
51
52 // ////////////////////////////////////////////////////////////////////
53 void LegCabinKey::serialisationImplementationExport() const {
54 std::ostringstream oStr;
55 boost::archive::text_oarchive oa (oStr);
56 oa << *this;
57 }
58
59 // ////////////////////////////////////////////////////////////////////
60 void LegCabinKey::serialisationImplementationImport() {
61 std::istringstream iStr;
62 boost::archive::text_iarchive ia (iStr);
63 ia >> *this;
64 }
65
66 // ////////////////////////////////////////////////////////////////////
67 template<class Archive>
68 void LegCabinKey::serialize (Archive& ioArchive,
69 const unsigned int iFileVersion) {
74 ioArchive & _cabinCode;
75 }
76
77}
Handle on the StdAir library context.
const CabinCode_T DEFAULT_CABIN_CODE
std::string CabinCode_T
Key of a given leg-cabin, made of a cabin code (only).
void fromStream(std::istream &ioIn)
const std::string toString() const
void serialize(Archive &ar, const unsigned int iFileVersion)
void toStream(std::ostream &ioOut) const