00001 // ////////////////////////////////////////////////////////////////////// 00002 // Import section 00003 // ////////////////////////////////////////////////////////////////////// 00004 // C 00005 #include <assert.h> 00006 // RMOL 00007 #include <rmol/bom/Overbooking.hpp> 00008 #include <rmol/factory/FacSupervisor.hpp> 00009 #include <rmol/factory/FacOverbooking.hpp> 00010 00011 namespace RMOL { 00012 00013 FacOverbooking* FacOverbooking::_instance = NULL; 00014 00015 // ////////////////////////////////////////////////////////////////////// 00016 FacOverbooking::~FacOverbooking () { 00017 _instance = NULL; 00018 } 00019 00020 // ////////////////////////////////////////////////////////////////////// 00021 FacOverbooking& FacOverbooking::instance () { 00022 00023 if (_instance == NULL) { 00024 _instance = new FacOverbooking(); 00025 assert (_instance != NULL); 00026 00027 FacSupervisor::instance().registerBomFactory (_instance); 00028 } 00029 return *_instance; 00030 } 00031 00032 // ////////////////////////////////////////////////////////////////////// 00033 Overbooking& FacOverbooking::create (const FldOverbookingPolicy& iPolicy) { 00034 Overbooking* aOverbooking_ptr = NULL; 00035 00036 aOverbooking_ptr = new Overbooking (iPolicy); 00037 assert (aOverbooking_ptr != NULL); 00038 00039 // The new object is added to the Bom pool 00040 _pool.push_back (aOverbooking_ptr); 00041 00042 return *aOverbooking_ptr; 00043 } 00044 00045 }
Generated on Sat Jun 6 13:48:35 2009 for RMOL by Doxygen 1.5.7.1