StdAir Logo  1.00.16
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
SegmentSnapshotTableKey.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
15
16namespace stdair {
17
18 // ////////////////////////////////////////////////////////////////////
19 SegmentSnapshotTableKey::SegmentSnapshotTableKey()
20 : _tableID (DEFAULT_TABLE_ID) {
21 assert (false);
22 }
23
24 // ////////////////////////////////////////////////////////////////////
25 SegmentSnapshotTableKey::
26 SegmentSnapshotTableKey (const TableID_T& iTableID)
27 : _tableID (iTableID) {
28 }
29
30 // ////////////////////////////////////////////////////////////////////
31 SegmentSnapshotTableKey::SegmentSnapshotTableKey (const SegmentSnapshotTableKey& iKey)
32 : _tableID (iKey._tableID) {
33 }
34
35 // ////////////////////////////////////////////////////////////////////
38
39 // ////////////////////////////////////////////////////////////////////
40 void SegmentSnapshotTableKey::toStream (std::ostream& ioOut) const {
41 ioOut << "SegmentSnapshotTableKey: " << toString();
42 }
43
44 // ////////////////////////////////////////////////////////////////////
45 void SegmentSnapshotTableKey::fromStream (std::istream& ioIn) {
46 }
47
48 // ////////////////////////////////////////////////////////////////////
49 const std::string SegmentSnapshotTableKey::toString() const {
50 std::ostringstream oStr;
51 oStr << _tableID;
52 return oStr.str();
53 }
54
55 // ////////////////////////////////////////////////////////////////////
56 void SegmentSnapshotTableKey::serialisationImplementationExport() const {
57 std::ostringstream oStr;
58 boost::archive::text_oarchive oa (oStr);
59 oa << *this;
60 }
61
62 // ////////////////////////////////////////////////////////////////////
63 void SegmentSnapshotTableKey::serialisationImplementationImport() {
64 std::istringstream iStr;
65 boost::archive::text_iarchive ia (iStr);
66 ia >> *this;
67 }
68
69 // ////////////////////////////////////////////////////////////////////
70 template<class Archive>
71 void SegmentSnapshotTableKey::serialize (Archive& ioArchive,
72 const unsigned int iFileVersion) {
77 ioArchive & _tableID;
78 }
79
80 // ////////////////////////////////////////////////////////////////////
81 // Explicit template instantiation
82 namespace ba = boost::archive;
83 template void SegmentSnapshotTableKey::
84 serialize<ba::text_oarchive> (ba::text_oarchive&, unsigned int);
85 template void SegmentSnapshotTableKey::
86 serialize<ba::text_iarchive> (ba::text_iarchive&, unsigned int);
87 // ////////////////////////////////////////////////////////////////////
88
89}
Handle on the StdAir library context.
const TableID_T DEFAULT_TABLE_ID
unsigned short TableID_T
Key of a given guillotine block, made of a guillotine number.
void serialize(Archive &ar, const unsigned int iFileVersion)
void toStream(std::ostream &ioOut) const