TAO_Configurable_Refcount Class Reference

Definition for a synchronised refcountable interface. More...

#include <Configurable_Refcount.h>

Collaboration diagram for TAO_Configurable_Refcount:

Collaboration graph
[legend]
List of all members.

Public Types

 TAO_NULL_LOCK
 TAO_THREAD_LOCK
enum  Lock_Type { TAO_NULL_LOCK, TAO_THREAD_LOCK }

Public Member Functions

 TAO_Configurable_Refcount (Lock_Type type=TAO_THREAD_LOCK, unsigned long value=1)
unsigned long increment (void)
unsigned long decrement (void)
unsigned long value (void) const

Private Attributes

Lock_Type type_
ACE_Atomic_Op< ACE_SYNCH_NULL_MUTEX,
unsigned long > 
null_refcount_
ACE_Atomic_Op< TAO_SYNCH_MUTEX,
unsigned long > 
mutex_refcount_

Detailed Description

Definition for a synchronised refcountable interface.

Definition at line 37 of file Configurable_Refcount.h.


Member Enumeration Documentation

enum TAO_Configurable_Refcount::Lock_Type

Enumerator:
TAO_NULL_LOCK 
TAO_THREAD_LOCK 

Definition at line 40 of file Configurable_Refcount.h.

00041   {
00042     TAO_NULL_LOCK,
00043     TAO_THREAD_LOCK
00044   };


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_Configurable_Refcount::TAO_Configurable_Refcount ( Lock_Type  type = TAO_THREAD_LOCK,
unsigned long  value = 1 
)

Definition at line 7 of file Configurable_Refcount.inl.

00010  : type_ (type),
00011    null_refcount_ (value),
00012    mutex_refcount_ (value)
00013 {
00014 }


Member Function Documentation

ACE_INLINE unsigned long TAO_Configurable_Refcount::decrement ( void   ) 

Definition at line 30 of file Configurable_Refcount.inl.

References mutex_refcount_, null_refcount_, TAO_NULL_LOCK, and TAO_THREAD_LOCK.

Referenced by TAO_Profile::_decr_refcnt().

00031 {
00032   switch(this->type_)
00033     {
00034     case TAO_NULL_LOCK:
00035       return --this->null_refcount_;
00036     case TAO_THREAD_LOCK:
00037     default:
00038       return --this->mutex_refcount_;
00039     }
00040 }

ACE_INLINE unsigned long TAO_Configurable_Refcount::increment ( void   ) 

Definition at line 17 of file Configurable_Refcount.inl.

References mutex_refcount_, null_refcount_, TAO_NULL_LOCK, and TAO_THREAD_LOCK.

Referenced by CORBA::Object::_add_ref(), and TAO_Profile::_incr_refcnt().

00018 {
00019   switch(this->type_)
00020     {
00021     case TAO_NULL_LOCK:
00022       return this->null_refcount_++;
00023     case TAO_THREAD_LOCK:
00024     default:
00025       return this->mutex_refcount_++;
00026     }
00027 }

ACE_INLINE unsigned long TAO_Configurable_Refcount::value ( void   )  const

Definition at line 43 of file Configurable_Refcount.inl.

References mutex_refcount_, null_refcount_, TAO_NULL_LOCK, TAO_THREAD_LOCK, and ACE_Atomic_Op< ACE_LOCK, TYPE >::value().

Referenced by CORBA::Object::_refcount_value().

00044 {
00045   switch(this->type_)
00046     {
00047     case TAO_NULL_LOCK:
00048       return this->null_refcount_.value ();
00049     case TAO_THREAD_LOCK:
00050     default:
00051       return this->mutex_refcount_.value ();
00052     }
00053 }


Member Data Documentation

ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> TAO_Configurable_Refcount::mutex_refcount_ [private]

Definition at line 57 of file Configurable_Refcount.h.

Referenced by decrement(), increment(), and value().

ACE_Atomic_Op<ACE_SYNCH_NULL_MUTEX, unsigned long> TAO_Configurable_Refcount::null_refcount_ [private]

Definition at line 56 of file Configurable_Refcount.h.

Referenced by decrement(), increment(), and value().

Lock_Type TAO_Configurable_Refcount::type_ [private]

Definition at line 55 of file Configurable_Refcount.h.


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:39:24 2010 for TAO by  doxygen 1.4.7