StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
Bucket.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
13 #include <stdair/bom/Bucket.hpp>
14 
15 namespace stdair {
16 
17  // ////////////////////////////////////////////////////////////////////
18  Bucket::Bucket()
19  : _key (DEFAULT_SEAT_INDEX), _parent (NULL) {
20  assert (false);
21  }
22 
23  // ////////////////////////////////////////////////////////////////////
24  Bucket::Bucket (const Bucket& iBucket) :
25  _key (iBucket._key),
26  _parent (NULL),
27  _yieldRangeUpperValue (iBucket._yieldRangeUpperValue),
28  _availability (iBucket._availability),
29  _soldSeats (iBucket._soldSeats) {
30 
31  }
32 
33  // ////////////////////////////////////////////////////////////////////
34  Bucket::Bucket (const Key_T& iKey) : _key (iKey), _parent (NULL) {
35  }
36 
37  // ////////////////////////////////////////////////////////////////////
39  }
40 
41  // ////////////////////////////////////////////////////////////////////
42  std::string Bucket::toString() const {
43  std::ostringstream oStr;
44  oStr << describeKey();
45  return oStr.str();
46  }
47 
48  // ////////////////////////////////////////////////////////////////////
49  void Bucket::serialisationImplementationExport() const {
50  std::ostringstream oStr;
51  boost::archive::text_oarchive oa (oStr);
52  oa << *this;
53  }
54 
55  // ////////////////////////////////////////////////////////////////////
56  void Bucket::serialisationImplementationImport() {
57  std::istringstream iStr;
58  boost::archive::text_iarchive ia (iStr);
59  ia >> *this;
60  }
61 
62  // ////////////////////////////////////////////////////////////////////
63  template<class Archive>
64  void Bucket::serialize (Archive& ioArchive, const unsigned int iFileVersion) {
65  ioArchive & _key;
66  }
67 
68 }
69 
virtual ~Bucket()
Definition: Bucket.cpp:38
const std::string describeKey() const
Definition: Bucket.hpp:128
const SeatIndex_T DEFAULT_SEAT_INDEX
Handle on the StdAir library context.
void serialize(Archive &ar, const unsigned int iFileVersion)
Definition: Bucket.cpp:64
Key of booking-class.
Definition: BucketKey.hpp:26
std::string toString() const
Definition: Bucket.cpp:42