StdAir Logo  1.00.17
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
FacBomManager.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// STL
5#include <cassert>
6// StdAir
16
17namespace stdair {
18 // ////////////////////////////////////////////////////////////////////
21 const SimpleNestingStructure& lYieldBasedNS =
23
24 // Browse the list of node and reset each one.
25 const NestingNodeList_T& lNestingNodeList =
27 for (NestingNodeList_T::const_iterator itNode = lNestingNodeList.begin();
28 itNode != lNestingNodeList.end(); ++itNode) {
29 stdair::NestingNode* lNode_ptr = *itNode;
30 assert (lNode_ptr != NULL);
31
32 lNode_ptr->setYield (-1.0);
33
34 // Clear the list of booking classes of the node
35 const HolderMap_T& lHolderMap = lNode_ptr->getHolderMap();
36 HolderMap_T::const_iterator itHolder = lHolderMap.find (&typeid (BookingClass));
37
38 if (itHolder == lHolderMap.end()) {
39 const std::string lName (typeid (BookingClass).name());
40 throw NonInitialisedContainerException("Cannot find the holder of type "
41 + lName + " within: "
42 + lNode_ptr->describeKey());
43 }
44
45 BomHolder<BookingClass>* lBomHolder_ptr =
46 static_cast<BomHolder<BookingClass>*> (itHolder->second);
47 assert (lBomHolder_ptr != NULL);
48
49 BookingClassList_T& lBCList = lBomHolder_ptr->_bomList;
50 lBCList.clear();
51 }
52 }
53
54}
Handle on the StdAir library context.
std::list< BookingClass * > BookingClassList_T
std::map< const std::type_info *, BomAbstract * > HolderMap_T
const NestingStructureCode_T YIELD_BASED_NESTING_STRUCTURE_CODE
std::list< NestingNode * > NestingNodeList_T
Class representing the holder of BOM object containers (list and map).
Definition BomHolder.hpp:24
static const BomHolder< OBJECT2 >::BomList_T & getList(const OBJECT1 &)
static OBJECT2 & getObject(const OBJECT1 &, const MapKey_T &)
const std::string describeKey() const
const HolderMap_T & getHolderMap() const
void setYield(const Yield_T &iYield)
Class representing the actual attributes for an airline segment-cabin.
static void resetYieldBasedNestingStructure(const SegmentCabin &)