Public Types | Public Member Functions | Private Attributes

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

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

Enumerator:
TAO_NULL_LOCK 
TAO_THREAD_LOCK 

Definition at line 40 of file Configurable_Refcount.h.

  {
    TAO_NULL_LOCK,
    TAO_THREAD_LOCK
  };


Constructor & Destructor Documentation

TAO_Configurable_Refcount::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.


Member Function Documentation

unsigned long TAO_Configurable_Refcount::decrement ( void   ) 

Definition at line 30 of file Configurable_Refcount.inl.

{
  switch(this->type_)
    {
    case TAO_NULL_LOCK:
      return --this->null_refcount_;
    case TAO_THREAD_LOCK:
    default:
      return --this->mutex_refcount_;
    }
}

unsigned long TAO_Configurable_Refcount::increment ( void   ) 

Definition at line 17 of file Configurable_Refcount.inl.

{
  switch(this->type_)
    {
    case TAO_NULL_LOCK:
      return this->null_refcount_++;
    case TAO_THREAD_LOCK:
    default:
      return this->mutex_refcount_++;
    }
}

unsigned long TAO_Configurable_Refcount::value ( void   )  const

Definition at line 43 of file Configurable_Refcount.inl.

{
  switch(this->type_)
    {
    case TAO_NULL_LOCK:
      return this->null_refcount_.value ();
    case TAO_THREAD_LOCK:
    default:
      return this->mutex_refcount_.value ();
    }
}


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.

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

Definition at line 56 of file Configurable_Refcount.h.

Definition at line 55 of file Configurable_Refcount.h.


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