/
#include <cassert>
#include <ostream>
FlagSaver (std::ostream& oStream)
: _oStream (oStream), _streamFlags (oStream.flags()) {
}
~FlagSaver() {
_oStream.flags (_streamFlags);
}
private:
std::ostream& _oStream;
std::ios::fmtflags _streamFlags;
};
void BomDisplay::list (std::ostream& oStream, const BomRoot& iBomRoot,
const AirlineCode_T& iAirlineCode,
const FlightNumber_T& iFlightNumber) {
FlagSaver flagSaver (oStream);
if (BomManager::hasList<Inventory> (iBomRoot) == false) {
return;
}
unsigned short invIdx = 1;
BomManager::getList<Inventory> (iBomRoot);
for (InventoryList_T::const_iterator itInv = lInventoryList.begin();
itInv != lInventoryList.end(); ++itInv, ++invIdx) {
const Inventory* lInv_ptr = *itInv;
assert (lInv_ptr != NULL);
if (iAirlineCode == "all" || iAirlineCode == lAirlineCode) {
list (oStream, *lInv_ptr, invIdx, iFlightNumber);
}
}
}
void BomDisplay::list (std::ostream& oStream, const Inventory& iInventory,
const unsigned short iInventoryIndex,
const FlightNumber_T& iFlightNumber) {
FlagSaver flagSaver (oStream);
if (BomManager::hasMap<FlightDate> (iInventory) == false) {
return;
}
Handle on the StdAir library context.
std::list< Inventory * > InventoryList_T
std::string AirlineCode_T