CORBA::ContextList Class Reference

ContextList definition taken from CORBA v2.3a Dec 1998. More...

#include <Context.h>

Collaboration diagram for CORBA::ContextList:

Collaboration graph
[legend]
List of all members.

Public Types

typedef CORBA::ContextList_ptr _ptr_type
typedef CORBA::ContextList_var _var_type
typedef CORBA::ContextList_out _out_type

Public Member Functions

 ContextList (void)
 Constructor.

 ContextList (CORBA::ULong len, char **ctx_list)
 ~ContextList (void)
 Destructor.

CORBA::ULong count (void)
 Return the number of elements.

ContextList_ptr _duplicate (void)
 Increment the reference count.

void _destroy (void)
 Decrement the reference count and delete if it is 0.

void add (char *ctx)
 Add a string to the list.

void add_consume (char *ctx)
 Add and consume a string to the list.

char * item (CORBA::ULong slot)
 Return the typecode at slot i. Raises the "Bounds" exception.

void remove (CORBA::ULong slot)
 Remove the typecode at slot i. Raises the "Bounds" exception.

void _incr_refcnt (void)
 Increment and decrement ref counts.

void _decr_refcnt (void)

Static Public Member Functions

ContextList_ptr _duplicate (ContextList *)
 Increment the reference count.

ContextList_ptr _nil ()
 Return null pointer of this type.


Private Member Functions

 ContextList (const ContextList &)
ContextListoperator= (const ContextList &)

Private Attributes

ACE_Atomic_Op< TAO_SYNCH_MUTEX,
CORBA::ULong
ref_count_
 Reference counter.

ACE_Unbounded_Queue< char * > ctx_list_
 Internal list of typecodes.


Detailed Description

ContextList definition taken from CORBA v2.3a Dec 1998.

Maintains a list of strings for Contexts.

Definition at line 136 of file Context.h.


Member Typedef Documentation

typedef CORBA::ContextList_out CORBA::ContextList::_out_type
 

Definition at line 186 of file Context.h.

typedef CORBA::ContextList_ptr CORBA::ContextList::_ptr_type
 

Definition at line 184 of file Context.h.

typedef CORBA::ContextList_var CORBA::ContextList::_var_type
 

Definition at line 185 of file Context.h.


Constructor & Destructor Documentation

ACE_INLINE CORBA::ContextList::ContextList void   ) 
 

Constructor.

Definition at line 67 of file Context.inl.

00068 {
00069 }

CORBA::ContextList::ContextList CORBA::ULong  len,
char **  ctx_list
 

Constructor - initialize given a length and an array of strings.

Definition at line 107 of file Context.cpp.

References add().

00109   : ref_count_ (1)
00110 {
00111   for (CORBA::ULong i=0; i < len; i++)
00112     {
00113       this->add (ctx_list [i]);
00114     }
00115 }

CORBA::ContextList::~ContextList void   ) 
 

Destructor.

Definition at line 117 of file Context.cpp.

References count(), ctx_list_, ACE_Unbounded_Queue< char * >::get(), and CORBA::string_free().

00118 {
00119   for (CORBA::ULong i = 0; i < this->count (); ++i)
00120     {
00121       char **ctx;
00122 
00123       if (this->ctx_list_.get (ctx, i) == -1)
00124         {
00125           return;
00126         }
00127 
00128       CORBA::string_free (*ctx);
00129     }
00130 }

CORBA::ContextList::ContextList const ContextList  )  [private]
 


Member Function Documentation

void CORBA::ContextList::_decr_refcnt void   ) 
 

Definition at line 193 of file Context.cpp.

00194 {
00195   this->ref_count_--;
00196 
00197   if (this->ref_count_ != 0)
00198     {
00199       delete this;
00200     }
00201 }

void CORBA::ContextList::_destroy void   ) 
 

Decrement the reference count and delete if it is 0.

Definition at line 176 of file Context.cpp.

00177 {
00178   CORBA::ULong current = --this->ref_count_;
00179 
00180   if (current == 0)
00181     {
00182       delete this;
00183     }
00184 }

ContextList_ptr CORBA::ContextList::_duplicate ContextList  )  [static]
 

Increment the reference count.

CORBA::ContextList_ptr CORBA::ContextList::_duplicate void   ) 
 

Increment the reference count.

Definition at line 169 of file Context.cpp.

00170 {
00171   ++this->ref_count_;
00172   return this;
00173 }

void CORBA::ContextList::_incr_refcnt void   ) 
 

Increment and decrement ref counts.

Definition at line 187 of file Context.cpp.

00188 {
00189   this->ref_count_++;
00190 }

ACE_INLINE CORBA::ContextList_ptr CORBA::ContextList::_nil  )  [static]
 

Return null pointer of this type.

Definition at line 80 of file Context.inl.

00081 {
00082   return (CORBA::ContextList_ptr)0;
00083 }

void CORBA::ContextList::add char *  ctx  ) 
 

Add a string to the list.

Definition at line 133 of file Context.cpp.

References ctx_list_, and ACE_Unbounded_Queue< char * >::enqueue_tail().

Referenced by ContextList().

00134 {
00135   this->ctx_list_.enqueue_tail (CORBA::string_dup (ctx));
00136 }

void CORBA::ContextList::add_consume char *  ctx  ) 
 

Add and consume a string to the list.

Definition at line 139 of file Context.cpp.

References ctx_list_, and ACE_Unbounded_Queue< char * >::enqueue_tail().

00140 {
00141   this->ctx_list_.enqueue_tail (ctx);
00142 }

ACE_INLINE CORBA::ULong CORBA::ContextList::count void   ) 
 

Return the number of elements.

Definition at line 73 of file Context.inl.

References ctx_list_, and ACE_Unbounded_Queue< char * >::size().

Referenced by ~ContextList().

00074 {
00075   return (CORBA::ULong) this->ctx_list_.size ();
00076 }

char * CORBA::ContextList::item CORBA::ULong  slot  ) 
 

Return the typecode at slot i. Raises the "Bounds" exception.

Definition at line 145 of file Context.cpp.

References ACE_THROW_RETURN, ctx_list_, ACE_Unbounded_Queue< char * >::get(), and CORBA::string_dup().

00147 {
00148   char **ctx = 0;
00149 
00150   if (this->ctx_list_.get (ctx, slot) == -1)
00151     {
00152       ACE_THROW_RETURN (CORBA::TypeCode::Bounds (),
00153                         0);
00154     }
00155   else
00156     {
00157       return CORBA::string_dup (*ctx);
00158     }
00159 }

ContextList& CORBA::ContextList::operator= const ContextList  )  [private]
 

void CORBA::ContextList::remove CORBA::ULong  slot  ) 
 

Remove the typecode at slot i. Raises the "Bounds" exception.

Definition at line 162 of file Context.cpp.

References ACE_THROW.

00164 {
00165   ACE_THROW (CORBA::NO_IMPLEMENT ());
00166 }


Member Data Documentation

ACE_Unbounded_Queue<char *> CORBA::ContextList::ctx_list_ [private]
 

Internal list of typecodes.

Definition at line 197 of file Context.h.

Referenced by add(), add_consume(), count(), item(), and ~ContextList().

ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::ULong> CORBA::ContextList::ref_count_ [private]
 

Reference counter.

Definition at line 194 of file Context.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:05:07 2006 for TAO_DynamicInterface by doxygen 1.3.6