Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Friends

CORBA::NamedValue Class Reference

CORBA Name/value pair implementation. More...

#include <NVList.h>

Collaboration diagram for CORBA::NamedValue:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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.


Member Typedef Documentation

Definition at line 106 of file NVList.h.

Definition at line 104 of file NVList.h.

Definition at line 105 of file NVList.h.


Constructor & Destructor Documentation

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.

  : refcount_ (1),
    flags_ (0),
    name_ (0)
{
}


Member Function Documentation

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

return the parameter mode flag

Definition at line 46 of file NVList.inl.

{
  return this->flags_;
}

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_);
}


Friends And Related Function Documentation

friend class ::TAO_NVList_Adapter_Impl [friend]

Definition at line 81 of file NVList.h.

friend class NVList [friend]

Definition at line 82 of file NVList.h.

friend class Request [friend]

Definition at line 83 of file NVList.h.


Member Data Documentation

holds the value

Definition at line 129 of file NVList.h.

Definition at line 45 of file orb.idl.

Definition at line 43 of file orb.idl.

parameter mode flags

Definition at line 132 of file NVList.h.

Definition at line 44 of file orb.idl.

Definition at line 42 of file orb.idl.

char* CORBA::NamedValue::name_ [private]

optional IDL name of the parameter

Definition at line 135 of file NVList.h.

ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> CORBA::NamedValue::refcount_ [private]

Reference counter.

Definition at line 126 of file NVList.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines