Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Auto_IncDec_T.h
blobafbde550e519500add44adda5d4cab8889068b8a
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Auto_IncDec_T.h
7 * @author Edan Ayal <EdanA@cti2.com>
8 */
9 //=============================================================================
11 #ifndef ACE_AUTO_INCDEC_T_H
12 #define ACE_AUTO_INCDEC_T_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "ace/config-all.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/Global_Macros.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 /**
27 * @class ACE_Auto_IncDec
29 * @brief This class automatically increments and decrements a
30 * parameterized counter.
32 * This data structure is meant to be used within a method,
33 * function, or scope. The actual parameter given for the
34 * @c ACE_SAFELY_INCREMENTABLE_DECREMENTABLE template parameter
35 * must provide at least operators ++ and --.
37 template <class ACE_SAFELY_INCREMENTABLE_DECREMENTABLE>
38 class ACE_Auto_IncDec
40 public:
41 /// Implicitly increment the counter.
42 ACE_Auto_IncDec (ACE_SAFELY_INCREMENTABLE_DECREMENTABLE &counter);
44 /// Implicitly decrement the counter.
45 ~ACE_Auto_IncDec ();
47 /// Dump the state of an object.
48 void dump () const;
50 /// Declare the dynamic allocation hooks.
51 ACE_ALLOC_HOOK_DECLARE;
53 protected:
54 /// Reference to the @c ACE_SAFELY_INCREMENTABLE_DECREMENTABLE counter
55 /// we're incrementing/decrementing.
56 ACE_SAFELY_INCREMENTABLE_DECREMENTABLE &counter_;
57 private:
58 void operator= (const ACE_Auto_IncDec<ACE_SAFELY_INCREMENTABLE_DECREMENTABLE> &) = delete;
59 ACE_Auto_IncDec (const ACE_Auto_IncDec<ACE_SAFELY_INCREMENTABLE_DECREMENTABLE> &) = delete;
62 ACE_END_VERSIONED_NAMESPACE_DECL
64 #if defined (__ACE_INLINE__)
65 #include "ace/Auto_IncDec_T.inl"
66 #endif /* __ACE_INLINE__ */
68 #include "ace/Auto_IncDec_T.cpp"
70 #include /**/ "ace/post.h"
72 #endif /* ACE_AUTO_INCDEC_T_H */