ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE > Class Template Reference

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

#include <Auto_IncDec_T.h>

Collaboration diagram for ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ACE_Auto_IncDec (ACE_SAFELY_INCREMENTABLE_DECREMENTABLE &counter)
 Implicitly increment the counter.

 ~ACE_Auto_IncDec (void)
 Implicitly decrement the counter.

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


Protected Attributes

ACE_SAFELY_INCREMENTABLE_DECREMENTABLE & counter_

Private Member Functions

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 template parameter must provide at least operators ++ and --.

Definition at line 41 of file Auto_IncDec_T.h.


Constructor & Destructor Documentation

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

Implicitly increment the counter.

Definition at line 11 of file Auto_IncDec_T.inl.

00012   : counter_ (counter)
00013 {
00014   ++this->counter_;
00015 }

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 20 of file Auto_IncDec_T.inl.

References ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE >::counter_.

00021 {
00022   --this->counter_;
00023 }

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>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL 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 #if defined (ACE_HAS_DUMP)
00025 // ACE_TRACE ("ACE_Auto_IncDec<ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>::dump");
00026 
00027   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00028   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00029 #endif /* ACE_HAS_DUMP */
00030 }

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< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE >::counter_ [protected]
 

Reference to the counter we're incrementing/decrementing.

Definition at line 57 of file Auto_IncDec_T.h.

Referenced by ACE_Auto_IncDec< ACE_SAFELY_INCREMENTABLE_DECREMENTABLE >::~ACE_Auto_IncDec().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:20:14 2006 for ACE by doxygen 1.3.6