Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

CORBA_NamedValue Class Reference

NamedValue ... 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. More...

#include <NVList.h>

List of all members.

Public Types

typedef CORBA_NamedValue_ptr _ptr_type
typedef CORBA_NamedValue_var _var_type

Public Methods

const char * name (void) const
 optional name. More...

CORBA::Any_ptr value (void) const
 return the value. More...

CORBA::Flags flags (void) const
 return the parameter mode flag. More...

 ~CORBA_NamedValue (void)
 destructor - manages the name and value. More...

CORBA::ULong _incr_refcnt (void)
CORBA::ULong _decr_refcnt (void)

Static Public Methods

CORBA_NamedValue * _duplicate (CORBA_NamedValue *)
CORBA_NamedValue * _nil (void)

Private Methods

 CORBA_NamedValue (void)
 private constructor. Cannot be directly instantiated other than by its friends. More...


Private Attributes

CORBA::ULong refcount_
 maintains how many references exist to this object. More...

TAO_SYNCH_MUTEX refcount_lock_
 Protects the reference count. More...

CORBA::Any any_
 holds the value. More...

CORBA::Flags flags_
 parameter mode flags. More...

char * name_
 optional IDL name of the parameter. More...


Friends

class CORBA_ORB
class CORBA_NVList
class CORBA_Request


Detailed Description

NamedValue ... 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 41 of file NVList.h.


Member Typedef Documentation

typedef CORBA_NamedValue_ptr CORBA_NamedValue::_ptr_type
 

Definition at line 66 of file NVList.h.

typedef CORBA_NamedValue_var CORBA_NamedValue::_var_type
 

Definition at line 67 of file NVList.h.


Constructor & Destructor Documentation

CORBA_NamedValue::~CORBA_NamedValue void   
 

destructor - manages the name and value.

Definition at line 46 of file NVList.cpp.

References name_, and CORBA::string_free.

00047 {
00048   if (this->name_)
00049     {
00050       CORBA::string_free (this->name_);
00051       this->name_ = 0;
00052     }
00053   // the any will be destroyed by itself
00054 }

ACE_INLINE CORBA_NamedValue::CORBA_NamedValue void    [private]
 

private constructor. Cannot be directly instantiated other than by its friends.

Definition at line 19 of file NVList.i.

00020   : refcount_ (1),
00021     flags_ (0),
00022     name_ (0)
00023 {
00024 }


Member Function Documentation

CORBA::ULong CORBA_NamedValue::_decr_refcnt void   
 

Definition at line 33 of file NVList.cpp.

References ACE_GUARD_RETURN, refcount_, and TAO_SYNCH_MUTEX.

00034 {
00035   {
00036     ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->refcount_lock_, 0);
00037     this->refcount_--;
00038     if (this->refcount_ != 0)
00039       return this->refcount_;
00040   }
00041 
00042   delete this;
00043   return 0;
00044 }

ACE_INLINE CORBA_NamedValue * CORBA_NamedValue::_duplicate CORBA_NamedValue *    [static]
 

Definition at line 48 of file NVList.i.

References _incr_refcnt.

Referenced by CORBA_NamedValue_out::operator=, and CORBA_NamedValue_var::operator=.

00049 {
00050   if (x != 0)
00051     x->_incr_refcnt ();
00052   return x;
00053 }

CORBA::ULong CORBA_NamedValue::_incr_refcnt void   
 

Definition at line 26 of file NVList.cpp.

References ACE_GUARD_RETURN, refcount_, and TAO_SYNCH_MUTEX.

Referenced by _duplicate.

00027 {
00028   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->refcount_lock_, 0);
00029   return this->refcount_++;
00030 }

ACE_INLINE CORBA_NamedValue * CORBA_NamedValue::_nil void    [static]
 

Definition at line 56 of file NVList.i.

Referenced by CORBA_NamedValue_var::_retn, CORBA_NamedValue_out::CORBA_NamedValue_out, and CORBA_NamedValue_var::out.

00057 {
00058   return 0;
00059 }

ACE_INLINE CORBA::Flags CORBA_NamedValue::flags void    const
 

return the parameter mode flag.

Definition at line 42 of file NVList.i.

References flags_.

00043 {
00044   return this->flags_;
00045 }

ACE_INLINE const char * CORBA_NamedValue::name void    const
 

optional name.

Definition at line 28 of file NVList.i.

References name_.

Referenced by CORBA_NVList::_tao_encode.

00029 {
00030   return this->name_;
00031 }

ACE_INLINE CORBA::Any_ptr CORBA_NamedValue::value void    const
 

return the value.

Definition at line 35 of file NVList.i.

Referenced by CORBA_NVList::_tao_encode.

00036 {
00037   return ACE_const_cast (CORBA::Any_ptr, &this->any_);
00038 }


Friends And Related Function Documentation

friend class CORBA_NVList [friend]
 

Definition at line 91 of file NVList.h.

friend class CORBA_ORB [friend]
 

Definition at line 90 of file NVList.h.

friend class CORBA_Request [friend]
 

Definition at line 92 of file NVList.h.


Member Data Documentation

CORBA::Any CORBA_NamedValue::any_ [private]
 

holds the value.

Definition at line 78 of file NVList.h.

CORBA::Flags CORBA_NamedValue::flags_ [private]
 

parameter mode flags.

Definition at line 81 of file NVList.h.

Referenced by flags.

char* CORBA_NamedValue::name_ [private]
 

optional IDL name of the parameter.

Definition at line 84 of file NVList.h.

Referenced by name, and ~CORBA_NamedValue.

CORBA::ULong CORBA_NamedValue::refcount_ [private]
 

maintains how many references exist to this object.

Definition at line 72 of file NVList.h.

Referenced by _decr_refcnt, and _incr_refcnt.

TAO_SYNCH_MUTEX CORBA_NamedValue::refcount_lock_ [private]
 

Protects the reference count.

Definition at line 75 of file NVList.h.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 14:58:58 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002