StdAir Logo  0.44.0
C++ Standard Airline IT Object Library
BomRoot.cpp
Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <cassert>
00006 #include <sstream>
00007 // StdAir
00008 #include <stdair/basic/BasConst_General.hpp>
00009 #include <stdair/bom/BomManager.hpp>
00010 #include <stdair/bom/BomRoot.hpp>
00011 #include <stdair/bom/InventoryKey.hpp>
00012 #include <stdair/bom/Inventory.hpp>
00013 
00014 namespace stdair {
00015 
00016   // ////////////////////////////////////////////////////////////////////
00017   BomRoot::BomRoot() {
00018     assert (false);
00019   }
00020 
00021   // ////////////////////////////////////////////////////////////////////
00022   BomRoot::BomRoot (const BomRoot& iBomRoot) {
00023     assert (false);
00024   }
00025 
00026   // ////////////////////////////////////////////////////////////////////
00027   BomRoot::BomRoot (const Key_T& iKey) : _key (iKey) {
00028   }
00029 
00030   // ////////////////////////////////////////////////////////////////////
00031   BomRoot::~BomRoot() {
00032   }
00033 
00034   // ////////////////////////////////////////////////////////////////////
00035   std::string BomRoot::toString() const {
00036     std::ostringstream oStr;
00037     oStr << _key.toString();
00038     return oStr.str();
00039   }
00040 
00041   // ////////////////////////////////////////////////////////////////////
00042   Inventory* BomRoot::getInventory (const std::string& iInventoryKeyStr) const {
00043     Inventory* oInventory_ptr =
00044       BomManager::getObjectPtr<Inventory> (*this, iInventoryKeyStr);
00045     return oInventory_ptr;
00046   }
00047 
00048   // ////////////////////////////////////////////////////////////////////
00049   Inventory* BomRoot::getInventory (const InventoryKey& iInventoryKey) const {
00050     return getInventory (iInventoryKey.toString());
00051   }
00052 
00053 }