/* * MICO --- a free CORBA implementation * * MicoCCM written by Frank Pilhofer, sponsored by Alcatel * * This file was automatically generated. DO NOT EDIT! */ #include #ifdef HAVE_ANSI_CPLUSPLUS_HEADERS #include #include #else // HAVE_ANSI_CPLUSPLUS_HEADERS #include #include #endif // HAVE_ANSI_CPLUSPLUS_HEADERS #include "auktion_ccm.h" using namespace std; /* * Glue class for component Auktion::Bieter */ MICO_CCM_impls:: Auktion_Bieter_impl::Auktion_Bieter_impl (Auktion::CCM_Bieter * i, MICO::CCM::SessionContainer * c) : _instance (i), _container (c) { _context = new Auktion_Bieter_Context_impl (this, c); _cookie_for_versteigerungen = 0; } MICO_CCM_impls:: Auktion_Bieter_impl::~Auktion_Bieter_impl () { delete _instance; delete _context; } /* * Component Attributes */ /* * Supported Interfaces */ // ::Auktion::Kaeufer void MICO_CCM_impls:: Auktion_Bieter_impl::zuschlag (Auktion::Versteigerung_ptr gegenstand, Auktion::Verkaeufer_ptr v) { _instance->zuschlag (gegenstand, v); } /* * Equivalent IDL methods */ // no facets // receptacles Components::Cookie * MICO_CCM_impls:: Auktion_Bieter_impl::connect_versteigerungen (Auktion::Versteigerung_ptr _value) { Components::Cookie_var _ck = new MICO::CCM::Cookie_impl; _ck->CookieValue().replace (sizeof (CORBA::ULong), sizeof (CORBA::ULong), (CORBA::Octet *) &_cookie_for_versteigerungen); _cookie_for_versteigerungen++; CORBA::ULong _idx = _for_recep_versteigerungen.length (); _for_recep_versteigerungen.length (_idx + 1); _for_recep_versteigerungen[_idx].ck = _ck; _for_recep_versteigerungen[_idx].objref = Auktion::Versteigerung::_duplicate (_value); return _ck._retn(); } Auktion::Versteigerung_ptr MICO_CCM_impls:: Auktion_Bieter_impl::disconnect_versteigerungen (Components::Cookie * _value) { CORBA::ULong _idx, _ck1, _ck2; if (!_value || _value->CookieValue().length() != sizeof (CORBA::ULong)) { throw Components::InvalidConnection(); } _ck1 = * ((CORBA::ULong *) _value->CookieValue().get_buffer()); for (_idx=0; _idx<_for_recep_versteigerungen.length(); _idx++) { _ck2 = * ((CORBA::ULong *) _for_recep_versteigerungen[_idx].ck->CookieValue().get_buffer()); if (_ck1 == _ck2) break; } if (_idx == _for_recep_versteigerungen.length()) { throw Components::InvalidConnection(); } Auktion::Versteigerung_var _res = Auktion::Versteigerung::_duplicate (_for_recep_versteigerungen[_idx].objref); for (;_idx<_for_recep_versteigerungen.length()-1; _idx++) { _for_recep_versteigerungen[_idx] = _for_recep_versteigerungen[_idx+1]; } _for_recep_versteigerungen.length (_idx); return _res._retn(); } Auktion::Bieter::versteigerungenConnections * MICO_CCM_impls:: Auktion_Bieter_impl::get_connections_versteigerungen () { return new Auktion::Bieter::versteigerungenConnections (_for_recep_versteigerungen); } // no publishers // no emitters // consumers ::Auktion::GebotConsumer_ptr MICO_CCM_impls:: Auktion_Bieter_impl::get_consumer_gebote () { if (CORBA::is_nil (_for_consumer_gebote)) { PortableServer::ServantBase_var _consumer_servant = new Auktion_Bieter_gebote_impl (this); CORBA::Object_var _ref = _container->activate_facet (this, "gebote", CORBA::LocalObject::_nil(), _consumer_servant); _for_consumer_gebote = ::Auktion::GebotConsumer::_narrow (_ref); } return ::Auktion::GebotConsumer::_duplicate (_for_consumer_gebote); } /* * Inherited Navigation interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_Bieter_impl::provide_facet (const char * _name) { throw Components::InvalidName(); return CORBA::Object::_nil (); } Components::FacetDescriptions * MICO_CCM_impls:: Auktion_Bieter_impl::get_all_facets () { Components::NameList _allnames; _allnames.length (0); return get_named_facets (_allnames); } Components::FacetDescriptions * MICO_CCM_impls:: Auktion_Bieter_impl::get_named_facets (const Components::NameList & _names) { Components::FacetDescriptions_var _res = new Components::FacetDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } CORBA::Boolean MICO_CCM_impls:: Auktion_Bieter_impl::same_component (CORBA::Object_ptr _ref) { return 0; } /* * Inherited Receptacles interface */ Components::Cookie * MICO_CCM_impls:: Auktion_Bieter_impl::connect (const char * _name, CORBA::Object_ptr _ref) { if (strcmp (_name, "versteigerungen") == 0) { ::Auktion::Versteigerung_var _tref = ::Auktion::Versteigerung::_narrow (_ref); if (CORBA::is_nil (_tref) && !CORBA::is_nil (_ref)) { throw Components::InvalidConnection(); } return connect_versteigerungen (_tref); } throw Components::InvalidName(); return new MICO::CCM::Cookie_impl; } void MICO_CCM_impls:: Auktion_Bieter_impl::disconnect (const char * _name, Components::Cookie * _ck) { if (strcmp (_name, "versteigerungen") == 0) { ::Auktion::Versteigerung_var _dummy; _dummy = disconnect_versteigerungen (_ck); return; } throw Components::InvalidName(); } Components::ConnectionDescriptions * MICO_CCM_impls:: Auktion_Bieter_impl::get_connections (const char * _name) { Components::NameList _thename (1); _thename[0] = _name; Components::ReceptacleDescriptions_var _rdv = get_named_receptacles (_thename); return new Components::ConnectionDescriptions (_rdv[(CORBA::ULong)0]->connections()); } Components::ReceptacleDescriptions * MICO_CCM_impls:: Auktion_Bieter_impl::get_all_receptacles () { Components::NameList _allnames; _allnames.length (1); _allnames[0] = CORBA::string_dup ("versteigerungen"); return get_named_receptacles (_allnames); } Components::ReceptacleDescriptions * MICO_CCM_impls:: Auktion_Bieter_impl::get_named_receptacles (const Components::NameList & _names) { Components::ReceptacleDescriptions_var _res = new Components::ReceptacleDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { if (strcmp (_names[_idx].in(), "versteigerungen") == 0) { _res[_idx] = new MICO::CCM::ReceptacleDescription_impl; _res[_idx]->name ((const char *) "versteigerungen"); _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Versteigerung:1.0"); _res[_idx]->is_multiplex (1); _res[_idx]->connections().length (_for_recep_versteigerungen.length()); for (CORBA::ULong _idx2=0; _idx2<_for_recep_versteigerungen.length(); _idx2++) { _res[_idx]->connections()[_idx2] = new MICO::CCM::ConnectionDescription_impl; _res[_idx]->connections()[_idx2]->ck (_for_recep_versteigerungen[_idx2].ck); _res[_idx]->connections()[_idx2]->objref (_for_recep_versteigerungen[_idx2].objref); } continue; } throw Components::InvalidName(); } return _res._retn(); } /* * Inherited Events interface */ Components::EventConsumerBase_ptr MICO_CCM_impls:: Auktion_Bieter_impl::get_consumer (const char * _name) { if (strcmp (_name, "gebote") == 0) { return get_consumer_gebote (); } throw Components::InvalidName(); return Components::EventConsumerBase::_nil (); } Components::ConsumerDescriptions * MICO_CCM_impls:: Auktion_Bieter_impl::get_all_consumers () { Components::NameList _allnames; _allnames.length (1); _allnames[0] = CORBA::string_dup ("gebote"); return get_named_consumers (_allnames); } Components::ConsumerDescriptions * MICO_CCM_impls:: Auktion_Bieter_impl::get_named_consumers (const Components::NameList & _names) { Components::ConsumerDescriptions_var _res = new Components::ConsumerDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { if (strcmp (_names[_idx].in(), "gebote") == 0) { _res[_idx] = new MICO::CCM::ConsumerDescription_impl; _res[_idx]->name ((const char *) "gebote"); _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Gebot:1.0"); Components::EventConsumerBase_var _tmp = get_consumer ("gebote"); _res[_idx]->consumer (_tmp); continue; } throw Components::InvalidName(); } return _res._retn(); } Components::Cookie * MICO_CCM_impls:: Auktion_Bieter_impl::subscribe (const char * _name, Components::EventConsumerBase_ptr _ref) { throw Components::InvalidName(); return new MICO::CCM::Cookie_impl; } void MICO_CCM_impls:: Auktion_Bieter_impl::unsubscribe (const char * _name, Components::Cookie * _ck) { throw Components::InvalidName(); } Components::PublisherDescriptions * MICO_CCM_impls:: Auktion_Bieter_impl::get_all_publishers () { Components::NameList _allnames; _allnames.length (0); return get_named_publishers (_allnames); } Components::PublisherDescriptions * MICO_CCM_impls:: Auktion_Bieter_impl::get_named_publishers (const Components::NameList & _names) { Components::PublisherDescriptions_var _res = new Components::PublisherDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } void MICO_CCM_impls:: Auktion_Bieter_impl::connect_consumer (const char * _name, Components::EventConsumerBase_ptr _ref) { throw Components::InvalidName(); } Components::EventConsumerBase_ptr MICO_CCM_impls:: Auktion_Bieter_impl::disconnect_consumer (const char * _name) { throw Components::InvalidName(); } Components::EmitterDescriptions * MICO_CCM_impls:: Auktion_Bieter_impl::get_all_emitters () { Components::NameList _allnames; _allnames.length (0); return get_named_emitters (_allnames); } Components::EmitterDescriptions * MICO_CCM_impls:: Auktion_Bieter_impl::get_named_emitters (const Components::NameList & _names) { Components::EmitterDescriptions_var _res = new Components::EmitterDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } /* * Inherited CCMObject interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_Bieter_impl::get_component_def () { return CORBA::Object::_nil (); } Components::CCMHome_ptr MICO_CCM_impls:: Auktion_Bieter_impl::get_ccm_home () { return _container->get_reference_for_home (); } void MICO_CCM_impls:: Auktion_Bieter_impl::configuration_complete () { _container->configuration_complete (this); Components::SessionComponent_ptr _sc = Components::SessionComponent::_narrow (_instance); if (!CORBA::is_nil (_sc)) { _sc->set_session_context (_context); _sc->ccm_activate (); } } Components::ComponentPortDescription * MICO_CCM_impls:: Auktion_Bieter_impl::get_all_ports () { Components::FacetDescriptions_var _fds = get_all_facets (); Components::ReceptacleDescriptions_var _rds = get_all_receptacles (); Components::ConsumerDescriptions_var _cds = get_all_consumers (); Components::EmitterDescriptions_var _eds = get_all_emitters (); Components::PublisherDescriptions_var _pds = get_all_publishers (); Components::ComponentPortDescription_var _cpd = new MICO::CCM::ComponentPortDescription_impl; _cpd->facets (_fds.in()); _cpd->receptacles (_rds.in()); _cpd->consumers (_cds.in()); _cpd->emitters (_eds.in()); _cpd->publishers (_pds.in()); return _cpd._retn(); } void MICO_CCM_impls:: Auktion_Bieter_impl::remove () { Components::CCMHome_var myhome = get_ccm_home (); Components::CCMObject_var myself = _container->get_reference_for_component (this); myhome->remove_component (myself); } /* * Overload default implementation */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_Bieter_impl::_get_component () { return _container->get_reference_for_component (this); } /* * Glue class for consumer gebote of component Auktion::Bieter * type Auktion::Gebot */ MICO_CCM_impls:: Auktion_Bieter_gebote_impl::Auktion_Bieter_gebote_impl (Auktion_Bieter_impl * _g) { _glue = _g; } MICO_CCM_impls:: Auktion_Bieter_gebote_impl::~Auktion_Bieter_gebote_impl () { } void MICO_CCM_impls:: Auktion_Bieter_gebote_impl::push_event (Components::EventBase * ev) { Auktion::Gebot * tev = Auktion::Gebot::_downcast (ev); if (tev == 0 && ev != 0) { throw Components::BadEventType ((const char *) "Auktion::Gebot"); } push_Gebot (tev); } void MICO_CCM_impls:: Auktion_Bieter_gebote_impl::push_Gebot (Auktion::Gebot * tev) { _glue->_instance->push_gebote (tev); } /* * Context class for component Auktion::Bieter */ MICO_CCM_impls:: Auktion_Bieter_Context_impl::Auktion_Bieter_Context_impl (Auktion_Bieter_impl * _g, MICO::CCM::SessionContainer * _c) { _glue = _g; _container = _c; } MICO_CCM_impls:: Auktion_Bieter_Context_impl::~Auktion_Bieter_Context_impl () { } Auktion::Bieter::versteigerungenConnections * MICO_CCM_impls:: Auktion_Bieter_Context_impl::get_connections_versteigerungen () { return _glue->get_connections_versteigerungen (); } Components::CCMHome_ptr MICO_CCM_impls:: Auktion_Bieter_Context_impl::get_CCM_home () { return _container->get_CCM_home (); } CORBA::Object_ptr MICO_CCM_impls:: Auktion_Bieter_Context_impl::get_CCM_object () { return _container->get_CCM_object (_glue->_instance); } /* * Glue class for component Auktion::Verkaeufer */ MICO_CCM_impls:: Auktion_Verkaeufer_impl::Auktion_Verkaeufer_impl (Auktion::CCM_Verkaeufer * i, MICO::CCM::SessionContainer * c) : _instance (i), _container (c) { _context = new Auktion_Verkaeufer_Context_impl (this, c); } MICO_CCM_impls:: Auktion_Verkaeufer_impl::~Auktion_Verkaeufer_impl () { delete _instance; delete _context; } /* * Component Attributes */ /* * Supported Interfaces */ /* * Equivalent IDL methods */ // no facets // receptacles void MICO_CCM_impls:: Auktion_Verkaeufer_impl::connect_handelsplatz (Auktion::VersteigerungsFabrik_ptr _value) { _for_recep_handelsplatz = Auktion::VersteigerungsFabrik::_duplicate (_value); } Auktion::VersteigerungsFabrik_ptr MICO_CCM_impls:: Auktion_Verkaeufer_impl::disconnect_handelsplatz () { Auktion::VersteigerungsFabrik_var _res = Auktion::VersteigerungsFabrik::_duplicate (_for_recep_handelsplatz); _for_recep_handelsplatz = Auktion::VersteigerungsFabrik::_nil (); return _res._retn (); } Auktion::VersteigerungsFabrik_ptr MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_connection_handelsplatz () { return Auktion::VersteigerungsFabrik::_duplicate (_for_recep_handelsplatz); } // no publishers // no emitters // consumers ::Auktion::KaufConsumer_ptr MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_consumer_zuschlag () { if (CORBA::is_nil (_for_consumer_zuschlag)) { PortableServer::ServantBase_var _consumer_servant = new Auktion_Verkaeufer_zuschlag_impl (this); CORBA::Object_var _ref = _container->activate_facet (this, "zuschlag", CORBA::LocalObject::_nil(), _consumer_servant); _for_consumer_zuschlag = ::Auktion::KaufConsumer::_narrow (_ref); } return ::Auktion::KaufConsumer::_duplicate (_for_consumer_zuschlag); } /* * Inherited Navigation interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_Verkaeufer_impl::provide_facet (const char * _name) { throw Components::InvalidName(); return CORBA::Object::_nil (); } Components::FacetDescriptions * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_all_facets () { Components::NameList _allnames; _allnames.length (0); return get_named_facets (_allnames); } Components::FacetDescriptions * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_named_facets (const Components::NameList & _names) { Components::FacetDescriptions_var _res = new Components::FacetDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } CORBA::Boolean MICO_CCM_impls:: Auktion_Verkaeufer_impl::same_component (CORBA::Object_ptr _ref) { return 0; } /* * Inherited Receptacles interface */ Components::Cookie * MICO_CCM_impls:: Auktion_Verkaeufer_impl::connect (const char * _name, CORBA::Object_ptr _ref) { if (strcmp (_name, "handelsplatz") == 0) { ::Auktion::VersteigerungsFabrik_var _tref = ::Auktion::VersteigerungsFabrik::_narrow (_ref); if (CORBA::is_nil (_tref) && !CORBA::is_nil (_ref)) { throw Components::InvalidConnection(); } connect_handelsplatz (_tref); return 0; } throw Components::InvalidName(); return new MICO::CCM::Cookie_impl; } void MICO_CCM_impls:: Auktion_Verkaeufer_impl::disconnect (const char * _name, Components::Cookie * _ck) { if (strcmp (_name, "handelsplatz") == 0) { ::Auktion::VersteigerungsFabrik_var _dummy; _dummy = disconnect_handelsplatz (); return; } throw Components::InvalidName(); } Components::ConnectionDescriptions * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_connections (const char * _name) { Components::NameList _thename (1); _thename[0] = _name; Components::ReceptacleDescriptions_var _rdv = get_named_receptacles (_thename); return new Components::ConnectionDescriptions (_rdv[(CORBA::ULong)0]->connections()); } Components::ReceptacleDescriptions * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_all_receptacles () { Components::NameList _allnames; _allnames.length (1); _allnames[0] = CORBA::string_dup ("handelsplatz"); return get_named_receptacles (_allnames); } Components::ReceptacleDescriptions * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_named_receptacles (const Components::NameList & _names) { Components::ReceptacleDescriptions_var _res = new Components::ReceptacleDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { if (strcmp (_names[_idx].in(), "handelsplatz") == 0) { _res[_idx] = new MICO::CCM::ReceptacleDescription_impl; _res[_idx]->name ((const char *) "handelsplatz"); _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/VersteigerungsFabrik:1.0"); _res[_idx]->is_multiplex (0); if (!CORBA::is_nil (_for_recep_handelsplatz)) { _res[_idx]->connections().length(1); _res[_idx]->connections()[0] = new MICO::CCM::ConnectionDescription_impl; _res[_idx]->connections()[0]->ck (0); _res[_idx]->connections()[0]->objref (_for_recep_handelsplatz); } continue; } throw Components::InvalidName(); } return _res._retn(); } /* * Inherited Events interface */ Components::EventConsumerBase_ptr MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_consumer (const char * _name) { if (strcmp (_name, "zuschlag") == 0) { return get_consumer_zuschlag (); } throw Components::InvalidName(); return Components::EventConsumerBase::_nil (); } Components::ConsumerDescriptions * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_all_consumers () { Components::NameList _allnames; _allnames.length (1); _allnames[0] = CORBA::string_dup ("zuschlag"); return get_named_consumers (_allnames); } Components::ConsumerDescriptions * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_named_consumers (const Components::NameList & _names) { Components::ConsumerDescriptions_var _res = new Components::ConsumerDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { if (strcmp (_names[_idx].in(), "zuschlag") == 0) { _res[_idx] = new MICO::CCM::ConsumerDescription_impl; _res[_idx]->name ((const char *) "zuschlag"); _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Kauf:1.0"); Components::EventConsumerBase_var _tmp = get_consumer ("zuschlag"); _res[_idx]->consumer (_tmp); continue; } throw Components::InvalidName(); } return _res._retn(); } Components::Cookie * MICO_CCM_impls:: Auktion_Verkaeufer_impl::subscribe (const char * _name, Components::EventConsumerBase_ptr _ref) { throw Components::InvalidName(); return new MICO::CCM::Cookie_impl; } void MICO_CCM_impls:: Auktion_Verkaeufer_impl::unsubscribe (const char * _name, Components::Cookie * _ck) { throw Components::InvalidName(); } Components::PublisherDescriptions * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_all_publishers () { Components::NameList _allnames; _allnames.length (0); return get_named_publishers (_allnames); } Components::PublisherDescriptions * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_named_publishers (const Components::NameList & _names) { Components::PublisherDescriptions_var _res = new Components::PublisherDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } void MICO_CCM_impls:: Auktion_Verkaeufer_impl::connect_consumer (const char * _name, Components::EventConsumerBase_ptr _ref) { throw Components::InvalidName(); } Components::EventConsumerBase_ptr MICO_CCM_impls:: Auktion_Verkaeufer_impl::disconnect_consumer (const char * _name) { throw Components::InvalidName(); } Components::EmitterDescriptions * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_all_emitters () { Components::NameList _allnames; _allnames.length (0); return get_named_emitters (_allnames); } Components::EmitterDescriptions * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_named_emitters (const Components::NameList & _names) { Components::EmitterDescriptions_var _res = new Components::EmitterDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } /* * Inherited CCMObject interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_component_def () { return CORBA::Object::_nil (); } Components::CCMHome_ptr MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_ccm_home () { return _container->get_reference_for_home (); } void MICO_CCM_impls:: Auktion_Verkaeufer_impl::configuration_complete () { _container->configuration_complete (this); Components::SessionComponent_ptr _sc = Components::SessionComponent::_narrow (_instance); if (!CORBA::is_nil (_sc)) { _sc->set_session_context (_context); _sc->ccm_activate (); } } Components::ComponentPortDescription * MICO_CCM_impls:: Auktion_Verkaeufer_impl::get_all_ports () { Components::FacetDescriptions_var _fds = get_all_facets (); Components::ReceptacleDescriptions_var _rds = get_all_receptacles (); Components::ConsumerDescriptions_var _cds = get_all_consumers (); Components::EmitterDescriptions_var _eds = get_all_emitters (); Components::PublisherDescriptions_var _pds = get_all_publishers (); Components::ComponentPortDescription_var _cpd = new MICO::CCM::ComponentPortDescription_impl; _cpd->facets (_fds.in()); _cpd->receptacles (_rds.in()); _cpd->consumers (_cds.in()); _cpd->emitters (_eds.in()); _cpd->publishers (_pds.in()); return _cpd._retn(); } void MICO_CCM_impls:: Auktion_Verkaeufer_impl::remove () { Components::CCMHome_var myhome = get_ccm_home (); Components::CCMObject_var myself = _container->get_reference_for_component (this); myhome->remove_component (myself); } /* * Overload default implementation */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_Verkaeufer_impl::_get_component () { return _container->get_reference_for_component (this); } /* * Glue class for consumer zuschlag of component Auktion::Verkaeufer * type Auktion::Kauf */ MICO_CCM_impls:: Auktion_Verkaeufer_zuschlag_impl::Auktion_Verkaeufer_zuschlag_impl (Auktion_Verkaeufer_impl * _g) { _glue = _g; } MICO_CCM_impls:: Auktion_Verkaeufer_zuschlag_impl::~Auktion_Verkaeufer_zuschlag_impl () { } void MICO_CCM_impls:: Auktion_Verkaeufer_zuschlag_impl::push_event (Components::EventBase * ev) { Auktion::Kauf * tev = Auktion::Kauf::_downcast (ev); if (tev == 0 && ev != 0) { throw Components::BadEventType ((const char *) "Auktion::Kauf"); } push_Kauf (tev); } void MICO_CCM_impls:: Auktion_Verkaeufer_zuschlag_impl::push_Kauf (Auktion::Kauf * tev) { _glue->_instance->push_zuschlag (tev); } /* * Context class for component Auktion::Verkaeufer */ MICO_CCM_impls:: Auktion_Verkaeufer_Context_impl::Auktion_Verkaeufer_Context_impl (Auktion_Verkaeufer_impl * _g, MICO::CCM::SessionContainer * _c) { _glue = _g; _container = _c; } MICO_CCM_impls:: Auktion_Verkaeufer_Context_impl::~Auktion_Verkaeufer_Context_impl () { } Auktion::VersteigerungsFabrik_ptr MICO_CCM_impls:: Auktion_Verkaeufer_Context_impl::get_connection_handelsplatz () { return _glue->get_connection_handelsplatz (); } Components::CCMHome_ptr MICO_CCM_impls:: Auktion_Verkaeufer_Context_impl::get_CCM_home () { return _container->get_CCM_home (); } CORBA::Object_ptr MICO_CCM_impls:: Auktion_Verkaeufer_Context_impl::get_CCM_object () { return _container->get_CCM_object (_glue->_instance); } /* * Glue class for component Auktion::Auktionshaus */ MICO_CCM_impls:: Auktion_Auktionshaus_impl::Auktion_Auktionshaus_impl (Auktion::CCM_Auktionshaus * i, MICO::CCM::SessionContainer * c) : _instance (i), _container (c) { _context = new Auktion_Auktionshaus_Context_impl (this, c); _glue_for_facet_auktionen = 0; _instance_for_facet_auktionen = Auktion::CCM_VersteigerungsFabrik::_nil (); _cookie_for_gebote = 0; } MICO_CCM_impls:: Auktion_Auktionshaus_impl::~Auktion_Auktionshaus_impl () { delete _instance; delete _context; } /* * Component Attributes */ /* * Supported Interfaces */ /* * Equivalent IDL methods */ // facets Auktion::VersteigerungsFabrik_ptr MICO_CCM_impls:: Auktion_Auktionshaus_impl::provide_auktionen () { if (CORBA::is_nil (_instance_for_facet_auktionen)) { _instance_for_facet_auktionen = _instance->get_auktionen (); } if (_glue_for_facet_auktionen.in() == 0) { _glue_for_facet_auktionen = new Auktion_Auktionshaus_auktionen_impl (this); CORBA::Object_var _facet_ref = _container->activate_facet (this, "auktionen", _instance_for_facet_auktionen, _glue_for_facet_auktionen); _reference_for_facet_auktionen = Auktion::VersteigerungsFabrik::_narrow (_facet_ref); } return Auktion::VersteigerungsFabrik::_duplicate (_reference_for_facet_auktionen); } // no receptacles // publishers Components::Cookie * MICO_CCM_impls:: Auktion_Auktionshaus_impl::subscribe_gebote (::Auktion::GebotConsumer_ptr consumer) { Components::Cookie_var _ck = new MICO::CCM::Cookie_impl; _ck->CookieValue().replace (sizeof (CORBA::ULong), sizeof (CORBA::ULong), (CORBA::Octet *) &_cookie_for_gebote); _cookie_for_gebote++; CORBA::ULong _idx = _for_publisher_gebote.length (); _for_publisher_gebote.length (_idx + 1); _for_publisher_gebote[_idx] = new MICO::CCM::SubscriberDescription_impl; _for_publisher_gebote[_idx]->ck (_ck); _for_publisher_gebote[_idx]->consumer (consumer); return _ck._retn(); } ::Auktion::GebotConsumer_ptr MICO_CCM_impls:: Auktion_Auktionshaus_impl::unsubscribe_gebote (Components::Cookie * _value) { CORBA::ULong _idx, _ck1, _ck2; if (!_value || _value->CookieValue().length() != sizeof (CORBA::ULong)) { throw Components::InvalidConnection(); } _ck1 = * ((CORBA::ULong *) _value->CookieValue().get_buffer()); for (_idx=0; _idx<_for_publisher_gebote.length(); _idx++) { _ck2 = * ((CORBA::ULong *) _for_publisher_gebote[_idx]->ck()->CookieValue().get_buffer()); if (_ck1 == _ck2) break; } if (_idx == _for_publisher_gebote.length()) { throw Components::InvalidConnection(); } ::Auktion::GebotConsumer_var _res = ::Auktion::GebotConsumer::_narrow (_for_publisher_gebote[_idx]->consumer()); for (;_idx<_for_publisher_gebote.length()-1; _idx++) { _for_publisher_gebote[_idx] = _for_publisher_gebote[_idx+1]; } _for_publisher_gebote.length (_idx); return _res._retn(); } // no emitters // no consumers /* * Inherited Navigation interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_Auktionshaus_impl::provide_facet (const char * _name) { if (strcmp (_name, "auktionen") == 0) { return provide_auktionen (); } throw Components::InvalidName(); return CORBA::Object::_nil (); } Components::FacetDescriptions * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_all_facets () { Components::NameList _allnames; _allnames.length (1); _allnames[0] = CORBA::string_dup ("auktionen"); return get_named_facets (_allnames); } Components::FacetDescriptions * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_named_facets (const Components::NameList & _names) { Components::FacetDescriptions_var _res = new Components::FacetDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { if (strcmp (_names[_idx].in(), "auktionen") == 0) { _res[_idx] = new MICO::CCM::FacetDescription_impl; _res[_idx]->name ((const char *) "auktionen"); _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/VersteigerungsFabrik:1.0"); _res[_idx]->facet_ref (provide_facet ("auktionen")); continue; } throw Components::InvalidName(); } return _res._retn(); } CORBA::Boolean MICO_CCM_impls:: Auktion_Auktionshaus_impl::same_component (CORBA::Object_ptr _ref) { return 0; } /* * Inherited Receptacles interface */ Components::Cookie * MICO_CCM_impls:: Auktion_Auktionshaus_impl::connect (const char * _name, CORBA::Object_ptr _ref) { throw Components::InvalidName(); return new MICO::CCM::Cookie_impl; } void MICO_CCM_impls:: Auktion_Auktionshaus_impl::disconnect (const char * _name, Components::Cookie * _ck) { throw Components::InvalidName(); } Components::ConnectionDescriptions * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_connections (const char * _name) { Components::NameList _thename (1); _thename[0] = _name; Components::ReceptacleDescriptions_var _rdv = get_named_receptacles (_thename); return new Components::ConnectionDescriptions (_rdv[(CORBA::ULong)0]->connections()); } Components::ReceptacleDescriptions * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_all_receptacles () { Components::NameList _allnames; _allnames.length (0); return get_named_receptacles (_allnames); } Components::ReceptacleDescriptions * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_named_receptacles (const Components::NameList & _names) { Components::ReceptacleDescriptions_var _res = new Components::ReceptacleDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } /* * Inherited Events interface */ Components::EventConsumerBase_ptr MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_consumer (const char * _name) { throw Components::InvalidName(); return Components::EventConsumerBase::_nil (); } Components::ConsumerDescriptions * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_all_consumers () { Components::NameList _allnames; _allnames.length (0); return get_named_consumers (_allnames); } Components::ConsumerDescriptions * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_named_consumers (const Components::NameList & _names) { Components::ConsumerDescriptions_var _res = new Components::ConsumerDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } Components::Cookie * MICO_CCM_impls:: Auktion_Auktionshaus_impl::subscribe (const char * _name, Components::EventConsumerBase_ptr _ref) { if (strcmp (_name, "gebote") == 0) { ::Auktion::GebotConsumer_var _tref = ::Auktion::GebotConsumer::_narrow (_ref); if (CORBA::is_nil (_tref) && !CORBA::is_nil (_ref)) { throw Components::InvalidConnection(); } return subscribe_gebote (_tref); } throw Components::InvalidName(); return new MICO::CCM::Cookie_impl; } void MICO_CCM_impls:: Auktion_Auktionshaus_impl::unsubscribe (const char * _name, Components::Cookie * _ck) { if (strcmp (_name, "gebote") == 0) { Components::EventConsumerBase_var _dummy; _dummy = unsubscribe_gebote (_ck); return; } throw Components::InvalidName(); } Components::PublisherDescriptions * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_all_publishers () { Components::NameList _allnames; _allnames.length (1); _allnames[0] = CORBA::string_dup ("gebote"); return get_named_publishers (_allnames); } Components::PublisherDescriptions * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_named_publishers (const Components::NameList & _names) { Components::PublisherDescriptions_var _res = new Components::PublisherDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { if (strcmp (_names[_idx].in(), "gebote") == 0) { _res[_idx] = new MICO::CCM::PublisherDescription_impl; _res[_idx]->name ((const char *) "gebote"); _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Gebot:1.0"); _res[_idx]->consumers (_for_publisher_gebote); continue; } throw Components::InvalidName(); } return _res._retn(); } void MICO_CCM_impls:: Auktion_Auktionshaus_impl::connect_consumer (const char * _name, Components::EventConsumerBase_ptr _ref) { throw Components::InvalidName(); } Components::EventConsumerBase_ptr MICO_CCM_impls:: Auktion_Auktionshaus_impl::disconnect_consumer (const char * _name) { throw Components::InvalidName(); } Components::EmitterDescriptions * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_all_emitters () { Components::NameList _allnames; _allnames.length (0); return get_named_emitters (_allnames); } Components::EmitterDescriptions * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_named_emitters (const Components::NameList & _names) { Components::EmitterDescriptions_var _res = new Components::EmitterDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } /* * Inherited CCMObject interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_component_def () { return CORBA::Object::_nil (); } Components::CCMHome_ptr MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_ccm_home () { return _container->get_reference_for_home (); } void MICO_CCM_impls:: Auktion_Auktionshaus_impl::configuration_complete () { _container->configuration_complete (this); Components::SessionComponent_ptr _sc = Components::SessionComponent::_narrow (_instance); if (!CORBA::is_nil (_sc)) { _sc->set_session_context (_context); _sc->ccm_activate (); } } Components::ComponentPortDescription * MICO_CCM_impls:: Auktion_Auktionshaus_impl::get_all_ports () { Components::FacetDescriptions_var _fds = get_all_facets (); Components::ReceptacleDescriptions_var _rds = get_all_receptacles (); Components::ConsumerDescriptions_var _cds = get_all_consumers (); Components::EmitterDescriptions_var _eds = get_all_emitters (); Components::PublisherDescriptions_var _pds = get_all_publishers (); Components::ComponentPortDescription_var _cpd = new MICO::CCM::ComponentPortDescription_impl; _cpd->facets (_fds.in()); _cpd->receptacles (_rds.in()); _cpd->consumers (_cds.in()); _cpd->emitters (_eds.in()); _cpd->publishers (_pds.in()); return _cpd._retn(); } void MICO_CCM_impls:: Auktion_Auktionshaus_impl::remove () { Components::CCMHome_var myhome = get_ccm_home (); Components::CCMObject_var myself = _container->get_reference_for_component (this); myhome->remove_component (myself); } /* * Overload default implementation */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_Auktionshaus_impl::_get_component () { return _container->get_reference_for_component (this); } /* * Glue class for facet auktionen of component Auktion::Auktionshaus * type Auktion::VersteigerungsFabrik */ MICO_CCM_impls:: Auktion_Auktionshaus_auktionen_impl::Auktion_Auktionshaus_auktionen_impl (Auktion_Auktionshaus_impl * _g) { _glue = _g; } MICO_CCM_impls:: Auktion_Auktionshaus_auktionen_impl::~Auktion_Auktionshaus_auktionen_impl () { } /* * Attributes */ /* * Operations */ Auktion::Versteigerung_ptr MICO_CCM_impls:: Auktion_Auktionshaus_auktionen_impl::neue_auktion (const char* name, CORBA::Long minimalgebot, Auktion::Verkaeufer_ptr besitzer) { return _glue->_instance_for_facet_auktionen->neue_auktion (name, minimalgebot, besitzer); } /* * Overload default implementation */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_Auktionshaus_auktionen_impl::_get_component () { return _glue->_container->get_reference_for_component (_glue); } /* * Context class for component Auktion::Auktionshaus */ MICO_CCM_impls:: Auktion_Auktionshaus_Context_impl::Auktion_Auktionshaus_Context_impl (Auktion_Auktionshaus_impl * _g, MICO::CCM::SessionContainer * _c) { _glue = _g; _container = _c; } MICO_CCM_impls:: Auktion_Auktionshaus_Context_impl::~Auktion_Auktionshaus_Context_impl () { } void MICO_CCM_impls:: Auktion_Auktionshaus_Context_impl::push_gebote (::Auktion::Gebot * ev) { for (CORBA::ULong idx=0; idx<_glue->_for_publisher_gebote.length(); idx++) { try { _glue->_for_publisher_gebote[idx]->consumer()->push_event (ev); } catch (...) { } } } Components::CCMHome_ptr MICO_CCM_impls:: Auktion_Auktionshaus_Context_impl::get_CCM_home () { return _container->get_CCM_home (); } CORBA::Object_ptr MICO_CCM_impls:: Auktion_Auktionshaus_Context_impl::get_CCM_object () { return _container->get_CCM_object (_glue->_instance); } /* * Glue class for home Auktion::Welt */ MICO_CCM_impls:: Auktion_Welt_impl::Auktion_Welt_impl (Auktion::CCM_Welt * i, MICO::CCM::SessionContainer * c) : _instance (i), _container (c) { } MICO_CCM_impls:: Auktion_Welt_impl::~Auktion_Welt_impl () { delete _instance; } /* * Implicit operations */ Auktion::Auktionshaus_ptr MICO_CCM_impls:: Auktion_Welt_impl::create () { Components::EnterpriseComponent_var _ci = _instance->create (); Auktion::CCM_Auktionshaus_ptr _ti = Auktion::CCM_Auktionshaus::_narrow (_ci); PortableServer::ServantBase_var _cs = new Auktion_Auktionshaus_impl (_ti, _container); Components::CCMObject_var _co = _container->activate_component (_ti, _cs.in()); return Auktion::Auktionshaus::_narrow (_co); } /* * Explicit operations */ // no factories // no finders // no attributes // no operations /* * Inherited CCMHome interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_Welt_impl::get_component_def () { return CORBA::Object::_nil (); } CORBA::Object_ptr MICO_CCM_impls:: Auktion_Welt_impl::get_home_def () { return CORBA::Object::_nil (); } void MICO_CCM_impls:: Auktion_Welt_impl::remove_component (Components::CCMObject_ptr _co) { PortableServer::ServantBase_var _cs = _container->get_skeleton_for_reference (_co); CORBA::LocalObject_var _ci = _container->get_instance_for_component (_cs.in()); Auktion::CCM_Auktionshaus_var _cti = Auktion::CCM_Auktionshaus::_narrow (_ci.in()); Components::SessionComponent_var _sc = Components::SessionComponent::_narrow (_ci); if (!CORBA::is_nil (_sc)) { _sc->ccm_passivate (); _sc->ccm_remove (); } _container->deactivate_component (_cs); } /* * Inherited KeylessCCMHome interface */ Components::CCMObject_ptr MICO_CCM_impls:: Auktion_Welt_impl::create_component () { return create (); } /* * Glue class for component Auktion::ProduktFilter */ MICO_CCM_impls:: Auktion_ProduktFilter_impl::Auktion_ProduktFilter_impl (Auktion::CCM_ProduktFilter * i, MICO::CCM::SessionContainer * c) : _instance (i), _container (c) { _context = new Auktion_ProduktFilter_Context_impl (this, c); _cookie_for_interessante_gebote = 0; } MICO_CCM_impls:: Auktion_ProduktFilter_impl::~Auktion_ProduktFilter_impl () { delete _instance; delete _context; } /* * Component Attributes */ char* MICO_CCM_impls:: Auktion_ProduktFilter_impl::interessanter_gegenstand () { return _instance->interessanter_gegenstand (); } void MICO_CCM_impls:: Auktion_ProduktFilter_impl::interessanter_gegenstand (const char* _value) { _instance->interessanter_gegenstand (_value); } /* * Supported Interfaces */ /* * Equivalent IDL methods */ // no facets // no receptacles // publishers Components::Cookie * MICO_CCM_impls:: Auktion_ProduktFilter_impl::subscribe_interessante_gebote (::Auktion::GebotConsumer_ptr consumer) { Components::Cookie_var _ck = new MICO::CCM::Cookie_impl; _ck->CookieValue().replace (sizeof (CORBA::ULong), sizeof (CORBA::ULong), (CORBA::Octet *) &_cookie_for_interessante_gebote); _cookie_for_interessante_gebote++; CORBA::ULong _idx = _for_publisher_interessante_gebote.length (); _for_publisher_interessante_gebote.length (_idx + 1); _for_publisher_interessante_gebote[_idx] = new MICO::CCM::SubscriberDescription_impl; _for_publisher_interessante_gebote[_idx]->ck (_ck); _for_publisher_interessante_gebote[_idx]->consumer (consumer); return _ck._retn(); } ::Auktion::GebotConsumer_ptr MICO_CCM_impls:: Auktion_ProduktFilter_impl::unsubscribe_interessante_gebote (Components::Cookie * _value) { CORBA::ULong _idx, _ck1, _ck2; if (!_value || _value->CookieValue().length() != sizeof (CORBA::ULong)) { throw Components::InvalidConnection(); } _ck1 = * ((CORBA::ULong *) _value->CookieValue().get_buffer()); for (_idx=0; _idx<_for_publisher_interessante_gebote.length(); _idx++) { _ck2 = * ((CORBA::ULong *) _for_publisher_interessante_gebote[_idx]->ck()->CookieValue().get_buffer()); if (_ck1 == _ck2) break; } if (_idx == _for_publisher_interessante_gebote.length()) { throw Components::InvalidConnection(); } ::Auktion::GebotConsumer_var _res = ::Auktion::GebotConsumer::_narrow (_for_publisher_interessante_gebote[_idx]->consumer()); for (;_idx<_for_publisher_interessante_gebote.length()-1; _idx++) { _for_publisher_interessante_gebote[_idx] = _for_publisher_interessante_gebote[_idx+1]; } _for_publisher_interessante_gebote.length (_idx); return _res._retn(); } // no emitters // consumers ::Auktion::GebotConsumer_ptr MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_consumer_eingehende_gebote () { if (CORBA::is_nil (_for_consumer_eingehende_gebote)) { PortableServer::ServantBase_var _consumer_servant = new Auktion_ProduktFilter_eingehende_gebote_impl (this); CORBA::Object_var _ref = _container->activate_facet (this, "eingehende_gebote", CORBA::LocalObject::_nil(), _consumer_servant); _for_consumer_eingehende_gebote = ::Auktion::GebotConsumer::_narrow (_ref); } return ::Auktion::GebotConsumer::_duplicate (_for_consumer_eingehende_gebote); } /* * Inherited Navigation interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_ProduktFilter_impl::provide_facet (const char * _name) { throw Components::InvalidName(); return CORBA::Object::_nil (); } Components::FacetDescriptions * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_all_facets () { Components::NameList _allnames; _allnames.length (0); return get_named_facets (_allnames); } Components::FacetDescriptions * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_named_facets (const Components::NameList & _names) { Components::FacetDescriptions_var _res = new Components::FacetDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } CORBA::Boolean MICO_CCM_impls:: Auktion_ProduktFilter_impl::same_component (CORBA::Object_ptr _ref) { return 0; } /* * Inherited Receptacles interface */ Components::Cookie * MICO_CCM_impls:: Auktion_ProduktFilter_impl::connect (const char * _name, CORBA::Object_ptr _ref) { throw Components::InvalidName(); return new MICO::CCM::Cookie_impl; } void MICO_CCM_impls:: Auktion_ProduktFilter_impl::disconnect (const char * _name, Components::Cookie * _ck) { throw Components::InvalidName(); } Components::ConnectionDescriptions * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_connections (const char * _name) { Components::NameList _thename (1); _thename[0] = _name; Components::ReceptacleDescriptions_var _rdv = get_named_receptacles (_thename); return new Components::ConnectionDescriptions (_rdv[(CORBA::ULong)0]->connections()); } Components::ReceptacleDescriptions * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_all_receptacles () { Components::NameList _allnames; _allnames.length (0); return get_named_receptacles (_allnames); } Components::ReceptacleDescriptions * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_named_receptacles (const Components::NameList & _names) { Components::ReceptacleDescriptions_var _res = new Components::ReceptacleDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } /* * Inherited Events interface */ Components::EventConsumerBase_ptr MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_consumer (const char * _name) { if (strcmp (_name, "eingehende_gebote") == 0) { return get_consumer_eingehende_gebote (); } throw Components::InvalidName(); return Components::EventConsumerBase::_nil (); } Components::ConsumerDescriptions * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_all_consumers () { Components::NameList _allnames; _allnames.length (1); _allnames[0] = CORBA::string_dup ("eingehende_gebote"); return get_named_consumers (_allnames); } Components::ConsumerDescriptions * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_named_consumers (const Components::NameList & _names) { Components::ConsumerDescriptions_var _res = new Components::ConsumerDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { if (strcmp (_names[_idx].in(), "eingehende_gebote") == 0) { _res[_idx] = new MICO::CCM::ConsumerDescription_impl; _res[_idx]->name ((const char *) "eingehende_gebote"); _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Gebot:1.0"); Components::EventConsumerBase_var _tmp = get_consumer ("eingehende_gebote"); _res[_idx]->consumer (_tmp); continue; } throw Components::InvalidName(); } return _res._retn(); } Components::Cookie * MICO_CCM_impls:: Auktion_ProduktFilter_impl::subscribe (const char * _name, Components::EventConsumerBase_ptr _ref) { if (strcmp (_name, "interessante_gebote") == 0) { ::Auktion::GebotConsumer_var _tref = ::Auktion::GebotConsumer::_narrow (_ref); if (CORBA::is_nil (_tref) && !CORBA::is_nil (_ref)) { throw Components::InvalidConnection(); } return subscribe_interessante_gebote (_tref); } throw Components::InvalidName(); return new MICO::CCM::Cookie_impl; } void MICO_CCM_impls:: Auktion_ProduktFilter_impl::unsubscribe (const char * _name, Components::Cookie * _ck) { if (strcmp (_name, "interessante_gebote") == 0) { Components::EventConsumerBase_var _dummy; _dummy = unsubscribe_interessante_gebote (_ck); return; } throw Components::InvalidName(); } Components::PublisherDescriptions * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_all_publishers () { Components::NameList _allnames; _allnames.length (1); _allnames[0] = CORBA::string_dup ("interessante_gebote"); return get_named_publishers (_allnames); } Components::PublisherDescriptions * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_named_publishers (const Components::NameList & _names) { Components::PublisherDescriptions_var _res = new Components::PublisherDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { if (strcmp (_names[_idx].in(), "interessante_gebote") == 0) { _res[_idx] = new MICO::CCM::PublisherDescription_impl; _res[_idx]->name ((const char *) "interessante_gebote"); _res[_idx]->type_id ((const char *) "IDL:r4/Auktion/Gebot:1.0"); _res[_idx]->consumers (_for_publisher_interessante_gebote); continue; } throw Components::InvalidName(); } return _res._retn(); } void MICO_CCM_impls:: Auktion_ProduktFilter_impl::connect_consumer (const char * _name, Components::EventConsumerBase_ptr _ref) { throw Components::InvalidName(); } Components::EventConsumerBase_ptr MICO_CCM_impls:: Auktion_ProduktFilter_impl::disconnect_consumer (const char * _name) { throw Components::InvalidName(); } Components::EmitterDescriptions * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_all_emitters () { Components::NameList _allnames; _allnames.length (0); return get_named_emitters (_allnames); } Components::EmitterDescriptions * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_named_emitters (const Components::NameList & _names) { Components::EmitterDescriptions_var _res = new Components::EmitterDescriptions; _res->length (_names.length()); for (CORBA::ULong _idx=0; _idx<_names.length(); _idx++) { throw Components::InvalidName(); } return _res._retn(); } /* * Inherited CCMObject interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_component_def () { return CORBA::Object::_nil (); } Components::CCMHome_ptr MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_ccm_home () { return _container->get_reference_for_home (); } void MICO_CCM_impls:: Auktion_ProduktFilter_impl::configuration_complete () { _container->configuration_complete (this); Components::SessionComponent_ptr _sc = Components::SessionComponent::_narrow (_instance); if (!CORBA::is_nil (_sc)) { _sc->set_session_context (_context); _sc->ccm_activate (); } } Components::ComponentPortDescription * MICO_CCM_impls:: Auktion_ProduktFilter_impl::get_all_ports () { Components::FacetDescriptions_var _fds = get_all_facets (); Components::ReceptacleDescriptions_var _rds = get_all_receptacles (); Components::ConsumerDescriptions_var _cds = get_all_consumers (); Components::EmitterDescriptions_var _eds = get_all_emitters (); Components::PublisherDescriptions_var _pds = get_all_publishers (); Components::ComponentPortDescription_var _cpd = new MICO::CCM::ComponentPortDescription_impl; _cpd->facets (_fds.in()); _cpd->receptacles (_rds.in()); _cpd->consumers (_cds.in()); _cpd->emitters (_eds.in()); _cpd->publishers (_pds.in()); return _cpd._retn(); } void MICO_CCM_impls:: Auktion_ProduktFilter_impl::remove () { Components::CCMHome_var myhome = get_ccm_home (); Components::CCMObject_var myself = _container->get_reference_for_component (this); myhome->remove_component (myself); } /* * Overload default implementation */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_ProduktFilter_impl::_get_component () { return _container->get_reference_for_component (this); } /* * Glue class for consumer eingehende_gebote of component Auktion::ProduktFilter * type Auktion::Gebot */ MICO_CCM_impls:: Auktion_ProduktFilter_eingehende_gebote_impl::Auktion_ProduktFilter_eingehende_gebote_impl (Auktion_ProduktFilter_impl * _g) { _glue = _g; } MICO_CCM_impls:: Auktion_ProduktFilter_eingehende_gebote_impl::~Auktion_ProduktFilter_eingehende_gebote_impl () { } void MICO_CCM_impls:: Auktion_ProduktFilter_eingehende_gebote_impl::push_event (Components::EventBase * ev) { Auktion::Gebot * tev = Auktion::Gebot::_downcast (ev); if (tev == 0 && ev != 0) { throw Components::BadEventType ((const char *) "Auktion::Gebot"); } push_Gebot (tev); } void MICO_CCM_impls:: Auktion_ProduktFilter_eingehende_gebote_impl::push_Gebot (Auktion::Gebot * tev) { _glue->_instance->push_eingehende_gebote (tev); } /* * Context class for component Auktion::ProduktFilter */ MICO_CCM_impls:: Auktion_ProduktFilter_Context_impl::Auktion_ProduktFilter_Context_impl (Auktion_ProduktFilter_impl * _g, MICO::CCM::SessionContainer * _c) { _glue = _g; _container = _c; } MICO_CCM_impls:: Auktion_ProduktFilter_Context_impl::~Auktion_ProduktFilter_Context_impl () { } void MICO_CCM_impls:: Auktion_ProduktFilter_Context_impl::push_interessante_gebote (::Auktion::Gebot * ev) { for (CORBA::ULong idx=0; idx<_glue->_for_publisher_interessante_gebote.length(); idx++) { try { _glue->_for_publisher_interessante_gebote[idx]->consumer()->push_event (ev); } catch (...) { } } } Components::CCMHome_ptr MICO_CCM_impls:: Auktion_ProduktFilter_Context_impl::get_CCM_home () { return _container->get_CCM_home (); } CORBA::Object_ptr MICO_CCM_impls:: Auktion_ProduktFilter_Context_impl::get_CCM_object () { return _container->get_CCM_object (_glue->_instance); } /* * Glue class for home Auktion::FilterHome */ MICO_CCM_impls:: Auktion_FilterHome_impl::Auktion_FilterHome_impl (Auktion::CCM_FilterHome * i, MICO::CCM::SessionContainer * c) : _instance (i), _container (c) { } MICO_CCM_impls:: Auktion_FilterHome_impl::~Auktion_FilterHome_impl () { delete _instance; } /* * Implicit operations */ Auktion::ProduktFilter_ptr MICO_CCM_impls:: Auktion_FilterHome_impl::create () { Components::EnterpriseComponent_var _ci = _instance->create (); Auktion::CCM_ProduktFilter_ptr _ti = Auktion::CCM_ProduktFilter::_narrow (_ci); PortableServer::ServantBase_var _cs = new Auktion_ProduktFilter_impl (_ti, _container); Components::CCMObject_var _co = _container->activate_component (_ti, _cs.in()); return Auktion::ProduktFilter::_narrow (_co); } /* * Explicit operations */ // factories Auktion::ProduktFilter_ptr MICO_CCM_impls:: Auktion_FilterHome_impl::new_filter (const char* gegenstand) { Components::EnterpriseComponent_ptr _ci = _instance->new_filter (gegenstand); Auktion::CCM_ProduktFilter_var _ti = Auktion::CCM_ProduktFilter::_narrow (_ci); PortableServer::ServantBase_var _cs = new Auktion_ProduktFilter_impl (_ti, _container); Components::CCMObject_var _co = _container->activate_component (_ti, _cs.in()); return Auktion::ProduktFilter::_narrow (_co); } // no finders // no attributes // no operations /* * Inherited CCMHome interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_FilterHome_impl::get_component_def () { return CORBA::Object::_nil (); } CORBA::Object_ptr MICO_CCM_impls:: Auktion_FilterHome_impl::get_home_def () { return CORBA::Object::_nil (); } void MICO_CCM_impls:: Auktion_FilterHome_impl::remove_component (Components::CCMObject_ptr _co) { PortableServer::ServantBase_var _cs = _container->get_skeleton_for_reference (_co); CORBA::LocalObject_var _ci = _container->get_instance_for_component (_cs.in()); Auktion::CCM_ProduktFilter_var _cti = Auktion::CCM_ProduktFilter::_narrow (_ci.in()); Components::SessionComponent_var _sc = Components::SessionComponent::_narrow (_ci); if (!CORBA::is_nil (_sc)) { _sc->ccm_passivate (); _sc->ccm_remove (); } _container->deactivate_component (_cs); } /* * Inherited KeylessCCMHome interface */ Components::CCMObject_ptr MICO_CCM_impls:: Auktion_FilterHome_impl::create_component () { return create (); } /* * Glue class for home Auktion::BieterHome */ MICO_CCM_impls:: Auktion_BieterHome_impl::Auktion_BieterHome_impl (Auktion::CCM_BieterHome * i, MICO::CCM::SessionContainer * c) : _instance (i), _container (c) { } MICO_CCM_impls:: Auktion_BieterHome_impl::~Auktion_BieterHome_impl () { delete _instance; } /* * Implicit operations */ Auktion::Bieter_ptr MICO_CCM_impls:: Auktion_BieterHome_impl::create () { Components::EnterpriseComponent_var _ci = _instance->create (); Auktion::CCM_Bieter_ptr _ti = Auktion::CCM_Bieter::_narrow (_ci); PortableServer::ServantBase_var _cs = new Auktion_Bieter_impl (_ti, _container); Components::CCMObject_var _co = _container->activate_component (_ti, _cs.in()); return Auktion::Bieter::_narrow (_co); } /* * Explicit operations */ // no factories // no finders // no attributes // no operations /* * Inherited CCMHome interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_BieterHome_impl::get_component_def () { return CORBA::Object::_nil (); } CORBA::Object_ptr MICO_CCM_impls:: Auktion_BieterHome_impl::get_home_def () { return CORBA::Object::_nil (); } void MICO_CCM_impls:: Auktion_BieterHome_impl::remove_component (Components::CCMObject_ptr _co) { PortableServer::ServantBase_var _cs = _container->get_skeleton_for_reference (_co); CORBA::LocalObject_var _ci = _container->get_instance_for_component (_cs.in()); Auktion::CCM_Bieter_var _cti = Auktion::CCM_Bieter::_narrow (_ci.in()); Components::SessionComponent_var _sc = Components::SessionComponent::_narrow (_ci); if (!CORBA::is_nil (_sc)) { _sc->ccm_passivate (); _sc->ccm_remove (); } _container->deactivate_component (_cs); } /* * Inherited KeylessCCMHome interface */ Components::CCMObject_ptr MICO_CCM_impls:: Auktion_BieterHome_impl::create_component () { return create (); } /* * Glue class for home Auktion::VerkaeuferHome */ MICO_CCM_impls:: Auktion_VerkaeuferHome_impl::Auktion_VerkaeuferHome_impl (Auktion::CCM_VerkaeuferHome * i, MICO::CCM::SessionContainer * c) : _instance (i), _container (c) { } MICO_CCM_impls:: Auktion_VerkaeuferHome_impl::~Auktion_VerkaeuferHome_impl () { delete _instance; } /* * Implicit operations */ Auktion::Verkaeufer_ptr MICO_CCM_impls:: Auktion_VerkaeuferHome_impl::create () { Components::EnterpriseComponent_var _ci = _instance->create (); Auktion::CCM_Verkaeufer_ptr _ti = Auktion::CCM_Verkaeufer::_narrow (_ci); PortableServer::ServantBase_var _cs = new Auktion_Verkaeufer_impl (_ti, _container); Components::CCMObject_var _co = _container->activate_component (_ti, _cs.in()); return Auktion::Verkaeufer::_narrow (_co); } /* * Explicit operations */ // no factories // no finders // no attributes // no operations /* * Inherited CCMHome interface */ CORBA::Object_ptr MICO_CCM_impls:: Auktion_VerkaeuferHome_impl::get_component_def () { return CORBA::Object::_nil (); } CORBA::Object_ptr MICO_CCM_impls:: Auktion_VerkaeuferHome_impl::get_home_def () { return CORBA::Object::_nil (); } void MICO_CCM_impls:: Auktion_VerkaeuferHome_impl::remove_component (Components::CCMObject_ptr _co) { PortableServer::ServantBase_var _cs = _container->get_skeleton_for_reference (_co); CORBA::LocalObject_var _ci = _container->get_instance_for_component (_cs.in()); Auktion::CCM_Verkaeufer_var _cti = Auktion::CCM_Verkaeufer::_narrow (_ci.in()); Components::SessionComponent_var _sc = Components::SessionComponent::_narrow (_ci); if (!CORBA::is_nil (_sc)) { _sc->ccm_passivate (); _sc->ccm_remove (); } _container->deactivate_component (_cs); } /* * Inherited KeylessCCMHome interface */ Components::CCMObject_ptr MICO_CCM_impls:: Auktion_VerkaeuferHome_impl::create_component () { return create (); } /* * Glue entry points for the container */ extern "C" { MICO::CCM::ContainerBase * deploy_Auktion_Welt (CORBA::ORB_ptr _orb, Components::HomeExecutorBase_ptr _he) { MICO::CCM::SessionContainer * _container = new MICO::CCM::SessionContainer (_orb); MICO::CCM::SessionContainer::ComponentInfo info; info.home_short_name = "Welt"; info.home_absolute_name = "::Auktion::Welt"; info.home_id = "IDL:r4/Auktion/Welt:1.0"; info.component_short_name = "Auktionshaus"; info.component_absolute_name = "::Auktion::Auktionshaus"; info.component_id = "IDL:r4/Auktion/Auktionshaus:1.0"; Auktion::CCM_Welt_ptr _hi = Auktion::CCM_Welt::_narrow (_he); info.home_instance = CORBA::LocalObject::_duplicate (_hi); info.home_glue = new MICO_CCM_impls::Auktion_Welt_impl (_hi, _container); _container->load (info); return _container; } } extern "C" { MICO::CCM::ContainerBase * deploy_Auktion_FilterHome (CORBA::ORB_ptr _orb, Components::HomeExecutorBase_ptr _he) { MICO::CCM::SessionContainer * _container = new MICO::CCM::SessionContainer (_orb); MICO::CCM::SessionContainer::ComponentInfo info; info.home_short_name = "FilterHome"; info.home_absolute_name = "::Auktion::FilterHome"; info.home_id = "IDL:r4/Auktion/FilterHome:1.0"; info.component_short_name = "ProduktFilter"; info.component_absolute_name = "::Auktion::ProduktFilter"; info.component_id = "IDL:r4/Auktion/ProduktFilter:1.0"; Auktion::CCM_FilterHome_ptr _hi = Auktion::CCM_FilterHome::_narrow (_he); info.home_instance = CORBA::LocalObject::_duplicate (_hi); info.home_glue = new MICO_CCM_impls::Auktion_FilterHome_impl (_hi, _container); _container->load (info); return _container; } } extern "C" { MICO::CCM::ContainerBase * deploy_Auktion_BieterHome (CORBA::ORB_ptr _orb, Components::HomeExecutorBase_ptr _he) { MICO::CCM::SessionContainer * _container = new MICO::CCM::SessionContainer (_orb); MICO::CCM::SessionContainer::ComponentInfo info; info.home_short_name = "BieterHome"; info.home_absolute_name = "::Auktion::BieterHome"; info.home_id = "IDL:r4/Auktion/BieterHome:1.0"; info.component_short_name = "Bieter"; info.component_absolute_name = "::Auktion::Bieter"; info.component_id = "IDL:r4/Auktion/Bieter:1.0"; Auktion::CCM_BieterHome_ptr _hi = Auktion::CCM_BieterHome::_narrow (_he); info.home_instance = CORBA::LocalObject::_duplicate (_hi); info.home_glue = new MICO_CCM_impls::Auktion_BieterHome_impl (_hi, _container); _container->load (info); return _container; } } extern "C" { MICO::CCM::ContainerBase * deploy_Auktion_VerkaeuferHome (CORBA::ORB_ptr _orb, Components::HomeExecutorBase_ptr _he) { MICO::CCM::SessionContainer * _container = new MICO::CCM::SessionContainer (_orb); MICO::CCM::SessionContainer::ComponentInfo info; info.home_short_name = "VerkaeuferHome"; info.home_absolute_name = "::Auktion::VerkaeuferHome"; info.home_id = "IDL:r4/Auktion/VerkaeuferHome:1.0"; info.component_short_name = "Verkaeufer"; info.component_absolute_name = "::Auktion::Verkaeufer"; info.component_id = "IDL:r4/Auktion/Verkaeufer:1.0"; Auktion::CCM_VerkaeuferHome_ptr _hi = Auktion::CCM_VerkaeuferHome::_narrow (_he); info.home_instance = CORBA::LocalObject::_duplicate (_hi); info.home_glue = new MICO_CCM_impls::Auktion_VerkaeuferHome_impl (_hi, _container); _container->load (info); return _container; } } /* * Default main for standalone program */ extern "C" { Components::HomeExecutorBase_ptr create_Auktion_Welt (CORBA::ORB_ptr); Components::HomeExecutorBase_ptr create_Auktion_FilterHome (CORBA::ORB_ptr); Components::HomeExecutorBase_ptr create_Auktion_BieterHome (CORBA::ORB_ptr); Components::HomeExecutorBase_ptr create_Auktion_VerkaeuferHome (CORBA::ORB_ptr); } int main (int argc, char * argv[]) { CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); MICO::CCM::register_all_factories (orb); string ior; string nsname; bool all = true; string homename; int arg; for (arg=1; arg [name]" << endl; cerr << "possible are:" << endl; cerr << " --ior " << endl; cerr << " --ns " << endl; cerr << " --help" << endl; cerr << "possible names are:" << endl; cerr << " Welt ::Auktion::Welt IDL:r4/Auktion/Welt:1.0" << endl; cerr << " FilterHome ::Auktion::FilterHome IDL:r4/Auktion/FilterHome:1.0" << endl; cerr << " BieterHome ::Auktion::BieterHome IDL:r4/Auktion/BieterHome:1.0" << endl; cerr << " VerkaeuferHome ::Auktion::VerkaeuferHome IDL:r4/Auktion/VerkaeuferHome:1.0" << endl; exit (1); } } if (arg < argc) { homename = argv[arg]; all = false; } CosNaming::NamingContextExt_var ns; CORBA::Object_var nsobj; try { nsobj = orb->resolve_initial_references ("NameService"); ns = CosNaming::NamingContextExt::_narrow (nsobj); } catch (...) { ns = CosNaming::NamingContextExt::_nil (); } if (CORBA::is_nil (ns) && (all || nsname.length() > 0)) { cerr << "Oops, I need a Naming Service." << endl; exit (1); } Components::HomeExecutorBase_var he; MICO::CCM::ContainerBase * c; Components::CCMHome_var hp; CosNaming::Name_var n; /* * Deploy ::Auktion::Welt */ if (all || strcmp (homename.c_str(), "Welt") == 0 || strcmp (homename.c_str(), "::Auktion::Welt") == 0 || strcmp (homename.c_str(), "IDL:r4/Auktion/Welt:1.0") == 0) { he = create_Auktion_Welt (orb); c = deploy_Auktion_Welt (orb, he); hp = c->get_CCM_home (); if (nsname.length() > 0) { n = ns->to_name (nsname.c_str()); ns->rebind (n.in(), hp.in()); } else if (all) { n = ns->to_name ("Welt"); ns->rebind (n.in(), hp.in()); } if (ior.length() > 0) { CORBA::String_var iorstr = orb->object_to_string (hp.in()); if (strcmp (ior.c_str(), "-") == 0) { cout << iorstr << endl; } else { ofstream out (ior.c_str()); out << iorstr << endl; } } c->activate (); } /* * Deploy ::Auktion::FilterHome */ if (all || strcmp (homename.c_str(), "FilterHome") == 0 || strcmp (homename.c_str(), "::Auktion::FilterHome") == 0 || strcmp (homename.c_str(), "IDL:r4/Auktion/FilterHome:1.0") == 0) { he = create_Auktion_FilterHome (orb); c = deploy_Auktion_FilterHome (orb, he); hp = c->get_CCM_home (); if (nsname.length() > 0) { n = ns->to_name (nsname.c_str()); ns->rebind (n.in(), hp.in()); } else if (all) { n = ns->to_name ("FilterHome"); ns->rebind (n.in(), hp.in()); } if (ior.length() > 0) { CORBA::String_var iorstr = orb->object_to_string (hp.in()); if (strcmp (ior.c_str(), "-") == 0) { cout << iorstr << endl; } else { ofstream out (ior.c_str()); out << iorstr << endl; } } c->activate (); } /* * Deploy ::Auktion::BieterHome */ if (all || strcmp (homename.c_str(), "BieterHome") == 0 || strcmp (homename.c_str(), "::Auktion::BieterHome") == 0 || strcmp (homename.c_str(), "IDL:r4/Auktion/BieterHome:1.0") == 0) { he = create_Auktion_BieterHome (orb); c = deploy_Auktion_BieterHome (orb, he); hp = c->get_CCM_home (); if (nsname.length() > 0) { n = ns->to_name (nsname.c_str()); ns->rebind (n.in(), hp.in()); } else if (all) { n = ns->to_name ("BieterHome"); ns->rebind (n.in(), hp.in()); } if (ior.length() > 0) { CORBA::String_var iorstr = orb->object_to_string (hp.in()); if (strcmp (ior.c_str(), "-") == 0) { cout << iorstr << endl; } else { ofstream out (ior.c_str()); out << iorstr << endl; } } c->activate (); } /* * Deploy ::Auktion::VerkaeuferHome */ if (all || strcmp (homename.c_str(), "VerkaeuferHome") == 0 || strcmp (homename.c_str(), "::Auktion::VerkaeuferHome") == 0 || strcmp (homename.c_str(), "IDL:r4/Auktion/VerkaeuferHome:1.0") == 0) { he = create_Auktion_VerkaeuferHome (orb); c = deploy_Auktion_VerkaeuferHome (orb, he); hp = c->get_CCM_home (); if (nsname.length() > 0) { n = ns->to_name (nsname.c_str()); ns->rebind (n.in(), hp.in()); } else if (all) { n = ns->to_name ("VerkaeuferHome"); ns->rebind (n.in(), hp.in()); } if (ior.length() > 0) { CORBA::String_var iorstr = orb->object_to_string (hp.in()); if (strcmp (ior.c_str(), "-") == 0) { cout << iorstr << endl; } else { ofstream out (ior.c_str()); out << iorstr << endl; } } c->activate (); } orb->run (); return 0; }