#include <PropertySeq.h>
Inheritance diagram for TAO_Notify_PropertySeq:
Public Member Functions | |
TAO_Notify_PropertySeq (void) | |
Constructor. | |
~TAO_Notify_PropertySeq () | |
Destructor. | |
int | init (const CosNotification::PropertySeq &prop_seq) |
Return 0 on success, -1 on error. | |
int | find (const char *name, CosNotification::PropertyValue &value) const |
Find the | |
int | populate (CosNotification::PropertySeq_var &prop_seq) const |
Return -1 on error. | |
size_t | size () const |
return the number of properties available as a sequence | |
Protected Types | |
typedef ACE_Hash_Map_Manager< ACE_CString, CosNotification::PropertyValue, ACE_SYNCH_NULL_MUTEX > | PROPERTY_MAP |
Property Map. | |
Protected Member Functions | |
void | add (const ACE_CString &name, const CORBA::Any &val) |
Protected Attributes | |
PROPERTY_MAP | property_map_ |
Definition at line 36 of file PropertySeq.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Notify_PropertySeq::TAO_Notify_PropertySeq | ( | void | ) |
TAO_Notify_PropertySeq::~TAO_Notify_PropertySeq | ( | ) |
void TAO_Notify_PropertySeq::add | ( | const ACE_CString & | name, | |
const CORBA::Any & | val | |||
) | [protected] |
Add the value. Used by subclasses to initialize the property map from their member variables.
Definition at line 58 of file PropertySeq.cpp.
References ACE_ASSERT, property_map_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind().
Referenced by TAO_Notify_QoSProperties::init(), and TAO_Notify_AdminProperties::init().
00059 { 00060 int ret = this->property_map_.rebind (name, val); 00061 ACE_ASSERT(ret >= 0); 00062 ACE_UNUSED_ARG (ret); // because the assert disappears in release builds 00063 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int TAO_Notify_PropertySeq::find | ( | const char * | name, | |
CosNotification::PropertyValue & | value | |||
) | const |
Find the
for property <name>. Returns 0 on success.
Definition at line 8 of file PropertySeq.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find(), and property_map_.
Referenced by TAO_Notify_StructProperty_T< TYPE >::set(), TAO_Notify_Property_T< TYPE >::set(), and TAO_Notify_Property_Boolean::set().
00010 { 00011 ACE_CString str_name (name); 00012 return this->property_map_.find (str_name, value); 00013 }
int TAO_Notify_PropertySeq::init | ( | const CosNotification::PropertySeq & | prop_seq | ) |
Return 0 on success, -1 on error.
Reimplemented in TAO_Notify_AdminProperties.
Definition at line 22 of file PropertySeq.cpp.
Referenced by TAO_Notify_AdminProperties::init().
00023 { 00024 ACE_CString name; 00025 00026 for (CORBA::ULong i = 0; i < prop_seq.length (); ++i) 00027 { 00028 name = prop_seq[i].name.in (); 00029 00030 if (this->property_map_.rebind (name, prop_seq[i].value) == -1) 00031 return -1; 00032 } 00033 // Note call to rebind. This allows to call <init> to set updates. 00034 00035 return 0; 00036 }
int TAO_Notify_PropertySeq::populate | ( | CosNotification::PropertySeq_var & | prop_seq | ) | const |
Return -1 on error.
Definition at line 39 of file PropertySeq.cpp.
References CORBA::string_dup().
Referenced by TAO_Notify_EventChannel::get_admin(), and TAO_Notify_Object::get_qos().
00040 { 00041 PROPERTY_MAP::CONST_ITERATOR iterator (this->property_map_); 00042 00043 int index = prop_seq->length (); 00044 prop_seq->length (static_cast<CORBA::ULong> (index + this->property_map_.current_size ())); 00045 00046 for (PROPERTY_MAP::ENTRY *entry = 0; 00047 iterator.next (entry) != 0; 00048 iterator.advance (), ++index) 00049 { 00050 (*prop_seq)[index].name = CORBA::string_dup (entry->ext_id_.c_str ()); 00051 (*prop_seq)[index].value = entry->int_id_; 00052 } 00053 00054 return 0; 00055 }
ACE_INLINE size_t TAO_Notify_PropertySeq::size | ( | ) | const |
return the number of properties available as a sequence
Definition at line 17 of file PropertySeq.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::current_size(), and property_map_.
00018 { 00019 return this->property_map_.current_size(); 00020 }
PROPERTY_MAP TAO_Notify_PropertySeq::property_map_ [protected] |
Definition at line 66 of file PropertySeq.h.
Referenced by add(), TAO_Notify_QoSProperties::copy(), find(), size(), and TAO_Notify_QoSProperties::transfer().