CORBA Name/value pair implementation. More...
#include <NVList.h>
Public Types | |
typedef NamedValue_ptr | _ptr_type |
typedef NamedValue_var | _var_type |
typedef NamedValue_out | _out_type |
Public Member Functions | |
const char * | name (void) const |
optional name | |
Any_ptr | value (void) const |
return the value | |
Flags | flags (void) const |
return the parameter mode flag | |
ULong | _incr_refcnt (void) |
ULong | _decr_refcnt (void) |
Static Public Member Functions | |
static NamedValue * | _duplicate (NamedValue *) |
static NamedValue * | _nil (void) |
Public Attributes | |
Identifier | name |
any | argument |
long | len |
Flags | arg_modes |
Protected Member Functions | |
~NamedValue (void) | |
Destructor. | |
Private Member Functions | |
NamedValue (void) | |
Private Attributes | |
ACE_Atomic_Op< TAO_SYNCH_MUTEX, unsigned long > | refcount_ |
Reference counter. | |
Any | any_ |
holds the value | |
Flags | flags_ |
parameter mode flags | |
char * | name_ |
optional IDL name of the parameter | |
Friends | |
class | ::TAO_NVList_Adapter_Impl |
class | NVList |
class | Request |
CORBA Name/value pair implementation.
These occur only in "NVList" (named value list) data structures. The binary form of the data structure is frozen and visible to programs using it (e.g. from C). The C++ class supports some programming discipline, e.g. to avoid memory leaks. They just represent parameters to calls. The name is optional, and the value is packaged as an Any. The flags indicate parameter mode, and some ownership rules for "top level" memory.
Definition at line 79 of file NVList.h.
CORBA::NamedValue::~NamedValue | ( | void | ) | [protected] |
Destructor.
Protected destructor to enforce proper memory management through the reference counting mechanism.
Definition at line 50 of file NVList.cpp.
{ if (this->name_) { CORBA::string_free (this->name_); this->name_ = 0; } // the any will be destroyed by itself }
CORBA::NamedValue::NamedValue | ( | void | ) | [private] |
private constructor. Cannot be directly instantiated other than by its friends.
Definition at line 23 of file NVList.inl.
CORBA::ULong CORBA::NamedValue::_decr_refcnt | ( | void | ) |
Definition at line 40 of file NVList.cpp.
{ CORBA::ULong const new_count = --this->refcount_; if (new_count == 0) delete this; return new_count; }
CORBA::NamedValue * CORBA::NamedValue::_duplicate | ( | CORBA::NamedValue * | x | ) | [static] |
Definition at line 53 of file NVList.inl.
{ if (x != 0) { x->_incr_refcnt (); } return x; }
CORBA::ULong CORBA::NamedValue::_incr_refcnt | ( | void | ) |
Definition at line 34 of file NVList.cpp.
{ return ++this->refcount_; }
CORBA::NamedValue * CORBA::NamedValue::_nil | ( | void | ) | [static] |
Definition at line 65 of file NVList.inl.
{
return 0;
}
CORBA::Flags CORBA::NamedValue::flags | ( | void | ) | const |
const char* CORBA::NamedValue::name | ( | void | ) | const |
optional name
CORBA::Any_ptr CORBA::NamedValue::value | ( | void | ) | const |
return the value
Definition at line 39 of file NVList.inl.
{ return const_cast<CORBA::Any_ptr> (&this->any_); }
friend class ::TAO_NVList_Adapter_Impl [friend] |
Any CORBA::NamedValue::any_ [private] |
Flags CORBA::NamedValue::flags_ [private] |
const char * CORBA::NamedValue::name |
char* CORBA::NamedValue::name_ [private] |
ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> CORBA::NamedValue::refcount_ [private] |