#include <PropertySeq.h>
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 for property <name>. Returns 0 on success. | |
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.
typedef ACE_Hash_Map_Manager<ACE_CString, CosNotification::PropertyValue, ACE_SYNCH_NULL_MUTEX> TAO_Notify_PropertySeq::PROPERTY_MAP [protected] |
Property Map.
Definition at line 64 of file PropertySeq.h.
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.
{ int ret = this->property_map_.rebind (name, val); ACE_ASSERT(ret >= 0); ACE_UNUSED_ARG (ret); // because the assert disappears in release builds }
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.
{ ACE_CString str_name (name); return this->property_map_.find (str_name, value); }
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.
{ ACE_CString name; for (CORBA::ULong i = 0; i < prop_seq.length (); ++i) { name = prop_seq[i].name.in (); if (this->property_map_.rebind (name, prop_seq[i].value) == -1) return -1; } // Note call to rebind. This allows to call <init> to set updates. return 0; }
int TAO_Notify_PropertySeq::populate | ( | CosNotification::PropertySeq_var & | prop_seq | ) | const |
Return -1 on error.
Definition at line 39 of file PropertySeq.cpp.
{ PROPERTY_MAP::CONST_ITERATOR iterator (this->property_map_); int index = prop_seq->length (); prop_seq->length (static_cast<CORBA::ULong> (index + this->property_map_.current_size ())); for (PROPERTY_MAP::ENTRY *entry = 0; iterator.next (entry) != 0; iterator.advance (), ++index) { (*prop_seq)[index].name = CORBA::string_dup (entry->ext_id_.c_str ()); (*prop_seq)[index].value = entry->int_id_; } return 0; }
size_t TAO_Notify_PropertySeq::size | ( | void | ) | const |
return the number of properties available as a sequence
Definition at line 17 of file PropertySeq.inl.
{ return this->property_map_.current_size(); }
PROPERTY_MAP TAO_Notify_PropertySeq::property_map_ [protected] |
Definition at line 66 of file PropertySeq.h.