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

stdair/bom/NestingNodeKey.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/bom/NestingNodeKey.hpp>
00014 
00015 namespace stdair {
00016 
00017   // ////////////////////////////////////////////////////////////////////
00018   NestingNodeKey::NestingNodeKey() : _nestingNodeCode (DEFAULT_POLICY_CODE) {
00019     assert (false);
00020   }
00021 
00022   // ////////////////////////////////////////////////////////////////////
00023   NestingNodeKey::NestingNodeKey (const NestingNodeKey& iNestingNodeKey)
00024     : _nestingNodeCode (iNestingNodeKey._nestingNodeCode) {
00025   }
00026 
00027   // ////////////////////////////////////////////////////////////////////
00028   NestingNodeKey::NestingNodeKey (const NestingNodeCode_T& iNestingNodeCode)
00029     : _nestingNodeCode (iNestingNodeCode) {
00030   }
00031 
00032   // ////////////////////////////////////////////////////////////////////
00033   NestingNodeKey::~NestingNodeKey() {
00034   }
00035 
00036   // ////////////////////////////////////////////////////////////////////
00037   void NestingNodeKey::toStream (std::ostream& ioOut) const {
00038     ioOut << "NestingNodeKey: " << toString();
00039   }
00040 
00041   // ////////////////////////////////////////////////////////////////////
00042   void NestingNodeKey::fromStream (std::istream& ioIn) {
00043   }
00044 
00045   // ////////////////////////////////////////////////////////////////////
00046   const std::string NestingNodeKey::toString() const {
00047     std::ostringstream oStr;
00048     oStr << _nestingNodeCode;
00049     return oStr.str();
00050   }
00051 
00052   // ////////////////////////////////////////////////////////////////////
00053   void NestingNodeKey::serialisationImplementationExport() const {
00054     std::ostringstream oStr;
00055     boost::archive::text_oarchive oa (oStr);
00056     oa << *this;
00057   }
00058 
00059   // ////////////////////////////////////////////////////////////////////
00060   void NestingNodeKey::serialisationImplementationImport() {
00061     std::istringstream iStr;
00062     boost::archive::text_iarchive ia (iStr);
00063     ia >> *this;
00064   }
00065 
00066   // ////////////////////////////////////////////////////////////////////
00067   template<class Archive>
00068   void NestingNodeKey::serialize (Archive& ioArchive,
00069                                    const unsigned int iFileVersion) {
00074     ioArchive & _nestingNodeCode;
00075   }
00076 
00077   // ////////////////////////////////////////////////////////////////////
00078   // Explicit template instantiation
00079   namespace ba = boost::archive;
00080   template void NestingNodeKey::serialize<ba::text_oarchive> (ba::text_oarchive&,
00081                                                              unsigned int);
00082   template void NestingNodeKey::serialize<ba::text_iarchive> (ba::text_iarchive&,
00083                                                              unsigned int);
00084   // ////////////////////////////////////////////////////////////////////
00085 
00086 }