#include <PG_Properties_Encoder.h>
Collaboration diagram for TAO_PG::Properties_Encoder:
Public Member Functions | |
Properties_Encoder () | |
~Properties_Encoder () | |
standard destructor | |
void | add (const char *name, const PortableGroup::Value &value) |
void | encode (PortableGroup::Properties *property_set) const |
Private Types | |
typedef ACE_Vector< NamedValue, 10 > | NamedValueVec |
Private Member Functions | |
Properties_Encoder (const Properties_Encoder &rhs) | |
Properties_Encoder & | operator= (const Properties_Encoder &rhs) |
Private Attributes | |
NamedValueVec | values_ |
To use a Properties_Encoder: Create it. Add properties to it using the add method. Allocate a new PortableGroup::Properties. Use the encode method to transfer the properties into the PortableGroup::Properties.
Definition at line 44 of file PG_Properties_Encoder.h.
|
Definition at line 64 of file PG_Properties_Encoder.h. |
|
Construct an empty set of properties. Definition at line 24 of file PG_Properties_Encoder.cpp.
00025 { 00026 } |
|
standard destructor
Definition at line 28 of file PG_Properties_Encoder.cpp.
00029 { 00030 } |
|
|
|
add a name/value property to the Properties_Encoder. Definition at line 33 of file PG_Properties_Encoder.cpp. References ACE_Vector< T, DEFAULT_SIZE >::push_back(), PortableGroup::Value, and values_.
|
|
Encode all properties in this Properties_Encoder into a PortableGroup::Properties. Definition at line 41 of file PG_Properties_Encoder.cpp. References ACE_ASSERT, PortableGroup::Property::nam, TAO_PG::Properties_Encoder::NamedValue::name_, PortableGroup::Properties, ACE_Vector< T, DEFAULT_SIZE >::size(), CORBA::string_dup(), PortableGroup::Property::val, PortableGroup::Value, TAO_PG::Properties_Encoder::NamedValue::value_, and values_.
00043 { 00044 ACE_ASSERT (property_set != 0); 00045 size_t count = values_.size(); 00046 property_set->length(count); 00047 for( size_t nItem = 0; nItem < count; ++nItem ) 00048 { 00049 const NamedValue & nv = values_[nItem]; 00050 PortableGroup::Property & property = (*property_set)[nItem]; 00051 PortableGroup::Name & nsName = property.nam; 00052 PortableGroup::Value & anyValue = property.val; 00053 // assign the value 00054 anyValue = (nv.value_); 00055 00056 // assign the name 00057 // @@: This restricts the name to a single level with no "kind" 00058 // @@: remove this restriction (?) 00059 nsName.length(1); 00060 CosNaming::NameComponent & nc = nsName[0]; 00061 00062 nc.id = CORBA::string_dup (nv.name_.c_str()); 00063 // nc.kind defaults to empty. Leave it that way (for now) 00064 } 00065 } |
|
|
|
Definition at line 90 of file PG_Properties_Encoder.h. |