$treeview $search $mathjax
StdAir Logo  1.00.1
$projectbrief
$projectbrief
$searchbox

stdair/bom/SegmentSnapshotTableKey.cpp

Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <cassert>
00006 #include <sstream>
00007 // Boost.Serialization
00008 #include <boost/archive/text_iarchive.hpp>
00009 #include <boost/archive/text_oarchive.hpp>
00010 #include <boost/serialization/access.hpp>
00011 // StdAir
00012 #include <stdair/basic/BasConst_Inventory.hpp>
00013 #include <stdair/basic/BasConst_BomDisplay.hpp>
00014 #include <stdair/bom/SegmentSnapshotTableKey.hpp>
00015 
00016 namespace stdair {
00017 
00018   // ////////////////////////////////////////////////////////////////////
00019   SegmentSnapshotTableKey::SegmentSnapshotTableKey()
00020     : _tableID (DEFAULT_TABLE_ID) {
00021     assert (false);
00022   }
00023 
00024   // ////////////////////////////////////////////////////////////////////
00025   SegmentSnapshotTableKey::
00026   SegmentSnapshotTableKey (const TableID_T& iTableID)
00027     : _tableID (iTableID) {
00028   }
00029 
00030   // ////////////////////////////////////////////////////////////////////
00031   SegmentSnapshotTableKey::SegmentSnapshotTableKey (const SegmentSnapshotTableKey& iKey)
00032     : _tableID (iKey._tableID) {
00033   }
00034 
00035   // ////////////////////////////////////////////////////////////////////
00036   SegmentSnapshotTableKey::~SegmentSnapshotTableKey() {
00037   }
00038 
00039   // ////////////////////////////////////////////////////////////////////
00040   void SegmentSnapshotTableKey::toStream (std::ostream& ioOut) const {
00041     ioOut << "SegmentSnapshotTableKey: " << toString();
00042   }
00043 
00044   // ////////////////////////////////////////////////////////////////////
00045   void SegmentSnapshotTableKey::fromStream (std::istream& ioIn) {
00046   }
00047 
00048   // ////////////////////////////////////////////////////////////////////
00049   const std::string SegmentSnapshotTableKey::toString() const {
00050     std::ostringstream oStr;
00051     oStr << _tableID;
00052     return oStr.str();
00053   }
00054 
00055   // ////////////////////////////////////////////////////////////////////
00056   void SegmentSnapshotTableKey::serialisationImplementationExport() const {
00057     std::ostringstream oStr;
00058     boost::archive::text_oarchive oa (oStr);
00059     oa << *this;
00060   }
00061 
00062   // ////////////////////////////////////////////////////////////////////
00063   void SegmentSnapshotTableKey::serialisationImplementationImport() {
00064     std::istringstream iStr;
00065     boost::archive::text_iarchive ia (iStr);
00066     ia >> *this;
00067   }
00068 
00069   // ////////////////////////////////////////////////////////////////////
00070   template<class Archive>
00071   void SegmentSnapshotTableKey::serialize (Archive& ioArchive,
00072                                  const unsigned int iFileVersion) {
00077     ioArchive & _tableID;
00078   }
00079 
00080   // ////////////////////////////////////////////////////////////////////
00081   // Explicit template instantiation
00082   namespace ba = boost::archive;
00083   template void SegmentSnapshotTableKey::
00084   serialize<ba::text_oarchive> (ba::text_oarchive&, unsigned int);
00085   template void SegmentSnapshotTableKey::
00086   serialize<ba::text_iarchive> (ba::text_iarchive&, unsigned int);
00087   // ////////////////////////////////////////////////////////////////////
00088 
00089 }