3 //=============================================================================
5 * @file Auto_IncDec_T.h
7 * @author Edan Ayal <EdanA@cti2.com>
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)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/Global_Macros.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
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
>
41 /// Implicitly increment the counter.
42 ACE_Auto_IncDec (ACE_SAFELY_INCREMENTABLE_DECREMENTABLE
&counter
);
44 /// Implicitly decrement the counter.
47 /// Dump the state of an object.
50 /// Declare the dynamic allocation hooks.
51 ACE_ALLOC_HOOK_DECLARE
;
54 /// Reference to the @c ACE_SAFELY_INCREMENTABLE_DECREMENTABLE counter
55 /// we're incrementing/decrementing.
56 ACE_SAFELY_INCREMENTABLE_DECREMENTABLE
&counter_
;
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 */