diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-14 02:20:00 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-14 02:20:00 +0000 |
commit | 780ad9d873d31132790eaf5c7009fb357006525c (patch) | |
tree | b20392b6021ebfd4e947c185144caa64137f4c33 | |
parent | c0617df38dd0bb482f18aa62f56c8b20eda1e594 (diff) | |
download | ATCD-780ad9d873d31132790eaf5c7009fb357006525c.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/CIAO/ChangeLog | 24 | ||||
-rw-r--r-- | TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp | 155 | ||||
-rw-r--r-- | TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h | 162 | ||||
-rw-r--r-- | TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl | 17 | ||||
-rw-r--r-- | TAO/CIAO/docs/templates/Executor.idl | 5 | ||||
-rw-r--r-- | TAO/CIAO/examples/handcrafted/Display/Configuration-0.png | bin | 3026 -> 8334 bytes | |||
-rw-r--r-- | TAO/CIAO/examples/handcrafted/Display/GPS/GPS.idl | 2 | ||||
-rw-r--r-- | TAO/CIAO/examples/handcrafted/Display/GPS/GPSE.idl | 75 | ||||
-rw-r--r-- | TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.cpp | 730 | ||||
-rw-r--r-- | TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.h | 469 | ||||
-rw-r--r-- | TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.inl | 220 | ||||
-rw-r--r-- | TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.idl | 2 | ||||
-rw-r--r-- | TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.h | 5 |
13 files changed, 1734 insertions, 132 deletions
diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index 2cd4bc03859..16a09c6e926 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,3 +1,27 @@ +Thu Mar 13 20:11:49 2003 Nanbor Wang <nanbor@cs.wustl.edu> + + * examples/handcrafted/Display/NavDisplay/NavDisplay.idl: + * examples/handcrafted/Display/GPS/GPS.idl: + * examples/handcrafted/Display/Configuration-0.png: Updated the + port names so they make more sense in the context. Thanks to + Dave Sharp and Wendy Rolls for the suggestions. + + * examples/handcrafted/Display/RateGen/RateGen_svnt.h: Added the + missing factory entry point for the servant home. + + * examples/handcrafted/Display/GPS/GPSE.idl: + * examples/handcrafted/Display/GPS/GPS_svnt.cpp: + * examples/handcrafted/Display/GPS/GPS_svnt.h: + * examples/handcrafted/Display/GPS/GPS_svnt.inl: Added new + "generated" code. + + * docs/templates/CIAO_Glue_Session_Template.cpp: + * docs/templates/CIAO_Glue_Session_Template.h: + * docs/templates/CIAO_Glue_Session_Template.inl: + * docs/templates/Executor.idl: Updated templates based on the code + they generated (manually. Did I mention how much fun it was to + generate code manually?) + Wed Mar 12 23:29:27 2003 Nanbor Wang <nanbor@cs.wustl.edu> * bin/generate_component_mpc.pl: Fixed an incomplete library diff --git a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp index 3c6fa420294..f6c5e10bf6f 100644 --- a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp +++ b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.cpp @@ -51,12 +51,6 @@ CORBA::Object_ptr ACE_THROW_RETURN (CORBA::INTERNAL (), 0); } -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class TAO::Utils::Servant_Var<[facet type]>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate TAO::Utils::Servant_Var<[facet type]>; -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - ##end foreach [facet type] @@ -87,8 +81,8 @@ template class TAO::Utils::Servant_Var<[facet type]>; ++iter) { ACE_Active_Map_Manager<[uses type]_var>::ENTRY &entry = *iter; - retv[i].objref = [uses type]::_narrow (entry.int_id_.in ()); - retv[i].ck = new CIAO::Map_Key_Cookie (entry.ext_id_); + retv[i]->objref = [uses type]::_narrow (entry.int_id_.in ()); + retv[i]->ck = new CIAO::Map_Key_Cookie (entry.ext_id_); ++i; } @@ -99,7 +93,8 @@ template class TAO::Utils::Servant_Var<[facet type]>; ##foreach [event name] with [eventtype] in (list of all event sources) generate: void -[ciao module name]::[component name]_Context::push_[event name] ([eventtype]_ptr ev ACE_ENV_ARG_DECL) +[ciao module name]::[component name]_Context::push_[event name] ([eventtype]_ptr ev + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { ## if [event name] belongs to an 'emits' port @@ -114,7 +109,8 @@ void ++iter) { ACE_Active_Map_Manager<[eventtype]Consumer_var>::ENTRY &entry = *iter; - [eventtype]Consumer_var c = [eventtype]Consumer::_narrow (entry.int_id_.in ()); + [eventtype]Consumer_var c + = [eventtype]Consumer::_narrow (entry.int_id_.in ()); c->push_[eventtype] (ev ACE_ENV_ARG_PARAMETER); ACE_CHECK; @@ -294,13 +290,13 @@ CORBA::Object_ptr if (CORBA::is_nil (fexe.in ())) ACE_THROW_RETURN (CORBA::INTERNAL (), 0); - // @@ What's the auto_ptr for servant? - TAO::Utils::Servant_Var<[facet type]_Servant> svt = - new [facet type]_Servant (fexe.in (), - this->context_); + [ciao module name]::[facet type]_Servant *svt = + new [ciao module name]::[facet type]_Servant (fexe.in (), + this->context_); + PortableServer::ServantBase_var safe_servant (svt); - CORBA::Object_var obj = this->container_->_install_servant (svc.in () - ACE_ENV_ARG_PARAMETER); + CORBA::Object_var obj = this->container_->install_servant (svc.in () + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); [facet type]_var fo = [facet type]::_narrow (obj @@ -326,10 +322,11 @@ void ACE_THROW_SPEC ((CORBA::SystemException, ::Components::BadEventType)) { - [eventtype] *ev_type = [eventtype]::_downcast (ev); + [eventtype]_var ev_type = [eventtype]::_downcast (ev); if (ev_type != 0) { - this->push_[eventtype] (ev ACE_ENV_ARG); + this->push_[eventtype] (ev_type.in () + ACE_ENV_ARG_PARAMETER); return; } @@ -340,19 +337,18 @@ void // get_component implementation. [eventtype]Consumer_ptr -[ciao module name]::[component name]_Servant::get_consumer_[consumer name] (ACE_ENV_SINGLE_ARG) +[ciao module name]::[component name]_Servant::get_consumer_[consumer name] (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - [eventtype]Consumer_var consumes_[consumer name]_; - if (CORBA::is_nil (this->consumes_[consumer name]_.in ())) { - TAO::Utils::Servant_Var<[eventtype]Consumer_[consumer name]_Servant> svt = - new [eventtype]Consumer_[consumer name]_Servant (this->executor_, - this->context_); + [ciao module name]::[component name]_Servant::[eventtype]Consumer_[consumer name]_Servant *svt = + new [ciao module name]::[component name]_Servant::[eventtype]Consumer_[consumer name]_Servant (this->executor_, + this->context_); + PortableServer::ServantBase_var safe_servant (svt); - CORBA::Object_var obj = this->container_->_install_servant (svt.in () - ACE_ENV_ARG_PARAMETER); + CORBA::Object_var obj = this->container_->install_servant (svt + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); [eventtype]Consumer_var eco = [eventtype]Consumer::_narrow (obj @@ -398,6 +394,7 @@ CORBA::Object_ptr = new ::Components::FacetDescriptions (#99); // #99 = number of all provided // facets including those inherited // from parent component(s). + collection->length (#99); ::Components::FacetDescription_var x; CORBA::ULong i = 0; @@ -410,7 +407,7 @@ CORBA::Object_ptr x->type_id ((const char *) "[facet type's repo id]"); // x->facet_ref (this->provide_[facet name] (ACE_ENV_SINGLE_ARG_PARAMETER)); - collection[i] = x; + collection[i] = x._retn (); ++i; ##end foreach [facet name] with [facet type] @@ -426,25 +423,28 @@ CORBA::Object_ptr { ::Components::FacetDescriptions_var collection = new ::Components::FacetDescriptions (names.length ()); + collection->length (names.length ()); ::Components::FacetDescription_var x; CORBA::ULong i = 0; for (; i < names.length (); ++i) { + x = new ::OBV_Components::FacetDescription; + // We probably need a more efficient way, e.g., a hash map, to handle all these. ##foreach [facet name] with [facet type] in (list of all provided interfaces) generate: - if (ACE_OS_String::strcmp (names[i].in (), "[facet name]") == 0) + (else) if (ACE_OS_String::strcmp (names[i].in (), "[facet name]") == 0) { - x = new ::OBV_Components::FacetDescription; - x->Name ((const char *)"[facet name]"); x->type_id ((const char *) "[facet type's repo id]"); // - x->facet_ref (this->provide_facet ("[facet name]" ACE_ENV_ARG_PARAMETER)); + x->facet_ref (this->provide_[facet name] (ACE_ENV_SINGLE_ARG_PARAMETER)); - collection[i] = x; } ##end foreach [facet name] with [facet type] - ACE_THROW_RETURN (::Components::InvalidName (), 0); + else + ACE_THROW_RETURN (::Components::InvalidName (), 0); + + collection[i] = x._retn (); } return collection._retn (); } @@ -558,9 +558,11 @@ CORBA::Object_ptr ## if [receptacle name] is a simplex receptacle ('uses') [receptacle name]Connections_var retv = new ::Components::ConnectionConnections (1); + retv->length (1); - retv[0].ck = 0; - retv[0].objref = this->get_connection_[receptacle name] (ACE_ENV_SINGLE_ARG_PARAMETER); + retv[0] = new OBV_Components::ConnectionDescription; + retv[0]->ck = 0; + retv[0]->objref = this->get_connection_[receptacle name] (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); return retv._retn (); @@ -581,18 +583,21 @@ CORBA::Object_ptr ::Components::ReceptacleDescriptions_var retv = new ::Components::ReceptacleDescriptions (#99); // #99 is number of receptacles // this component has. + retv->length (#99); CORBA::ULong i = 0; ##foreach [receptacle name] with [uses type] in (list of all 'uses' interfaces) generate: - retv[i].Name ((const char *) "[receptacle name]"); - retv[i].type_id ((const char *) "[uses type repo id]"); + retv[i] = new OBV_Components::ReceptacleDescription; + + retv[i]->Name ((const char *) "[receptacle name]"); + retv[i]->type_id ((const char *) "[uses type repo id]"); ## if [receptacle name] is a simplex receptacle ('uses') - retv[i].is_multiple (0); + retv[i]->is_multiple (0); ## else ([receptacle name] is a multiplex ('uses multiple') receptacle) - retv[i].is_multiple (1); + retv[i]->is_multiple (1); ## endif [receptacle name] - retv[i].connections (*this->get_connections ("[receptacle name]" - ACE_ENV_ARG_PARAMETER)); + retv[i]->connections (*this->get_connections ("[receptacle name]" + ACE_ENV_ARG_PARAMETER)); ++i; ##end foreach [receptacle name] with [uses type] @@ -607,25 +612,28 @@ CORBA::Object_ptr { ::Components::ReceptacleDescriptions_var retv = new ::Components::ReceptacleDescriptions (names.length ()); + retv->length (names.length ()); CORBA::ULong i = 0; for (; i < names.length (); ++i) { + retv[i] = new OBV_ReceptacleDescription; ##foreach [receptacle name] with [uses type] in (list of all 'uses' interfaces) generate: - if (ACE_OS_String::strcmp (name, "[receptacle name]") == 0) + (else) if (ACE_OS_String::strcmp (name, "[receptacle name]") == 0) { - retv[i].Name ((const char *) "[receptacle name]"); - retv[i].type_id ((const char *) "[uses type repo id]"); + retv[i]->Name ((const char *) "[receptacle name]"); + retv[i]->type_id ((const char *) "[uses type repo id]"); ## if [receptacle name] is a simplex receptacle ('uses') - retv[i].is_multiple (0); + retv[i]->is_multiple (0); ## else ([receptacle name] is a multiplex ('uses multiple') receptacle) - retv[i].is_multiple (1); + retv[i]->is_multiple (1); ## endif [receptacle name] - retv[i].connections (*this->get_connections ("[receptacle name]" + retv[i]->connections (*this->get_connections ("[receptacle name]" ACE_ENV_ARG_PARAMETER)); } ##end foreach [receptacle name] with [uses type] - ACE_THROW_RETURN (::Components::InvalidName (), 0); + else + ACE_THROW_RETURN (::Components::InvalidName (), 0); } return retv._retn (); } @@ -643,7 +651,7 @@ CORBA::Object_ptr ##foreach [consumer name] with [eventtype] in (list of all consumers) generate: if (ACE_OS_String::strcmp (sink_name, "[consumer name]") == 0) - return this->get_consumer_[consumer name] (ACE_ENV_SINGLE_ARG_PARAMATER); + return this->get_consumer_[consumer name] (ACE_ENV_SINGLE_ARG_PARAMETER); ##end foreach [consumer name] with [eventtype] ACE_THROW_RETURN (Components::InvalidName (), 0); } @@ -764,14 +772,18 @@ void ::Components::ConsumerDescriptions_var retv = new ::Components::ConsumerDescriptions (#99); // #99 is the number of consumers // this component has. + retv->length (#99); + CORBA::ULong i = 0; ##foreach [consumer name] with [eventtype] in (list of all consumers) generate: - retv[i].Name ("[consumer name]"); - retv[i].type_id ("[eventtype]Consumer repo id"); - [eventtype]Consumer_var c = this->get_consumer_[consumer name] (ACE_ENV_SINGLE_ARG_PARAMETER); + retv[i] = new OBV_Components::ConsumerDescription; + retv[i]->Name ("[consumer name]"); + retv[i]->type_id ("[eventtype]Consumer repo id"); + [eventtype]Consumer_var c + = this->get_consumer_[consumer name] (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); - retv[i].consumer (c.in ()); + retv[i]->consumer (c.in ()); ##end foreach [consumer name] with [eventtype] return retv._retn (); @@ -785,23 +797,27 @@ void { ::Components::ConsumerDescriptions_var retv = new ::Components::ConsumerDescriptions (names.length ()); + retv->length (names.length ()); CORBA::ULong i = 0; for (; i < names.length (); ++i) { + retv[i] = new OBV_Components::ConsumerDescription; + ##foreach [consumer name] with [eventtype] in (list of all consumers) generate: - if (ACE_OS_String::strcmp (names[i].in (), "[consumer name]") == 0) + (else) if (ACE_OS_String::strcmp (names[i].in (), "[consumer name]") == 0) { - retv[i].Name ("[consumer name]"); - retv[i].type_id ("[eventtype]Consumer repo id"); + retv[i]->Name ("[consumer name]"); + retv[i]->type_id ("[eventtype]Consumer repo id"); [eventtype]Consumer_var c = this->get_consumer_[consumer name] (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK_RETURN (0); - retv[i].consumer (c.in ()); + retv[i]->consumer (c.in ()); } ##end foreach [consumer name] with [eventtype] - ACE_THROW_RETURN (::Components::InvalidName (), 0); + else + ACE_THROW_RETURN (::Components::InvalidName (), 0); } return retv._retn (); } @@ -813,11 +829,14 @@ void ::Components::EmitterDescriptions_var retv = new ::Components::EmitterDescriptions (#99); // #99 is the number of emitters // this component has. + retv->length (#99); + CORBA::ULong i = 0; ##foreach [emit name] with [eventtype] in (list of all emitters) generate: - retv[i].Name ("[emit name]"); - retv[i].type_id ("[eventtype]Consumer repo id"); - retv[i].consumer ([eventtype]Consumer::_duplicate (this->context_->ciao_emits_[emit name]_consumer_)); + retv[i] = new OBV_Components::EmitterDescription; + retv[i]->Name ("[emit name]"); + retv[i]->type_id ("[eventtype]Consumer repo id"); + retv[i]->consumer ([eventtype]Consumer::_duplicate (this->context_->ciao_emits_[emit name]_consumer_)); ##end foreach [emitter name] with [eventtype] return retv._retn (); @@ -831,19 +850,23 @@ void { ::Components::EmitterDescriptions_var retv = new ::Components::EmitterDescriptions (names.length ()); + retv->length (names.length ()); CORBA::ULong i = 0; for (; i < names.length (); ++i) { + retv[i] = new OBV_Components::EmitterDescription; + ##foreach [emit name] with [eventtype] in (list of all emitters) generate: - if (ACE_OS_String::strcmp (names[i].in (), "[emit name]") == 0) + (else) if (ACE_OS_String::strcmp (names[i].in (), "[emit name]") == 0) { - retv[i].Name ("[emit name]"); - retv[i].type_id ("[eventtype]Consumer repo id"); - retv[i].consumer ([eventtype]Consumer::_duplicate (this->context_->ciao_emits_[emit name]_consumer_)); + retv[i]->Name ("[emit name]"); + retv[i]->type_id ("[eventtype]Consumer repo id"); + retv[i]->consumer ([eventtype]Consumer::_duplicate (this->context_->ciao_emits_[emit name]_consumer_)); } ##end foreach [consumer name] with [eventtype] - ACE_THROW_RETURN (::Components::InvalidName (), 0); + else + ACE_THROW_RETURN (::Components::InvalidName (), 0); } return retv._retn (); } diff --git a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h index 2b4fdb0ccc3..52eca80c2d4 100644 --- a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h +++ b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.h @@ -38,11 +38,10 @@ ##if component is defined withing a [module name] namespace CIAO_GLUE_[module_name] -{ ##else namespace CIAO_GLUE -{ ##endif +{ ////////////////////////////////////////////////////////////////// // Facet Glue Code implementation @@ -85,8 +84,7 @@ namespace CIAO_GLUE ////////////////////////////////////////////////////////////////// // Component specific context implementation class [SERVANT]_Export [component name]_Context : - public virtual CCM_[component name]_Context, - public virtual ::Components::CCMContext + public virtual CCM_[component name]_Context { public: // We will allow the the servant glue code we generate to access @@ -242,7 +240,7 @@ namespace CIAO_GLUE // Dtor. ~[component name]_Servant (void); -##foreach [operation] in all supported interfaces of own component and all inherited components +##foreach [operation] in all supported interfaces of own component and all inherited components and attribute accessors/mutators // Generate the [operation] here. @@ -289,7 +287,7 @@ namespace CIAO_GLUE ##foreach [consumer name] with [eventtype] in (list of all consumers) generate: // First we need to generate the event sink specific servant - class [SERVANT]_Export [eventtype]Consumer_[consumer name]_Servant : + class [SERVANT]_Export [eventtype]Consumer_[consumer name]_Servant : public virtual POA_[eventtype]Consumer, // full skeleton name here public virtual PortableServer::RefCountServantBase { @@ -297,7 +295,7 @@ namespace CIAO_GLUE // Constructor and destructor. [event type]Consumer_[consumer name]_Servant (CCM_[component name]_ptr executor, CCM_[component name]_Context_ptr c); - ~[event type]Consumer-[consumer name]_Servant (); + ~[event type]Consumer_[consumer name]_Servant (); ## foreach [type] in ([eventtype] and all its parent eventtype, if any) virtual void push_[type] ([type]_ptr evt @@ -312,11 +310,12 @@ namespace CIAO_GLUE ::Components::BadEventType)); // get_component implementation. - virtual CORBA::Object_ptr _get_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual CORBA::Object_ptr + _get_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); protected: - // Consumer Executor + // Executor CCM_[component name]_var executor_; // Context object. @@ -359,12 +358,17 @@ namespace CIAO_GLUE ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException , Components::InvalidName)) ; - virtual ::Components::FacetDescriptions * get_all_facets (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::FacetDescriptions * + get_all_facets (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual ::Components::FacetDescriptions * get_named_facets (const Components::NameList & names - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::FacetDescriptions * + get_named_facets (const Components::NameList & names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException , Components::InvalidName)); + virtual CORBA::Boolean same_component (CORBA::Object_ptr object_ref ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -378,6 +382,7 @@ namespace CIAO_GLUE Components::InvalidConnection, Components::AlreadyConnected, Components::ExceededConnectionLimit)); + virtual CORBA::Object_ptr disconnect (const char * name, Components::Cookie_ptr ck ACE_ENV_ARG_DECL_WITH_DEFAULTS) @@ -386,36 +391,47 @@ namespace CIAO_GLUE Components::InvalidConnection, Components::CookieRequired, Components::NoConnection)); - virtual ::Components::ConnectionDescriptions * get_connections (const char * name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::ConnectionDescriptions * + get_connections (const char * name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidName)); - virtual ::Components::ReceptacleDescriptions * get_all_receptacles (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual ::Components::ReceptacleDescriptions * + get_all_receptacles (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual ::Components::ReceptacleDescriptions * get_named_receptacles (const Components::NameList & names - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::ReceptacleDescriptions * + get_named_receptacles (const Components::NameList & names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidName)); // Operations for Events interface - virtual ::Components::EventConsumerBase_ptr get_consumer (const char * sink_name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + virtual ::Components::EventConsumerBase_ptr + get_consumer (const char * sink_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidName)); - virtual ::Components::Cookie_ptr subscribe (const char * publisher_name, - Components::EventConsumerBase_ptr subscriber - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::Cookie_ptr + subscribe (const char * publisher_name, + Components::EventConsumerBase_ptr subscriber + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidName, Components::InvalidConnection, Components::ExceededConnectionLimit)); - virtual ::Components::EventConsumerBase_ptr unsubscribe (const char * publisher_name, - Components::Cookie_ptr ck - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::EventConsumerBase_ptr + unsubscribe (const char * publisher_name, + Components::Cookie_ptr ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidName, Components::InvalidConnection)); + virtual void connect_consumer (const char * emitter_name, Components::EventConsumerBase_ptr consumer ACE_ENV_ARG_DECL_WITH_DEFAULTS) @@ -423,55 +439,80 @@ namespace CIAO_GLUE Components::InvalidName, Components::AlreadyConnected, Components::InvalidConnection)); - virtual ::Components::EventConsumerBase_ptr disconnect_consumer (const char * source_name - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::EventConsumerBase_ptr + disconnect_consumer (const char * source_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidName, Components::NoConnection)); - virtual ::Components::ConsumerDescriptions * get_all_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::ConsumerDescriptions * + get_all_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual ::Components::ConsumerDescriptions * get_named_consumers (const Components::NameList & names - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::ConsumerDescriptions * + get_named_consumers (const Components::NameList & names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidName)); - virtual ::Components::EmitterDescriptions * get_all_emitters (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::EmitterDescriptions * + get_all_emitters (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual ::Components::EmitterDescriptions * get_named_emitters (const Components::NameList & names - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::EmitterDescriptions * + get_named_emitters (const Components::NameList & names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidName)); - virtual ::Components::PublisherDescriptions * get_all_publishers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::PublisherDescriptions * + get_all_publishers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual ::Components::PublisherDescriptions * get_named_publishers (const Components::NameList & names - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::PublisherDescriptions * + get_named_publishers (const Components::NameList & names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidName)); // Operations for CCMObject interface - virtual ::CORBA::IRObject_ptr get_component_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual ::CORBA::IRObject_ptr + get_component_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual ::Components::CCMHome_ptr get_ccm_home (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::CCMHome_ptr + get_ccm_home (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual ::Components::PrimaryKeyBase * get_primary_key (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::PrimaryKeyBase * + get_primary_key (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::NoKeyAvailable)); + virtual void configuration_complete (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::InvalidConfiguration)); + virtual void remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::RemoveFailure)); - virtual ::Components::ComponentPortDescription * get_all_ports (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + + virtual ::Components::ComponentPortDescription * + get_all_ports (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); // get_component implementation. - virtual CORBA::Object_ptr _get_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual CORBA::Object_ptr + _get_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); // CIAO specific operations. // Activate the object in the container_ - [component name]_ptr _ciao_activate_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + [component name]_ptr _ciao_activate_component + (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); protected: @@ -523,7 +564,8 @@ namespace CIAO_GLUE ##foreach [factory name] in (all factory operations in [home basename] including its parents) // for factory operations inherit from parent home(s), they should return // the corresponding component types their homes manage - virtual [component name]_ptr [factory name] (.... ACE_ENV_ARG_DECL_WITH_DEFAULTS) + virtual [component name]_ptr + [factory name] (.... ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, ::Components::CreateFailure, ....)); @@ -533,7 +575,8 @@ namespace CIAO_GLUE ##foreach [finder name] in (all finder operations in [home basename] including its parents) // for finder operations inherit from parent home(s), they should return // the corresponding component types their homes manage - virtual [component name]_ptr [finder name] (.... ACE_ENV_ARG_DECL_WITH_DEFAULTS) + virtual [component name]_ptr + [finder name] (.... ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::FinderFailure, ....)); @@ -542,7 +585,8 @@ namespace CIAO_GLUE ## if [home name] is a keyless home // Operations for KeylessHome interface - virtual ::Components::CCMObject_ptr create_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual ::Components::CCMObject_ptr + create_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::CreateFailure)); @@ -557,8 +601,9 @@ namespace CIAO_GLUE ::Components::DuplicateKeyValue, ::Components::InvalidKey)); - virtual [component name]_ptr find_by_primary_key ([key type]_ptr key - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + virtual [component name]_ptr + find_by_primary_key ([key type]_ptr key + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, ::Components::FinderFailure, ::Components::UnknownKeyValue, @@ -571,22 +616,28 @@ namespace CIAO_GLUE ::Components::UnknownKeyValue, ::Components::InvalidKey)); - virtual [key type]_ptr get_primary_key ([component name]_ptr comp - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + virtual [key type]_ptr + get_primary_key ([component name]_ptr comp + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); ## endif (keyed or keyless home) // Operations for Implicit Home interface - virtual [component name]_ptr create (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual [component name]_ptr + create (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::CreateFailure)); // Operations for CCMHome interface - virtual ::CORBA::IRObject_ptr get_component_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + virtual ::CORBA::IRObject_ptr + get_component_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual ::CORBA::IRObject_ptr get_home_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + + virtual ::CORBA::IRObject_ptr + get_home_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void remove_component (Components::CCMObject_ptr comp ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, @@ -594,8 +645,9 @@ namespace CIAO_GLUE protected: // Helper method for factory operations. - [component name]_ptr _ciao_create_helper (::Components::EnterpriseComponent_ptr c - ACE_ENV_ARG_DECL_WITH_DEFAULTS) + [component name]_ptr + _ciao_create_helper (::Components::EnterpriseComponent_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) ACE_THROW_SPEC ((CORBA::SystemException, Components::CreateFailure)); @@ -610,9 +662,7 @@ namespace CIAO_GLUE create[home name]_Servant (::Components::HomeExecutorBase_ptr p, CIAO::Session_Container *c ACE_ENV_ARG_DECL_WITH_DEFAULTS); -#if there are module definitions, preserve them all } -#endif #if defined (__ACE_INLINE__) # include "[idl-basename]_svnt.inl" diff --git a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl index 865ab29bc67..e565c954507 100644 --- a/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl +++ b/TAO/CIAO/docs/templates/CIAO_Glue_Session_Template.inl @@ -61,7 +61,7 @@ ACE_INLINE [operation return_type] ACE_INLINE [ciao module name]::[component name]_Context::[component name]_Context (::Components::CCMHome_ptr home, ::CIAO::Session_Container *c, - [component name]_Servant *sv) + [ciao module name]::[component name]_Servant *sv) : home_ (::Components::CCMHome::_duplicate (home)), container_ (c), servant_ (sv) @@ -170,7 +170,7 @@ ACE_INLINE : executor_ (CCM_[component name]::_duplicate (exe)), container_ (c) { - this->context_ = new [component name]_Context (h, c, this); + this->context_ = new [ciao module name]::[component name]_Context (h, c, this); } ACE_INLINE @@ -271,8 +271,8 @@ ACE_INLINE [ciao module name]::[component name]_Servant::[event type]Consumer_[consumer name]_Servant::[event type]Consumer_[consumer name]_Servant (CCM_[component name]_ptr executor, CCM_[component name]_Context_ptr c) - : executor_ (CCM_[event type]Consumer::_duplicate (executor)), - ctx_ (CCM_[component name]_Context::_duplicate (c)) + : executor_ (CCM_[component name]::_duplicate (executor)), + ctx_ (CCM_[component name]_Context::_duplicate (c)) { } @@ -285,7 +285,7 @@ ACE_INLINE CORBA::Object_ptr [ciao module name]::[component name]_Servant::[event type]Consumer_[consumer name]_Servant::_get_component (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - return this->ctx_->get_CCM_Object (ACE_ENV_SINGLE_ARG_PARAMETER); + return this->ctx_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); } ACE_INLINE void @@ -294,7 +294,8 @@ ACE_INLINE void ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->executor_->push_[consumer name] (evt ACE_ENV_ARG); + this->executor_->push_[consumer name] (evt + ACE_ENV_ARG_PARAMETER); } ## foreach [type] in (all parents of eventtype, if any, not including EventConsumerBase) @@ -313,7 +314,7 @@ ACE_INLINE void ##end foreach [consumer name] - // Operations for emits interfaces. +// Operations for emits interfaces. ##foreach [emit name] with [eventtype] in (list of all emitters) generate: ACE_INLINE void [ciao module name]::[component name]_Servant::connect_[emit name] ([eventtype]Consumer_ptr c @@ -334,7 +335,7 @@ ACE_INLINE [eventtype]Consumer_ptr } ##end foreach [emit name] with [eventtype] - // Operations for publishes interfaces. +// Operations for publishes interfaces. ##foreach [publish name] with [eventtype] in (list of all publishers) generate: ACE_INLINE ::Components::Cookie_ptr [ciao module name]::[component name]_Servant::subscribe_[publish name] ([eventtype]Consumer_ptr c diff --git a/TAO/CIAO/docs/templates/Executor.idl b/TAO/CIAO/docs/templates/Executor.idl index 820ff340fcf..00147796d95 100644 --- a/TAO/CIAO/docs/templates/Executor.idl +++ b/TAO/CIAO/docs/templates/Executor.idl @@ -24,6 +24,9 @@ // // =========================================================== +#ifndef [component_idl]E_IDL +#define [component_idl]E_IDL + #include "CCM_Container.idl" // Found in $(CIAO_ROOT)/ciao // For various definitions of container // internal/callback interfaces @@ -239,3 +242,5 @@ module [module_name] { ##if there are module definitions, preserve them all }; ##endif + +#endif /* [component_idl]E_IDL */ diff --git a/TAO/CIAO/examples/handcrafted/Display/Configuration-0.png b/TAO/CIAO/examples/handcrafted/Display/Configuration-0.png Binary files differindex cf45b39d7a2..1a52e073df1 100644 --- a/TAO/CIAO/examples/handcrafted/Display/Configuration-0.png +++ b/TAO/CIAO/examples/handcrafted/Display/Configuration-0.png diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.idl b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.idl index d3c74b91092..8a2f2f50361 100644 --- a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.idl +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS.idl @@ -14,7 +14,7 @@ module HUDisplay { component GPS { - provides position MyPosition; + provides position MyLocation; publishes tick Ready; consumes tick Refresh; }; diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPSE.idl b/TAO/CIAO/examples/handcrafted/Display/GPS/GPSE.idl new file mode 100644 index 00000000000..c6df8a40e1a --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPSE.idl @@ -0,0 +1,75 @@ +// $Id$ + +// =========================================================== +// +// @file GPSE.idl +// +// Generated based on $(CIAO_ROOT)/docs/templates/Executor.idl +// +// @author Nanbor Wang <nanbor@cs.wustl.edu> +// +// =========================================================== + +#ifndef GPSE_IDL +#define GPSE_IDL + +#include "CCM_Container.idl" // Found in $(CIAO_ROOT)/ciao + // For various definitions of container + // internal/callback interfaces +#include "GPS.idl" // Original component IDL definition +#include "..\HUDisplayE.idl" + +module HUDisplay { + + // Component Main Executor Interface. We currently do not + // support Executor-based implementation. + + local interface CCM_GPS_Executor + : ::Components::EnterpriseComponent + { + }; + + // Monolithic component executor. + // For implementing monolithic component call back interface. + + local interface CCM_GPS + : ::Components::EnterpriseComponent + { + CCM_position get_MyLocation (); + + void push_Refresh (in tick ev); + }; + + /** + * Component Context Interface + * + * Notice that we are taking a shortcut here to inherit the + * component-specific context from SessionContext directly instead + * of CCMContext. + */ + local interface CCM_GPS_Context + : Components::SessionContext + { + void push_Ready (in tick ev); + }; + + local interface CCM_GPSHomeExplicit + : ::Components::HomeExecutorBase + { + }; + + local interface CCM_GPSHomeImplicit + { + ::Components::EnterpriseComponent create () + raises (::Components::CCMException); + }; + + local interface CCM_GPSHome + : CCM_GPSHomeExplicit, + CCM_GPSHomeImplicit + { + }; + +}; + +#endif /* GPSE_IDL */ diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.cpp b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.cpp new file mode 100644 index 00000000000..1d63cee7a86 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.cpp @@ -0,0 +1,730 @@ +// $Id$ + +// The generated filename for files using this template shoule be +// GPSGS.cpp GS --> GlueSession + +// @@ Notice: [ciao module name] can expand to either CIAO_GLUE or +// CIAO_GLUE_[module name] as defined in the header file. + +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +/// @@@ Notice that all component and interface names need to be +/// fully qualified as we are creating a new namespace for the CIAO's +/// container glue code. +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +#include "GPS_svnt.h" +#include "../HUDisplay_svnt.h" +#include "Cookies.h" + +#if !defined (__ACE_INLINE__) +# include "GPS_svnt.inl" +#endif /* __ACE_INLINE__ */ + +void +CIAO_GLUE_HUDisplay::GPS_Context::push_Ready (HUDisplay::tick_ptr ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_Active_Map_Manager<HUDisplay::tickConsumer_var>::iterator + end = this->ciao_publishes_Ready_map_.end (); + for (ACE_Active_Map_Manager<HUDisplay::tickConsumer_var>::iterator + iter = this->ciao_publishes_Ready_map_.begin (); + iter != end; + ++iter) + { + ACE_Active_Map_Manager<HUDisplay::tickConsumer_var>::ENTRY &entry = *iter; + HUDisplay::tickConsumer_var c + = HUDisplay::tickConsumer::_narrow (entry.int_id_.in ()); + c->push_tick (ev + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } +} + +// Operations for publishes interfaces. +ACE_INLINE ::Components::Cookie_ptr +CIAO_GLUE_HUDisplay::GPS_Context::subscribe_Ready (HUDisplay::tickConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::ExceededConnectionLimit)) +{ + if (CORBA::is_nil (c)) + ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0); + + ACE_Active_Map_Manager_Key key; + this->ciao_publishes_Ready_map_.bind (c, + key); + + ::Components::Cookie_var retv = new CIAO::Map_Key_Cookie (key); + return retv._retn (); +} + +ACE_INLINE HUDisplay::tickConsumer_ptr +CIAO_GLUE_HUDisplay::GPS_Context::unsubscribe_Ready (::Components::Cookie_ptr ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::InvalidConnection)) +{ + HUDisplay::tickConsumer_var retv; + + ACE_Active_Map_Manager_Key key; + if (ck == 0 || + CIAO::Map_Key_Cookie::extract (ck, key) == -1) + ACE_THROW_RETURN (::Components::InvalidConnection (), 0); + + if (this->ciao_publishes_Ready_map_.unbind (key, + retv) != 0) + ACE_THROW_RETURN (::Components::InvalidConnection (), 0); + + return retv._retn (); +} + +// Operations for ::Components::SessionContext interface +CORBA::Object_ptr +CIAO_GLUE_HUDisplay::GPS_Context::get_CCM_object (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::IllegalState)) +{ + // @@ How do I check for IllegalState here? When it's not in a + // callback operation... + // ACE_THROW_RETURN (::Components::IllegalState (), 0); + + if (CORBA::is_nil (this->component_.in ())) + { + CORBA::Object_var obj = this->container_->get_objref (this->servant_ + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + this->component_ = HUDisplay::GPS::_narrow (obj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (CORBA::is_nil (this->component_.in ())) + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); // This should not happen... + } + return HUDisplay::GPS::_duplicate (this->component_.in ()); +} + +////////////////////////////////////////////////////////////////// +// Component Servant Glue code implementation +////////////////////////////////////////////////////////////////// + +// Operations for provides interfaces. +HUDisplay::position_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::provide_MyLocation (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (CORBA::is_nil (this->provide_MyLocation_.in ())) + { + HUDisplay::CCM_position_var fexe + = this->executor_->get_MyLocation (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (CORBA::is_nil (fexe.in ())) + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); + + CIAO_GLUE_HUDisplay::position_Servant *svt = + new CIAO_GLUE_HUDisplay::position_Servant (fexe.in (), + this->context_); + PortableServer::ServantBase_var safe_servant (svt); + + CORBA::Object_var obj = this->container_->install_servant (svt + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + HUDisplay::position_var fo + = HUDisplay::position::_narrow (obj + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + this->provide_MyLocation_ = fo; + } + + return HUDisplay::position::_duplicate (this->provide_MyLocation_.in ()); +} + +// Operations for consumers interfaces. +// EventConsumer Glue Code implementation + +// Inherit from ::Compopnents::EventConsumerBase +void +CIAO_GLUE_HUDisplay::GPS_Servant::tickConsumer_Refresh_Servant::push_event (Components::EventBase_ptr ev + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::BadEventType)) +{ + HUDisplay::tick_var ev_type = HUDisplay::tick::_downcast (ev); + if (ev_type != 0) + { + this->push_tick (ev_type.in () + ACE_ENV_ARG_PARAMETER); + return; + } + + // @@ This include the case when we receive a parent eventtype of [eventtype] + ACE_THROW (::Components::BadEventType ()); +} + +// get_component implementation. +HUDisplay::tickConsumer_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::get_consumer_Refresh (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (CORBA::is_nil (this->consumes_Refresh_.in ())) + { + CIAO_GLUE_HUDisplay::GPS_Servant::tickConsumer_Refresh_Servant *svt = + new CIAO_GLUE_HUDisplay::GPS_Servant::tickConsumer_Refresh_Servant (this->executor_, + this->context_); + PortableServer::ServantBase_var safe_servant (svt); + + CORBA::Object_var obj = this->container_->install_servant (svt + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + HUDisplay::tickConsumer_var eco + = HUDisplay::tickConsumer::_narrow (obj + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + this->consumes_Refresh_ = eco; + } + + return HUDisplay::tickConsumer::_duplicate (this->consumes_Refresh_.in ()); +} + +// Operations for Navigation interface +CORBA::Object_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::provide_facet (const char * name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException , + Components::InvalidName)) +{ + if (name == 0) + ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0); + + // We simply iterate thru all the facets this component provides + // now. We can also use a hash map along with perfect hashing + // (i.e., gperf) if we need faster performance since all the provided + // interfaces are static to a component definition. + + if (ACE_OS_String::strcmp (name, "MyLocation") == 0) + return this->provide_MyLocation (ACE_ENV_SINGLE_ARG_PARAMETER); + + ACE_THROW_RETURN (::Components::InvalidName (), 0); +} + +::Components::FacetDescriptions * +CIAO_GLUE_HUDisplay::GPS_Servant::get_all_facets (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ::Components::FacetDescriptions_var collection + = new ::Components::FacetDescriptions (1); // #99 = number of all provided + // facets including those inherited + // from parent component(s). + + collection->length (1); + + ::Components::FacetDescription_var x; + CORBA::ULong i = 0; + + x = new ::OBV_Components::FacetDescription; + + x->Name ((const char *)"MyLocation"); + x->type_id ((const char *) "IDL:HUDisplay/position:1.0"); // + x->facet_ref (this->provide_MyLocation (ACE_ENV_SINGLE_ARG_PARAMETER)); + + collection[i] = x._retn (); + ++i; + + return collection._retn (); + +} + +::Components::FacetDescriptions * +CIAO_GLUE_HUDisplay::GPS_Servant::get_named_facets (const Components::NameList & names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)) +{ + ::Components::FacetDescriptions_var collection + = new ::Components::FacetDescriptions (names.length ()); + collection->length (names.length ()); + + ::Components::FacetDescription_var x; + CORBA::ULong i = 0; + + for (; i < names.length (); ++i) + { + x = new ::OBV_Components::FacetDescription; + + // We probably need a more efficient way, e.g., a hash map, to handle all these. + if (ACE_OS_String::strcmp (names[i].in (), "MyLocation") == 0) + { + x->Name ((const char *)"MyLocation"); + x->type_id ((const char *) "IDL:HUDisplay/position:1.0"); // + x->facet_ref (this->provide_MyLocation (ACE_ENV_SINGLE_ARG_PARAMETER)); + } + else + ACE_THROW_RETURN (::Components::InvalidName (), 0); + + collection[i] = x._retn(); + } + return collection._retn (); +} + +CORBA::Boolean +CIAO_GLUE_HUDisplay::GPS_Servant::same_component (CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (CORBA::is_nil (object_ref)) + ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0); + + CORBA::Object_var the_other = object_ref->_get_component (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Object_var me = this->context_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return me->_is_equivalent (object_ref + ACE_ENV_ARG_PARAMETER); +} + +// Operations for Receptacles interface +::Components::Cookie_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::connect (const char *, + CORBA::Object_ptr + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::InvalidConnection, + Components::AlreadyConnected, + Components::ExceededConnectionLimit)) +{ + ACE_THROW_RETURN (Components::InvalidName (), 0); +} + +CORBA::Object_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::disconnect (const char *, + Components::Cookie_ptr + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::InvalidConnection, + Components::CookieRequired, + Components::NoConnection)) +{ + ACE_THROW_RETURN (Components::InvalidName (), 0); +} + +::Components::ConnectionDescriptions * +CIAO_GLUE_HUDisplay::GPS_Servant::get_connections (const char * + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)) +{ + ACE_THROW_RETURN (Components::InvalidName (), 0); +} + +::Components::ReceptacleDescriptions * +CIAO_GLUE_HUDisplay::GPS_Servant::get_all_receptacles (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ::Components::ReceptacleDescriptions_var retv = + new ::Components::ReceptacleDescriptions (0); // #99 is number of receptacles + // this component has. + return retv._retn (); +} + +::Components::ReceptacleDescriptions * +CIAO_GLUE_HUDisplay::GPS_Servant::get_named_receptacles (const Components::NameList & names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)) +{ + ::Components::ReceptacleDescriptions_var retv = + new ::Components::ReceptacleDescriptions (names.length ()); + retv->length (names.length ()); + + CORBA::ULong i = 0; + for (; i < names.length (); ++i) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + return retv._retn (); +} + +// Operations for Events interface +::Components::EventConsumerBase_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::get_consumer (const char * sink_name + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)) +{ + // @@ We can omit this if clause if there's no event sinks in this component. + if (sink_name == 0) + ACE_THROW_RETURN (Components::InvalidName (), 0); + + if (ACE_OS_String::strcmp (sink_name, "Refresh") == 0) + return this->get_consumer_Refresh (ACE_ENV_SINGLE_ARG_PARAMETER); + + ACE_THROW_RETURN (Components::InvalidName (), 0); +} + +::Components::Cookie_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::subscribe (const char * publisher_name, + Components::EventConsumerBase_ptr subscriber + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::InvalidConnection, + Components::ExceededConnectionLimit)) +{ + // @@ We can omit this if clause if there's no publisher in this component. + if (publisher_name == 0) + ACE_THROW_RETURN (Components::InvalidName (), 0); + + if (ACE_OS_String::strcmp (publisher_name, "Ready") == 0) + { + HUDisplay::tickConsumer_var _ciao_consumer = + HUDisplay::tickConsumer::_narrow (subscriber + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (CORBA::is_nil (_ciao_consumer.in ())) + ACE_THROW_RETURN (Components::InvalidConnection (), 0); + + return this->subscribe_Ready (_ciao_consumer.in () + ACE_ENV_ARG_PARAMETER); + } + + ACE_THROW_RETURN (Components::InvalidName (), 0); +} + +::Components::EventConsumerBase_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::unsubscribe (const char * publisher_name, + Components::Cookie_ptr ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::InvalidConnection)) +{ + // @@ We can omit this if clause if there's no publisher in this component. + if (publisher_name == 0) + ACE_THROW_RETURN (Components::InvalidName (), 0); + + if (ACE_OS_String::strcmp (publisher_name, "Ready") == 0) + { + return this->unsubscribe_Ready (ck + ACE_ENV_ARG_PARAMETER); + } + + ACE_THROW_RETURN (Components::InvalidName (), 0); +} + +void +CIAO_GLUE_HUDisplay::GPS_Servant::connect_consumer (const char *, + Components::EventConsumerBase_ptr + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::AlreadyConnected, + Components::InvalidConnection)) +{ + ACE_THROW (Components::InvalidName ()); +} + +::Components::EventConsumerBase_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::disconnect_consumer (const char * + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::NoConnection)) +{ + ACE_THROW_RETURN (Components::InvalidName (), 0); +} + +::Components::ConsumerDescriptions * +CIAO_GLUE_HUDisplay::GPS_Servant::get_all_consumers (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ::Components::ConsumerDescriptions_var retv = + new ::Components::ConsumerDescriptions (1); // #99 is the number of consumers + // this component has. + retv->length (1); + + CORBA::ULong i = 0; + + retv[i] = new OBV_Components::ConsumerDescription; + retv[i]->Name ("Refresh"); + retv[i]->type_id ("IDL:HUDisplay/tickConsumer:1.0"); + HUDisplay::tickConsumer_var c + = this->get_consumer_Refresh (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + retv[i]->consumer (c.in ()); + + return retv._retn (); +} + +::Components::ConsumerDescriptions * +CIAO_GLUE_HUDisplay::GPS_Servant::get_named_consumers (const Components::NameList & names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)) +{ + ::Components::ConsumerDescriptions_var retv = + new ::Components::ConsumerDescriptions (names.length ()); + + retv->length (names.length ()); + + CORBA::ULong i = 0; + for (; i < names.length (); ++i) + { + retv[i] = new OBV_Components::ConsumerDescription; + + if (ACE_OS_String::strcmp (names[i].in (), "Refresh") == 0) + { + retv[i]->Name ("Refresh"); + retv[i]->type_id ("IDL:HUDisplay/tickConsumer:1.0"); + HUDisplay::tickConsumer_var c = + this->get_consumer_Refresh (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + retv[i]->consumer (c.in ()); + } + else + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + return retv._retn (); +} + +::Components::EmitterDescriptions * +CIAO_GLUE_HUDisplay::GPS_Servant::get_all_emitters (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ::Components::EmitterDescriptions_var retv = + new ::Components::EmitterDescriptions (0); // #99 is the number of emitters + // this component has. + return retv._retn (); +} + +::Components::EmitterDescriptions * +CIAO_GLUE_HUDisplay::GPS_Servant::get_named_emitters (const Components::NameList & names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)) +{ + ::Components::EmitterDescriptions_var retv = + new ::Components::EmitterDescriptions (names.length ()); + retv->length (names.length ()); + + CORBA::ULong i = 0; + for (; i < names.length (); ++i) + { + ACE_THROW_RETURN (::Components::InvalidName (), 0); + } + return retv._retn (); +} + +::Components::PublisherDescriptions * +CIAO_GLUE_HUDisplay::GPS_Servant::get_all_publishers (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // @@ to-do + + // Need to add interfaces in the Context class to gather the information. + // Or we can just relay it to the Context object. + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + +::Components::PublisherDescriptions * +CIAO_GLUE_HUDisplay::GPS_Servant::get_named_publishers (const Components::NameList & names + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)) +{ + // @@ to-do + + // Need to add interfaces in the Context class to gather the information. + // Or we can just relay it to the Context object. + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + +// Operations for CCMObject interface +::CORBA::IRObject_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::get_component_def (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // @@ to-do: Connect to an IfR? + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + +::Components::CCMHome_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::get_ccm_home (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return this->context_->get_CCM_home (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +::Components::PrimaryKeyBase * +CIAO_GLUE_HUDisplay::GPS_Servant::get_primary_key (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::NoKeyAvailable)) +{ + // This is a keyless component. + ACE_THROW_RETURN (::Components::NoKeyAvailable (), 0); +} + +void +CIAO_GLUE_HUDisplay::GPS_Servant::configuration_complete (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidConfiguration)) +{ + // @@ to-do + // No-op. Don't know how to pass this info to monolithic executor. +} + +void +CIAO_GLUE_HUDisplay::GPS_Servant::remove (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::RemoveFailure)) +{ + // @@ to-do + // Need to figure out what to do here. E.g., tear down the all the connections + // this component has? +} + +::Components::ComponentPortDescription * +CIAO_GLUE_HUDisplay::GPS_Servant::get_all_ports (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ::Components::ComponentPortDescription_var retv = + new OBV_Components::ComponentPortDescription; + + ::Components::FacetDescriptions_var facets_desc + = this->get_all_facets (ACE_ENV_SINGLE_ARG_PARAMETER); + ::Components::ReceptacleDescriptions_var receptacle_desc + = get_all_receptacles (ACE_ENV_SINGLE_ARG_PARAMETER); + ::Components::ConsumerDescriptions_var consumer_desc + = this->get_all_consumers (ACE_ENV_SINGLE_ARG_PARAMETER); + ::Components::EmitterDescriptions_var emitter_desc + = this->get_all_emitters (ACE_ENV_SINGLE_ARG_PARAMETER); + ::Components::PublisherDescriptions_var publisher_desc + = this->get_all_publishers (ACE_ENV_SINGLE_ARG_PARAMETER); + + retv->facets (facets_desc.in()); + retv->receptacles (receptacle_desc.in()); + retv->consumers (consumer_desc.in()); + retv->emitters (emitter_desc.in()); + retv->publishers (publisher_desc.in()); + + return retv._retn(); +} + +// get_component implementation. +CORBA::Object_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::_get_component (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ::Components::SessionContext_var sc = + ::Components::SessionContext::_narrow (this->context_); + + if (! CORBA::is_nil(sc.in ())) + return sc->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + + // @@ Do we need to try the following case here? We are afterall implementing + // a session component here. + ::Components::EntityContext_var ec = + ::Components::EntityContext::_narrow (this->context_); + + if (! CORBA::is_nil(ec.in ())) + return ec->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); + + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); +} + +HUDisplay::GPS_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::_ciao_activate_component (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + CORBA::Object_var obj + = this->container_->install_servant (this + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + HUDisplay::GPS_var ho = HUDisplay::GPS::_narrow (obj + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return ho._retn (); + +} + +////////////////////////////////////////////////////////////////// +// Component Home Glue code implementation +////////////////////////////////////////////////////////////////// + +HUDisplay::GPS_ptr +CIAO_GLUE_HUDisplay::GPSHome_Servant::_ciao_create_helper (::Components::EnterpriseComponent_ptr com + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)) +{ + HUDisplay::CCM_GPS_var hw = HUDisplay::CCM_GPS::_narrow (com + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + // Acquiring the home reference and pass it to the component servant + CORBA::Object_var hobj= this->container_->get_objref (this + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + HUDisplay::GPSHome_var home = HUDisplay::GPSHome::_narrow (hobj.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CIAO_GLUE_HUDisplay::GPS_Servant *svt = + new CIAO_GLUE_HUDisplay::GPS_Servant (hw.in (), + home.in (), + this->container_); + + return svt->_ciao_activate_component (ACE_ENV_ARG_PARAMETER); +} + +// Operations for Implicit Home interface +HUDisplay::GPS_ptr +CIAO_GLUE_HUDisplay::GPSHome_Servant::create (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)) +{ + if (this->executor_.in () == 0) + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); + + Components::EnterpriseComponent_var com = + this->executor_->create (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + return this->_ciao_create_helper (com + ACE_ENV_ARG_PARAMETER); +} + +// Operations for CCMHome interface +void +CIAO_GLUE_HUDisplay::GPSHome_Servant::remove_component (Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::RemoveFailure)) +{ + if (CORBA::is_nil (comp)) + ACE_THROW (CORBA::INTERNAL ()); // What is the right exception to throw here? + + comp->remove (ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + // Removing the object reference? get the servant from the POA with + // the objref, and call remove() on the component, deactivate the + // component, and then remove-ref the servant? + this->container_->uninstall (comp + ACE_ENV_ARG_PARAMETER); +} diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.h b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.h new file mode 100644 index 00000000000..6c090265564 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.h @@ -0,0 +1,469 @@ +// $Id$ + +// =========================================================== +// +// @file CIAO_Glue_Session_Template.h +// +// This is a pseudo-meta generic servant implementations template +// for CIAO's CIDL compiler. It demonstrates how a servant +// implementation for a session component should look like. +// +// The generated filename for files using this template shoule be +// GPS_svnt.h +// +// @author Nanbor Wang <nanbor@cs.wustl.edu> +// +// =========================================================== + +#ifndef CIAO_GLUE_SESSION_GPS_SVNT_H +#define CIAO_GLUE_SESSION_GPS_SVNT_H +#include "ace/pre.h" + +#include "GPSS.h" // Source in the skeletons for component + // client-view equivalent interfaces +#include "GPSEC.h" // Source in the executor mapping + // that component implementations use +#include "ciao/Container_Base.h" //Source in the container interface definitions +#include "ace/Active_Map_Manager_T.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +/// @@@ Notice that all component and interface names need to be +/// fully qualified as we are creating a new namespace for the CIAO's +/// container glue code. +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +namespace CIAO_GLUE_HUDisplay +{ + // Facet glue code has already been defined in ../HUDisplay_svnt.* + + + ////////////////////////////////////////////////////////////////// + // Component specific context implementation + class GPS_SVNT_Export GPS_Context : + public virtual HUDisplay::CCM_GPS_Context + { + public: + // We will allow the the servant glue code we generate to access + // our states. + friend class GPS_Servant; + + // Ctor. + GPS_Context (::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + GPS_Servant *sv); + + // Dtor. + virtual ~GPS_Context (); + + // Operations for [component name] event source, and + // receptacles defined in CCM_[component name]_Context. + + void push_Ready (HUDisplay::tick_ptr ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for ::Components::CCMContext + virtual ::Components::Principal_ptr + get_caller_principal (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_CCM_home (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual CORBA::Boolean + get_rollback_only (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::IllegalState)); + + virtual ::Components::Transaction::UserTransaction_ptr + get_user_transaction (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::IllegalState)); + + virtual CORBA::Boolean + is_caller_in_role (const char * role + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void + set_rollback_only (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::IllegalState)); + + // Operations for ::Components::SessionContext interface + virtual CORBA::Object_ptr + get_CCM_object (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::IllegalState)); + protected: + // We need to generate, in protected section, stuff that manage + // connections and consumers of this component. + + // Operations for emits interfaces. + + // Operations for publishes interfaces. + ::Components::Cookie_ptr + subscribe_Ready (HUDisplay::tickConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::ExceededConnectionLimit)); + + HUDisplay::tickConsumer_ptr + unsubscribe_Ready (::Components::Cookie_ptr ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::InvalidConnection)); + + ACE_Active_Map_Manager<HUDisplay::tickConsumer_var> ciao_publishes_Ready_map_; + + protected: + /// Cached component home reference. + ::Components::CCMHome_var home_; + + /// session container + ::CIAO::Session_Container *container_; + + /// Reference back to owner. + GPS_Servant *servant_; + + /// @@ Cached component reference. + HUDisplay::GPS_var component_; + }; + + ////////////////////////////////////////////////////////////////// + // Component Servant Glue code implementation + class GPS_SVNT_Export GPS_Servant + : public virtual POA_HUDisplay::GPS, // full skeleton name here + public virtual PortableServer::RefCountServantBase + { + public: + // Ctor. + GPS_Servant (HUDisplay::CCM_GPS_ptr executor, + ::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c); + + // Dtor. + ~GPS_Servant (void); + + // Operations for provides interfaces. + virtual HUDisplay::position_ptr + provide_MyLocation (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for receptacles interfaces. + + // Operations for consumers interfaces. + + // First we need to generate the event sink specific servant + class GPS_SVNT_Export tickConsumer_Refresh_Servant + : public virtual POA_HUDisplay::tickConsumer, // full skeleton name here + public virtual PortableServer::RefCountServantBase + { + public: + // Constructor and destructor. + tickConsumer_Refresh_Servant (HUDisplay::CCM_GPS_ptr executor, + HUDisplay::CCM_GPS_Context_ptr c); + ~tickConsumer_Refresh_Servant (); + + virtual void push_tick (HUDisplay::tick_ptr evt + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Inherit from ::Compopnents::EventBConsumerBase + virtual void push_event (Components::EventBase_ptr ev + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::BadEventType)); + + // get_component implementation. + virtual CORBA::Object_ptr + _get_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + // Consumer Executor + HUDisplay::CCM_GPS_var executor_; + + // Context object. + HUDisplay::CCM_GPS_Context_var ctx_; + }; + + virtual HUDisplay::tickConsumer_ptr + get_consumer_Refresh (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for emits interfaces. + + // Operations for publishes interfaces. + virtual ::Components::Cookie_ptr + subscribe_Ready (HUDisplay::tickConsumer_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::ExceededConnectionLimit)); + + virtual HUDisplay::tickConsumer_ptr + unsubscribe_Ready (::Components::Cookie_ptr ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::InvalidConnection)); + + // Operations for Navigation interface + virtual CORBA::Object_ptr provide_facet (const char * name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException , + Components::InvalidName)) ; + + virtual ::Components::FacetDescriptions * + get_all_facets (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::FacetDescriptions * + get_named_facets (const Components::NameList & names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException , + Components::InvalidName)); + + virtual CORBA::Boolean same_component (CORBA::Object_ptr object_ref + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Operations for Receptacles interface + virtual ::Components::Cookie_ptr connect (const char * name, + CORBA::Object_ptr connection + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::InvalidConnection, + Components::AlreadyConnected, + Components::ExceededConnectionLimit)); + + virtual CORBA::Object_ptr disconnect (const char * name, + Components::Cookie_ptr ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::InvalidConnection, + Components::CookieRequired, + Components::NoConnection)); + + virtual ::Components::ConnectionDescriptions * + get_connections (const char * name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)); + + virtual ::Components::ReceptacleDescriptions * + get_all_receptacles (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ReceptacleDescriptions * + get_named_receptacles (const Components::NameList & names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)); + + // Operations for Events interface + virtual ::Components::EventConsumerBase_ptr + get_consumer (const char * sink_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)); + + virtual ::Components::Cookie_ptr + subscribe (const char * publisher_name, + Components::EventConsumerBase_ptr subscriber + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::InvalidConnection, + Components::ExceededConnectionLimit)); + + virtual ::Components::EventConsumerBase_ptr + unsubscribe (const char * publisher_name, + Components::Cookie_ptr ck + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::InvalidConnection)); + + virtual void connect_consumer (const char * emitter_name, + Components::EventConsumerBase_ptr consumer + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::AlreadyConnected, + Components::InvalidConnection)); + + virtual ::Components::EventConsumerBase_ptr + disconnect_consumer (const char * source_name + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName, + Components::NoConnection)); + + virtual ::Components::ConsumerDescriptions * + get_all_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::ConsumerDescriptions * + get_named_consumers (const Components::NameList & names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)); + + virtual ::Components::EmitterDescriptions * + get_all_emitters (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::EmitterDescriptions * + get_named_emitters (const Components::NameList & names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)); + + virtual ::Components::PublisherDescriptions * + get_all_publishers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PublisherDescriptions * + get_named_publishers (const Components::NameList & names + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidName)); + + // Operations for CCMObject interface + virtual ::CORBA::IRObject_ptr + get_component_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::CCMHome_ptr + get_ccm_home (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::Components::PrimaryKeyBase * + get_primary_key (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::NoKeyAvailable)); + + virtual void configuration_complete (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::InvalidConfiguration)); + + virtual void remove (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::RemoveFailure)); + + virtual ::Components::ComponentPortDescription * + get_all_ports (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // get_component implementation. + virtual CORBA::Object_ptr + _get_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // CIAO specific operations. + + // Activate the object in the container_ + HUDisplay::GPS_ptr + _ciao_activate_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + protected: + // My Executor. + HUDisplay::CCM_GPS_var executor_; + + // My Run-time Context. + GPS_Context *context_; + + // Managing container. + ::CIAO::Session_Container *container_; + + // Cached provided interfaces. + HUDisplay::position_var provide_MyLocation_; + + HUDisplay::tickConsumer_var consumes_Refresh_; + }; + + + ////////////////////////////////////////////////////////////////// + // Component Home Glue code implementation + + // Foreach component home + class GPS_SVNT_Export GPSHome_Servant : + public virtual POA_HUDisplay::GPSHome, // full skeleton name here + public virtual PortableServer::RefCountServantBase + { + public: + // Ctor. + GPSHome_Servant (HUDisplay::CCM_GPSHome_ptr exe, + CIAO::Session_Container *c); + + // Dtor. + ~GPSHome_Servant (void); + + // User defined and inherited operations + + // Factory operations + + // Finder operations + + // Operations for KeylessHome interface + virtual ::Components::CCMObject_ptr + create_component (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)); + + // Operations for Implicit Home interface + virtual HUDisplay::GPS_ptr + create (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)); + + // Operations for CCMHome interface + virtual ::CORBA::IRObject_ptr + get_component_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual ::CORBA::IRObject_ptr + get_home_def (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void remove_component (Components::CCMObject_ptr comp + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::RemoveFailure)); + + protected: + // Helper method for factory operations. + HUDisplay::GPS_ptr + _ciao_create_helper (::Components::EnterpriseComponent_ptr c + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)); + + // My Executor. + HUDisplay::CCM_GPSHome_var executor_; + + // My Container + CIAO::Session_Container *container_; + }; + + extern "C" GPS_SVNT_Export ::PortableServer::Servant + createGPSHome_Servant (::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL_WITH_DEFAULTS); +} + +#if defined (__ACE_INLINE__) +# include "GPS_svnt.inl" +#endif /* __ACE_INLINE__ */ + + +#include "ace/post.h" +#endif /* CIAO_GLUE_SESSION_GPS_SVNT_H */ diff --git a/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.inl b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.inl new file mode 100644 index 00000000000..3cadf2954f3 --- /dev/null +++ b/TAO/CIAO/examples/handcrafted/Display/GPS/GPS_svnt.inl @@ -0,0 +1,220 @@ +// $Id$ -*- C++ -*- + +// The generated filename for files using this template shoule be +// [idl-basename]GS.i GS --> GlueSession + +// @@ Notice: [ciao module name] can expand to either CIAO_GLUE or +// CIAO_GLUE_[module name] as defined in the header file. + +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +/// @@@ Notice that all component and interface names need to be +/// fully qualified as we are creating a new namespace for the CIAO's +/// container glue code. +/// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + +////////////////////////////////////////////////////////////////// +// Component specific context implementation +////////////////////////////////////////////////////////////////// + +ACE_INLINE +CIAO_GLUE_HUDisplay::GPS_Context::GPS_Context (::Components::CCMHome_ptr home, + ::CIAO::Session_Container *c, + CIAO_GLUE_HUDisplay::GPS_Servant *sv) + : home_ (::Components::CCMHome::_duplicate (home)), + container_ (c), + servant_ (sv) +{ +} + +ACE_INLINE +CIAO_GLUE_HUDisplay::GPS_Context::~GPS_Context () +{ +} + +// Operations for emits interfaces. + +// Operations for ::Components::CCMContext +ACE_INLINE ::Components::Principal_ptr +CIAO_GLUE_HUDisplay::GPS_Context::get_caller_principal (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // @@ We don't support Security in CIAO yet. + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + +ACE_INLINE ::Components::CCMHome_ptr +CIAO_GLUE_HUDisplay::GPS_Context::get_CCM_home (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return ::Components::CCMHome::_duplicate (this->home_.in ()); +} + +ACE_INLINE CORBA::Boolean +CIAO_GLUE_HUDisplay::GPS_Context::get_rollback_only (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::IllegalState)) +{ + // @@ We don't support Transaction in CIAO yet. + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + +ACE_INLINE ::Components::Transaction::UserTransaction_ptr +CIAO_GLUE_HUDisplay::GPS_Context::get_user_transaction (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::IllegalState)) +{ + // @@ We don't support Transaction in CIAO yet. + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + +ACE_INLINE CORBA::Boolean +CIAO_GLUE_HUDisplay::GPS_Context::is_caller_in_role (const char * role + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_UNUSED_ARG (role); + + // @@ We don't support Transaction in CIAO yet. + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + +ACE_INLINE void +CIAO_GLUE_HUDisplay::GPS_Context::set_rollback_only (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::IllegalState)) +{ + // @@ We don't support Transaction in CIAO yet. + ACE_THROW (CORBA::NO_IMPLEMENT ()); +} + +////////////////////////////////////////////////////////////////// +// Component Servant Glue code implementation +////////////////////////////////////////////////////////////////// + +ACE_INLINE +CIAO_GLUE_HUDisplay::GPS_Servant::GPS_Servant (HUDisplay::CCM_GPS_ptr exe, + ::Components::CCMHome_ptr h, + ::CIAO::Session_Container *c) + : executor_ (HUDisplay::CCM_GPS::_duplicate (exe)), + container_ (c) +{ + this->context_ = new CIAO_GLUE_HUDisplay::GPS_Context (h, c, this); +} + +ACE_INLINE +CIAO_GLUE_HUDisplay::GPS_Servant::~GPS_Servant (void) +{ + this->context_->_remove_ref (); +} + +////////////////////////////////////////////////////////////////// +// EventConsumer Glue Code implementation +// @@ We are assuming that these consumers are declared under the same +// module as the component (thus, we are placing this glue code +// here under the same namespace. If they are not, we will +// either be generating them in separate namespaces, or include +// some other CIDL generated files to get the glue code +// implementation. +////////////////////////////////////////////////////////////////// + +// Constructor and destructor. +ACE_INLINE +CIAO_GLUE_HUDisplay::GPS_Servant::tickConsumer_Refresh_Servant::tickConsumer_Refresh_Servant + (HUDisplay::CCM_GPS_ptr executor, + HUDisplay::CCM_GPS_Context_ptr c) + : executor_ (HUDisplay::CCM_GPS::_duplicate (executor)), + ctx_ (HUDisplay::CCM_GPS_Context::_duplicate (c)) +{ +} + +ACE_INLINE +CIAO_GLUE_HUDisplay::GPS_Servant::tickConsumer_Refresh_Servant::~tickConsumer_Refresh_Servant () +{ +} + +ACE_INLINE CORBA::Object_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::tickConsumer_Refresh_Servant::_get_component (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + return this->ctx_->get_CCM_object (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +ACE_INLINE void +CIAO_GLUE_HUDisplay::GPS_Servant::tickConsumer_Refresh_Servant::push_tick + (HUDisplay::tick_ptr evt + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + this->executor_->push_Refresh (evt + ACE_ENV_ARG_PARAMETER); +} + +// Operations for emits interfaces. + +// Operations for publishes interfaces. +ACE_INLINE ::Components::Cookie_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::subscribe_Ready (HUDisplay::tickConsumer_ptr c + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::ExceededConnectionLimit)) +{ + return this->context_->subscribe_Ready (c + ACE_ENV_ARG_PARAMETER); +} + +ACE_INLINE HUDisplay::tickConsumer_ptr +CIAO_GLUE_HUDisplay::GPS_Servant::unsubscribe_Ready (::Components::Cookie_ptr ck + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + ::Components::InvalidConnection)) +{ + return this->context_->unsubscribe_Ready (ck + ACE_ENV_ARG_PARAMETER); +} + +////////////////////////////////////////////////////////////////// +// Component Home Glue code implementation +////////////////////////////////////////////////////////////////// + +ACE_INLINE +CIAO_GLUE_HUDisplay::GPSHome_Servant::GPSHome_Servant (HUDisplay::CCM_GPSHome_ptr exe, + CIAO::Session_Container *c) + : executor_ (HUDisplay::CCM_GPSHome::_duplicate (exe)), + container_ (c) +{ +} + +ACE_INLINE +CIAO_GLUE_HUDisplay::GPSHome_Servant::~GPSHome_Servant (void) +{ +} + +// Operations for KeylessHome interface +ACE_INLINE ::Components::CCMObject_ptr +CIAO_GLUE_HUDisplay::GPSHome_Servant::create_component (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException, + Components::CreateFailure)) +{ + // Simply forward to the create method. + return this->create (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +// Operations for CCMHome interface +ACE_INLINE ::CORBA::IRObject_ptr +CIAO_GLUE_HUDisplay::GPSHome_Servant::get_component_def (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // @@ TO-DO. Contact IfR? + + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} + +ACE_INLINE CORBA::IRObject_ptr +CIAO_GLUE_HUDisplay::GPSHome_Servant::get_home_def (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // @@ TO-DO. Contact IfR? + + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); +} diff --git a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.idl b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.idl index edfe9b360ad..3570fd42de7 100644 --- a/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.idl +++ b/TAO/CIAO/examples/handcrafted/Display/NavDisplay/NavDisplay.idl @@ -15,7 +15,7 @@ module HUDisplay component navDisplay { consumes tick Refresh; - uses position GetLocation; + uses position GPSLocation; }; home NavDisplayHome manages NavDisplay diff --git a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.h b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.h index d786c57372e..cda3caf507f 100644 --- a/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.h +++ b/TAO/CIAO/examples/handcrafted/Display/RateGen/RateGen_svnt.h @@ -366,6 +366,11 @@ namespace CIAO_GLUE_HUDisplay // My Container CIAO::Session_Container *container_; }; + + extern "C" RATEGEN_SVNT_Export ::PortableServer::Servant + createRateGenHome_Servant (::Components::HomeExecutorBase_ptr p, + CIAO::Session_Container *c + ACE_ENV_ARG_DECL_WITH_DEFAULTS); } #if defined (__ACE_INLINE__) |