From b536cc163fb2cb2ebb31e1bf7514a353e143a133 Mon Sep 17 00:00:00 2001 From: wilson_d Date: Mon, 1 Mar 2004 18:35:43 +0000 Subject: ChangeLogTag: Mon Mar 1 12:31:38 2004 Dale Wilson --- TAO/ChangeLog | 9 +++++++ .../PortableGroup/PG_Properties_Encoder.cpp | 11 +++++--- .../orbsvcs/PortableGroup/PG_Properties_Encoder.h | 31 ++++++++++++++++++++-- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 6887b413fe4..5b8e5ba7a67 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,12 @@ +Mon Mar 1 12:31:38 2004 Dale Wilson + + * orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.h: + * orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.cpp: + ACE_Pair cannot contain CORBA::Any due to missing operator + != on Any (and fool compilers that expand unused template + methods (LynxOs; gcc version 2.9-gnupro-98r2)) + Hand-code a simple pair to replace ACE_Pair in this case. + Sun Feb 29 22:10:00 2004 Balachandran Natarajan * tao/Environment.i (release ()): diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.cpp index ab025e59469..733c7e57f17 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.cpp @@ -13,6 +13,11 @@ //============================================================================= #include "PG_Properties_Encoder.h" + +#if ! defined (__ACE_INLINE__) +#include "PG_Properties_Encoder.inl" +#endif /* ! __ACE_INLINE__ */ + ////////// // Properties_Encoder TAO_PG::Properties_Encoder::Properties_Encoder () @@ -45,7 +50,7 @@ void TAO_PG::Properties_Encoder::encode ( PortableGroup::Name & nsName = property.nam; PortableGroup::Value & anyValue = property.val; // assign the value - anyValue = (nv.second()); + anyValue = (nv.value_); // assign the name // @@: This restricts the name to a single level with no "kind" @@ -53,15 +58,13 @@ void TAO_PG::Properties_Encoder::encode ( nsName.length(1); CosNaming::NameComponent & nc = nsName[0]; - nc.id = CORBA::string_dup (nv.first().c_str()); + nc.id = CORBA::string_dup (nv.name_.c_str()); // nc.kind defaults to empty. Leave it that way (for now) } } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - template class ACE_Pair< ACE_CString, PortableGroup::Value>; template class ACE_Vector< TAO_PG::Properties_Encoder::NamedValue, 10 >; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -# pragma instantiate ACE_Pair< ACE_CString, PortableGroup::Value> # pragma instantiate ACE_Vector< TAO_PG::Properties_Encoder::NamedValue, 10 > #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.h b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.h index 31f1a7bc1a8..a44f8f08cf3 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.h +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Properties_Encoder.h @@ -12,12 +12,18 @@ //============================================================================= #ifndef TAO_PG_PROPERTIES_ENCODER_H #define TAO_PG_PROPERTIES_ENCODER_H + +#include /**/ "ace/pre.h" +#include +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "orbsvcs/orbsvcs/PortableGroupS.h" #include "orbsvcs/orbsvcs/CosNamingC.h" #include "portablegroup_export.h" #include "ace/Vector_T.h" -#include "ace/Pair_T.h" #include "ace/SString.h" namespace TAO_PG @@ -34,7 +40,24 @@ namespace TAO_PG */ class TAO_PortableGroup_Export Properties_Encoder { - typedef ACE_Pair< ACE_CString, PortableGroup::Value> NamedValue; + // Originally NamedValue was an ACE_Pair, but ACE_Pair allows operator == + // (delegating to the member's operators ==.) Since CORBA::Any does + // not support operator ==, this confused gcc version 2.9-gnupro-98r2 + // on LynxOS pfadev04 3.0.1 110298-G PowerPC + struct NamedValue + { + public: + ACE_CString name_; + PortableGroup::Value value_; + NamedValue (); + NamedValue (const ACE_CString & name, const PortableGroup::Value & value); + NamedValue (const NamedValue & rhs); + NamedValue & operator = (const NamedValue & rhs); + /// Meaningless method to keep ACE_Vector happy + bool operator == (const NamedValue &rhs) const; + /// Meaningless method to keep ACE_Vector happy + bool operator != (const NamedValue &rhs) const; + }; typedef ACE_Vector< NamedValue, 10 > NamedValueVec; public: @@ -66,4 +89,8 @@ namespace TAO_PG } //namespace TAO_PG +#if defined (__ACE_INLINE__) +#include "PG_Properties_Encoder.inl" +#endif /* __ACE_INLINE__ */ +#include /**/ "ace/post.h" #endif // TAO_PG_PROPERTIES_ENCODER_H -- cgit v1.2.1