AirTSP Logo  1.01.11
C++ Simulated Airline Travel Solution Provider (TSP) Library
Loading...
Searching...
No Matches
OriginDestinationSetKey.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// AirTSP
15
16namespace AIRTSP {
17
18 // ////////////////////////////////////////////////////////////////////
19 OriginDestinationSetKey::OriginDestinationSetKey()
20 : _destination (stdair::DEFAULT_DESTINATION) {
21 assert (false);
22 }
23
24 // ////////////////////////////////////////////////////////////////////
25 OriginDestinationSetKey::
26 OriginDestinationSetKey (const stdair::AirportCode_T& iDestination)
27 : _destination (iDestination) {
28 }
29
30 // ////////////////////////////////////////////////////////////////////
31 OriginDestinationSetKey::
32 OriginDestinationSetKey (const OriginDestinationSetKey& iKey)
33 : _destination (iKey._destination) {
34 }
35
36 // ////////////////////////////////////////////////////////////////////
39
40 // ////////////////////////////////////////////////////////////////////
41 void OriginDestinationSetKey::toStream (std::ostream& ioOut) const {
42 ioOut << "OriginDestinationSetKey: " << toString() << std::endl;
43 }
44
45 // ////////////////////////////////////////////////////////////////////
46 void OriginDestinationSetKey::fromStream (std::istream& ioIn) {
47 }
48
49 // ////////////////////////////////////////////////////////////////////
50 const std::string OriginDestinationSetKey::toString() const {
51 std::ostringstream oStr;
52 oStr << _destination;
53 return oStr.str();
54 }
55
56 // ////////////////////////////////////////////////////////////////////
57 void OriginDestinationSetKey::serialisationImplementationExport() const {
58 std::ostringstream oStr;
59 boost::archive::text_oarchive oa (oStr);
60 oa << *this;
61 }
62
63 // ////////////////////////////////////////////////////////////////////
64 void OriginDestinationSetKey::serialisationImplementationImport() {
65 std::istringstream iStr;
66 boost::archive::text_iarchive ia (iStr);
67 ia >> *this;
68 }
69
70 // ////////////////////////////////////////////////////////////////////
71 template<class Archive>
72 void OriginDestinationSetKey::serialize (Archive& ioArchive,
73 const unsigned int iFileVersion) {
78 ioArchive & _destination;
79 }
80
81 // ////////////////////////////////////////////////////////////////////
82 // Explicit template instantiation
83 namespace ba = boost::archive;
84 template
86 unsigned int);
87 template
89 unsigned int);
90 // ////////////////////////////////////////////////////////////////////
91
92}
void serialize(Archive &ar, const unsigned int iFileVersion)
void toStream(std::ostream &ioOut) const