StdAir Logo  1.00.20
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
BucketKey.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
14namespace stdair {
15
16 // ////////////////////////////////////////////////////////////////////
17 BucketKey::BucketKey() {
18 assert (false);
19 }
20
21 // ////////////////////////////////////////////////////////////////////
22 BucketKey::BucketKey (const SeatIndex_T& iSeatIndex)
23 : _seatIndex (iSeatIndex) {
24 }
25
26 // ////////////////////////////////////////////////////////////////////
27 BucketKey::BucketKey (const BucketKey& iBucketKey)
28 : _seatIndex (iBucketKey._seatIndex) {
29 }
30
31 // ////////////////////////////////////////////////////////////////////
34
35 // ////////////////////////////////////////////////////////////////////
36 void BucketKey::toStream (std::ostream& ioOut) const {
37 ioOut << "BucketKey: " << toString() << std::endl;
38 }
39
40 // ////////////////////////////////////////////////////////////////////
41 void BucketKey::fromStream (std::istream& ioIn) {
42 }
43
44 // ////////////////////////////////////////////////////////////////////
45 const std::string BucketKey::toString() const {
46 std::ostringstream oStr;
47 oStr << _seatIndex;
48 return oStr.str();
49 }
50
51 // ////////////////////////////////////////////////////////////////////
52 void BucketKey::serialisationImplementationExport() const {
53 std::ostringstream oStr;
54 boost::archive::text_oarchive oa (oStr);
55 oa << *this;
56 }
57
58 // ////////////////////////////////////////////////////////////////////
59 void BucketKey::serialisationImplementationImport() {
60 std::istringstream iStr;
61 boost::archive::text_iarchive ia (iStr);
62 ia >> *this;
63 }
64
65 // ////////////////////////////////////////////////////////////////////
66 template<class Archive>
67 void BucketKey::serialize (Archive& ioArchive,
68 const unsigned int iFileVersion) {
69 ioArchive & _seatIndex;
70 }
71
72 // ////////////////////////////////////////////////////////////////////
73 // Explicit template instantiation
74 namespace ba = boost::archive;
75 template void BucketKey::serialize<ba::text_oarchive> (ba::text_oarchive&,
76 unsigned int);
77 template void BucketKey::serialize<ba::text_iarchive> (ba::text_iarchive&,
78 unsigned int);
79 // ////////////////////////////////////////////////////////////////////
80
81}
Handle on the StdAir library context.
unsigned int SeatIndex_T
void fromStream(std::istream &ioIn)
Definition BucketKey.cpp:41
void serialize(Archive &ar, const unsigned int iFileVersion)
Definition BucketKey.cpp:67
void toStream(std::ostream &ioOut) const
Definition BucketKey.cpp:36
const std::string toString() const
Definition BucketKey.cpp:45