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

ACE_Auto_IncDec Class Template Reference

This class automatically increments and decrements a parameterized counter. More...

#include <Auto_IncDec_T.h>

Collaboration diagram for ACE_Auto_IncDec:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Auto_IncDec (ACE_SAFELY_INCREMENTABLE_DECREMENTABLE &counter)
 Implicitly increment the counter. More...

 ~ACE_Auto_IncDec (void)
 Implicitly decrement the counter. More...

void dump (void) const
 Dump the state of an object. More...


Protected Attributes

ACE_SAFELY_INCREMENTABLE_DECREMENTABLE & counter_
 Reference to the <ACE_SAFELY_INCREMENTABLE_DECREMENTABLE> counter we're incrementing/decrementing. More...


Private Methods

void operator= (const ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE > &)
 ACE_Auto_IncDec (const ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE > &)

Detailed Description

template<class ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>
class ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE >

This class automatically increments and decrements a parameterized counter.

This data structure is meant to be used within a method, function, or scope. The actual parameter given for the <ACE_SAFELY_INCREMENTABLE_DECREMENTABLE> template parameter must provide at least operators ++ and --.

Definition at line 39 of file Auto_IncDec_T.h.


Constructor & Destructor Documentation

template<class ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>
ACE_INLINE ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE >::ACE_Auto_IncDec ACE_SAFELY_INCREMENTABLE_DECREMENTABLE &    counter
 

Implicitly increment the counter.

Definition at line 8 of file Auto_IncDec_T.i.

00009   : counter_ (counter)
00010 {
00011   ++this->counter_;
00012 }

template<class ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>
ACE_INLINE ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE >::~ACE_Auto_IncDec void   
 

Implicitly decrement the counter.

Definition at line 17 of file Auto_IncDec_T.i.

References counter_.

00018 {
00019   --this->counter_;
00020 }

template<class ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>
ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE >::ACE_Auto_IncDec const ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE > &    [private]
 


Member Function Documentation

template<class ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>
void ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE >::dump void    const
 

Dump the state of an object.

Definition at line 22 of file Auto_IncDec_T.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, and LM_DEBUG.

00023 {
00024 // ACE_TRACE ("ACE_Auto_IncDec<ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>::dump");
00025 
00026   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00027   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00028 }

template<class ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>
void ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE >::operator= const ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE > &    [private]
 


Member Data Documentation

template<class ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>
ACE_SAFELY_INCREMENTABLE_DECREMENTABLE& ACE_Auto_IncDec::counter_ [protected]
 

Reference to the <ACE_SAFELY_INCREMENTABLE_DECREMENTABLE> counter we're incrementing/decrementing.

Definition at line 55 of file Auto_IncDec_T.h.

Referenced by ~ACE_Auto_IncDec.


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