StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 Key_T& iKey) : _key (iKey), _parent (NULL) {
25  }
26 
27  // ////////////////////////////////////////////////////////////////////
29  }
30 
31  // ////////////////////////////////////////////////////////////////////
32  std::string Bucket::toString() const {
33  std::ostringstream oStr;
34  oStr << describeKey();
35  return oStr.str();
36  }
37 
38  // ////////////////////////////////////////////////////////////////////
39  void Bucket::serialisationImplementationExport() const {
40  std::ostringstream oStr;
41  boost::archive::text_oarchive oa (oStr);
42  oa << *this;
43  }
44 
45  // ////////////////////////////////////////////////////////////////////
46  void Bucket::serialisationImplementationImport() {
47  std::istringstream iStr;
48  boost::archive::text_iarchive ia (iStr);
49  ia >> *this;
50  }
51 
52  // ////////////////////////////////////////////////////////////////////
53  template<class Archive>
54  void Bucket::serialize (Archive& ioArchive, const unsigned int iFileVersion) {
55  ioArchive & _key;
56  }
57 
58 }
59