AirTSP Logo  1.01.10
C++ Simulated Airline Travel Solution Provider (TSP) Library
Loading...
Searching...
No Matches
OriginDestinationSet.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 OriginDestinationSet::OriginDestinationSet()
20 : _key (stdair::DEFAULT_ORIGIN), _parent (NULL) {
21 assert (false);
22 }
23
24 // ////////////////////////////////////////////////////////////////////
25 OriginDestinationSet::OriginDestinationSet (const OriginDestinationSet&)
26 : _key (stdair::DEFAULT_ORIGIN), _parent (NULL) {
27 assert (false);
28 }
29
30 // ////////////////////////////////////////////////////////////////////
31 OriginDestinationSet::OriginDestinationSet (const Key_T& iKey)
32 : _key (iKey), _parent (NULL) {
33 }
34
35 // ////////////////////////////////////////////////////////////////////
38
39 // ////////////////////////////////////////////////////////////////////
40 std::string OriginDestinationSet::toString() const {
41 std::ostringstream oStr;
42 oStr << _key.toString();
43 return oStr.str();
44 }
45
46 // ////////////////////////////////////////////////////////////////////
47 void OriginDestinationSet::serialisationImplementationExport() const {
48 std::ostringstream oStr;
49 boost::archive::text_oarchive oa (oStr);
50 oa << *this;
51 }
52
53 // ////////////////////////////////////////////////////////////////////
54 void OriginDestinationSet::serialisationImplementationImport() {
55 std::istringstream iStr;
56 boost::archive::text_iarchive ia (iStr);
57 ia >> *this;
58 }
59
60 // ////////////////////////////////////////////////////////////////////
61 template<class Archive>
62 void OriginDestinationSet::serialize (Archive& ioArchive,
63 const unsigned int iFileVersion) {
64 ioArchive & _key;
65 }
66
67 // ////////////////////////////////////////////////////////////////////
68 // Explicit template instantiation
69 namespace ba = boost::archive;
70 template
71 void OriginDestinationSet::serialize<ba::text_oarchive> (ba::text_oarchive&,
72 unsigned int);
73 template
74 void OriginDestinationSet::serialize<ba::text_iarchive> (ba::text_iarchive&,
75 unsigned int);
76 // ////////////////////////////////////////////////////////////////////
77
78}
79
void serialize(Archive &ar, const unsigned int iFileVersion)
Forward declarations.
Structure representing the key of a sub-network.