diff options
author | msmit <msmit@remedy.nl> | 2010-09-23 12:24:57 +0000 |
---|---|---|
committer | msmit <msmit@remedy.nl> | 2010-09-23 12:24:57 +0000 |
commit | 81d2cec351b4613a52995c8991f532951d98cbca (patch) | |
tree | 594ec8d2e0855fb9f551e888feadbf6b6b028bad /CIAO/ciao/Servants | |
parent | b238f35e22903836f912af4d652913b91224f0d9 (diff) | |
download | ATCD-81d2cec351b4613a52995c8991f532951d98cbca.tar.gz |
Thu Sep 23 12:28:23 UTC 2010 Marcel Smit <msmit@remedy.nl>
* ciao/Servants/Servant_Impl_Base.h:
* ciao/Servants/Servant_Impl_Base.cpp:
* tests/CIF/Navigation/client.cpp:
Implemented get_named_emitters
Diffstat (limited to 'CIAO/ciao/Servants')
-rw-r--r-- | CIAO/ciao/Servants/Servant_Impl_Base.cpp | 63 | ||||
-rw-r--r-- | CIAO/ciao/Servants/Servant_Impl_Base.h | 5 |
2 files changed, 66 insertions, 2 deletions
diff --git a/CIAO/ciao/Servants/Servant_Impl_Base.cpp b/CIAO/ciao/Servants/Servant_Impl_Base.cpp index 97e96e33cb7..d65100d5f49 100644 --- a/CIAO/ciao/Servants/Servant_Impl_Base.cpp +++ b/CIAO/ciao/Servants/Servant_Impl_Base.cpp @@ -187,10 +187,34 @@ namespace CIAO #if !defined (CCM_LW) ::Components::EmitterDescriptions * Servant_Impl_Base::get_named_emitters ( - const ::Components::NameList & /* names */) + const ::Components::NameList & names) { CIAO_TRACE("Servant_Impl_Base::get_named_emitters"); - throw CORBA::NO_IMPLEMENT (); + ::Components::EmitterDescriptions_var retval; + ACE_NEW_THROW_EX (retval, + ::Components::EmitterDescriptions, + ::CORBA::NO_MEMORY ()); + + retval->length (names.length ()); + ::CORBA::ULong count = 0UL; + + for (::CORBA::ULong name = 0UL; + name < names.length (); + ++name) + { + ::Components::EmitterDescription * desc = + this->lookup_emitter_description (names[name].in ()); + if (desc) + { + retval[count++] = desc; + } + else + { + throw ::Components::InvalidName (); + } + } + ::Components::EmitterDescriptions_var safe_retval = retval; + return safe_retval._retn (); } #endif @@ -361,5 +385,40 @@ namespace CIAO return 0; } #endif +#if !defined (CCM_LW) + ::Components::EmitterDescription * + Servant_Impl_Base::lookup_emitter_description (const char *emitter_name) + { + CIAO_TRACE("Servant_Impl_Base::lookup_emitter_description"); + + ::Components::EmitterDescriptions_var all_emitters = + this->get_all_emitters (); + + if (!emitter_name || all_emitters->length () == 0) + { + // Calling function will throw InvalidName after getting this. + return 0; + } + for (::CORBA::ULong emitter = 0; + emitter < all_emitters->length (); + ++emitter) + { + ::Components::EmitterDescription *emitter_desc = + all_emitters[emitter]; + if (::ACE_OS::strcmp (emitter_name, emitter_desc->name ()) == 0) + { + ::Components::EmitterDescription *ed = 0; + + ACE_NEW_THROW_EX (ed, + ::OBV_Components::EmitterDescription (), + CORBA::NO_MEMORY ()); + ::Components::EmitterDescription_var safe = ed; + return safe._retn (); + } + } + return 0; + } +#endif + } diff --git a/CIAO/ciao/Servants/Servant_Impl_Base.h b/CIAO/ciao/Servants/Servant_Impl_Base.h index d0117fc5510..c9286e9ce58 100644 --- a/CIAO/ciao/Servants/Servant_Impl_Base.h +++ b/CIAO/ciao/Servants/Servant_Impl_Base.h @@ -118,6 +118,11 @@ namespace CIAO lookup_publisher_description (const char *publisher_name); #endif +#if !defined (CCM_LW) + ::Components::EmitterDescription * + lookup_emitter_description(const char* emitter_name); +#endif + protected: typedef ACE_Array_Map<ACE_CString, ::Components::EventConsumerBase_var> |