PaCO++  0.05
paco_com.cc
Go to the documentation of this file.
00001 #if 0
00002 #include "paco_com.h"
00003 
00006 // Implementation of paco_com
00007 
00008 paco_com::paco_com() {}
00009 paco_com::~paco_com() {}
00010 
00013 // Implementation of paco_fabrique_com
00014 
00015 paco_fabrique_com::paco_fabrique_com() { 
00016   // Be sure class_map is empty ;)
00017   _class_map.clear();
00018 }
00019 
00020 paco_fabrique_com::~paco_fabrique_com() { }
00021 
00022 void paco_fabrique_com::paco_register(const string& lib_com, paco_individual_fabrique_com* pifc) {
00023 
00024   class_map_t::iterator it = _class_map.find(lib_com);
00025 
00026   if (it == _class_map.end() ) {
00027     cout << "Adding com lib " << lib_com << endl;
00028     _class_map[lib_com] = pifc;
00029   } else {
00030     cout << "Ignoring: already register com lib " << lib_com << endl;
00031   }
00032 
00033 }
00034 
00035 paco_com* paco_fabrique_com::paco_create(const string& lib_com, void* group)
00036 {
00037   class_map_t::iterator it = _class_map.find(lib_com);
00038 
00039   if (it == _class_map.end() ) {
00040     cout << "Not found com lib " << lib_com << endl;
00041     return NULL;
00042   } else {
00043     return it->second->paco_create(group);
00044   }
00045 }
00046 
00049 #endif