#include "filterhome_impl.h" #include "produktfilter_impl.h" using namespace Auktion; FilterHome_impl::FilterHome_impl(void) : CCM_FilterHome(), table_(STD_MAP()) {} FilterHome_impl::~FilterHome_impl(void) {} ::Components::EnterpriseComponent_ptr FilterHome_impl::create() { // this method was the result of MICO's CCM-mapping; // we recommend that this method should not be used! throw new CORBA::SystemException(); return NULL; } ::Components::EnterpriseComponent_ptr FilterHome_impl::new_filter(const char* gegenstand) { assert(gegenstand); // convert to std::string const std::string name(CORBA::string_dup(gegenstand)); // look up in dictionary STD_MAP::const_iterator iter = table_.find(name); ::Components::EnterpriseComponent_var filter; if(iter == table_.end()) { // filter doesn't exists, therefore create new one filter = new ProduktFilter_impl(name.c_str()); // ...and add him to table table_[name] = ::Components::EnterpriseComponent::_duplicate(filter); } else { // read reference from the dictionary filter = (*iter).second; } return ::Components::EnterpriseComponent::_duplicate(filter); } extern "C" { Components::HomeExecutorBase_ptr create_Auktion_FilterHome() { return new FilterHome_impl(); } // only dummy implementations Components::HomeExecutorBase_ptr create_Auktion_VerkaeuferHome() { return NULL; } Components::HomeExecutorBase_ptr create_Auktion_BieterHome() { return NULL; } Components::HomeExecutorBase_ptr create_Auktion_Welt() { return NULL; } }