8 #include <boost/archive/text_iarchive.hpp>
9 #include <boost/archive/text_oarchive.hpp>
10 #include <boost/serialization/list.hpp>
11 #include <boost/serialization/map.hpp>
12 #include <boost/serialization/access.hpp>
33 template <
class Archive,
class BOM_OBJECT1,
class BOM_OBJECT2>
35 const unsigned int iFileVersion) {
51 FacBomManager::getBomHolderPtr<BOM_OBJECT2> (ioObject1);
53 if (lBomHolder_ptr == NULL) {
54 lBomHolder_ptr = &FacBomManager::addBomHolder<BOM_OBJECT2> (ioObject1);
56 assert (lBomHolder_ptr != NULL);
62 ioArchive & lBomHolder_ptr->
_bomList;
63 ioArchive & lBomHolder_ptr->
_bomMap;
72 const BomList_T& lBomList = lBomHolder_ptr->
_bomList;
73 for (
typename BomList_T::const_iterator itObject = lBomList.begin();
74 itObject != lBomList.end(); ++itObject) {
75 BOM_OBJECT2* lObject2_ptr = *itObject;
76 assert (lObject2_ptr != NULL);
78 if (lObject2_ptr->getParent() == NULL) {
97 const BomMap_T& lBomMap = lBomHolder_ptr->
_bomMap;
98 if (lBomList.empty() ==
true && lBomMap.empty() ==
false) {
100 for (
typename BomMap_T::const_iterator itObject = lBomMap.begin();
101 itObject != lBomMap.end(); ++itObject) {
102 BOM_OBJECT2* lObject2_ptr = itObject->second;
103 assert (lObject2_ptr != NULL);
105 if (lObject2_ptr->getParent() == NULL) {
118 void BomRoot::serialisationImplementationExport()
const {
119 std::ostringstream oStr;
120 boost::archive::text_oarchive oa (oStr);
125 void BomRoot::serialisationImplementationImport() {
126 std::istringstream iStr;
127 boost::archive::text_iarchive ia (iStr);
132 template<
class Archive>
134 const unsigned int iFileVersion) {
140 stdair::serialiseHelper<Archive, BomRoot, Inventory> (*
this, ioArchive,
145 void Inventory::serialisationImplementationExport()
const {
146 std::ostringstream oStr;
147 boost::archive::text_oarchive oa (oStr);
152 void Inventory::serialisationImplementationImport() {
153 std::istringstream iStr;
154 boost::archive::text_iarchive ia (iStr);
159 template<
class Archive>
161 const unsigned int iFileVersion) {
167 stdair::serialiseHelper<Archive, Inventory, FlightDate> (*
this, ioArchive,
172 void FlightDate::serialisationImplementationExport()
const {
173 std::ostringstream oStr;
174 boost::archive::text_oarchive oa (oStr);
179 void FlightDate::serialisationImplementationImport() {
180 std::istringstream iStr;
181 boost::archive::text_iarchive ia (iStr);
186 template<
class Archive>
188 const unsigned int iFileVersion) {
193 void SegmentDate::serialisationImplementationExport()
const {
194 std::ostringstream oStr;
195 boost::archive::text_oarchive oa (oStr);
200 void SegmentDate::serialisationImplementationImport() {
201 std::istringstream iStr;
202 boost::archive::text_iarchive ia (iStr);
207 template<
class Archive>
209 const unsigned int iFileVersion) {
214 void SegmentCabin::serialisationImplementationExport()
const {
215 std::ostringstream oStr;
216 boost::archive::text_oarchive oa (oStr);
221 void SegmentCabin::serialisationImplementationImport() {
222 std::istringstream iStr;
223 boost::archive::text_iarchive ia (iStr);
228 template<
class Archive>
230 const unsigned int iFileVersion) {
236 namespace ba = boost::archive;
237 template void BomRoot::serialize<ba::text_oarchive> (ba::text_oarchive&,
239 template void BomRoot::serialize<ba::text_iarchive> (ba::text_iarchive&,
241 template void Inventory::serialize<ba::text_oarchive> (ba::text_oarchive&,
243 template void Inventory::serialize<ba::text_iarchive> (ba::text_iarchive&,
245 template void FlightDate::serialize<ba::text_oarchive> (ba::text_oarchive&,
247 template void FlightDate::serialize<ba::text_iarchive> (ba::text_iarchive&,
249 template void SegmentDate::serialize<ba::text_oarchive> (ba::text_oarchive&,
251 template void SegmentDate::serialize<ba::text_iarchive> (ba::text_iarchive&,
253 template void SegmentCabin::serialize<ba::text_oarchive> (ba::text_oarchive&,
255 template void SegmentCabin::serialize<ba::text_iarchive> (ba::text_iarchive&,
static void linkWithParent(PARENT &, CHILD &)
void serialize(Archive &ar, const unsigned int iFileVersion)
Handle on the StdAir library context.
std::map< const MapKey_T, BOM * > BomMap_T
std::list< BOM * > BomList_T
void serialize(Archive &ar, const unsigned int iFileVersion)
void serialize(Archive &ar, const unsigned int iFileVersion)
void serialiseHelper(BOM_OBJECT1 &ioObject1, Archive &ioArchive, const unsigned int iFileVersion)
void serialize(Archive &ar, const unsigned int iFileVersion)
Class representing the holder of BOM object containers (list and map).
void serialize(Archive &ar, const unsigned int iFileVersion)