AirTSP Logo  1.01.14
C++ Simulated Airline Travel Solution Provider (TSP) Library
Loading...
Searching...
No Matches
ReachableUniverseKey.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 ReachableUniverseKey::ReachableUniverseKey()
20 : _origin (stdair::DEFAULT_ORIGIN) {
21 assert (false);
22 }
23
24 // ////////////////////////////////////////////////////////////////////
25 ReachableUniverseKey::
26 ReachableUniverseKey (const ReachableUniverseKey& iKey)
27 : _origin (iKey._origin) {
28 }
29
30 // ////////////////////////////////////////////////////////////////////
31 ReachableUniverseKey::
32 ReachableUniverseKey (const stdair::AirportCode_T& iAirportCode)
33 : _origin (iAirportCode) {
34 }
35
36 // ////////////////////////////////////////////////////////////////////
39
40 // ////////////////////////////////////////////////////////////////////
41 void ReachableUniverseKey::toStream (std::ostream& ioOut) const {
42 ioOut << "ReachableUniverseKey: " << toString() << std::endl;
43 }
44
45 // ////////////////////////////////////////////////////////////////////
46 void ReachableUniverseKey::fromStream (std::istream& ioIn) {
47 }
48
49 // ////////////////////////////////////////////////////////////////////
50 const std::string ReachableUniverseKey::toString() const {
51 std::ostringstream oStr;
52 oStr << _origin;
53 return oStr.str();
54 }
55
56 // ////////////////////////////////////////////////////////////////////
57 void ReachableUniverseKey::serialisationImplementationExport() const {
58 std::ostringstream oStr;
59 boost::archive::text_oarchive oa (oStr);
60 oa << *this;
61 }
62
63 // ////////////////////////////////////////////////////////////////////
64 void ReachableUniverseKey::serialisationImplementationImport() {
65 std::istringstream iStr;
66 boost::archive::text_iarchive ia (iStr);
67 ia >> *this;
68 }
69
70 // ////////////////////////////////////////////////////////////////////
71 template<class Archive>
72 void ReachableUniverseKey::serialize (Archive& ioArchive,
73 const unsigned int iFileVersion) {
78 ioArchive & _origin;
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}
const std::string toString() const
void serialize(Archive &ar, const unsigned int iFileVersion)
void fromStream(std::istream &ioIn)
void toStream(std::ostream &ioOut) const