3 //=============================================================================
5 * @file Refcountable_T.h
8 * @author Johnny Willemsen
10 //=============================================================================
11 #ifndef ACE_REFCOUNTABLE_T_H
12 #define ACE_REFCOUNTABLE_T_H
13 #include /**/ "ace/pre.h"
15 #include /**/ "ace/ACE_export.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "ace/Atomic_Op.h"
22 #include "ace/Synch_Traits.h"
23 #include "ace/Null_Mutex.h"
25 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 template <class ACE_LOCK
>
28 class ACE_Refcountable_T
32 virtual ~ACE_Refcountable_T () = default;
34 /// Increment refcount
37 /// Decrement refcount
40 /// Returns the current refcount.
41 long refcount () const;
44 /// Protected constructor.
45 ACE_Refcountable_T (long refcount
);
48 ACE_Atomic_Op
<ACE_LOCK
, long> refcount_
;
51 ACE_END_VERSIONED_NAMESPACE_DECL
53 #if defined (__ACE_INLINE__)
54 #include "ace/Refcountable_T.inl"
55 #endif /* __ACE_INLINE__ */
57 #include "ace/Refcountable_T.cpp"
59 #include /**/ "ace/post.h"
60 #endif /*ACE_REFCOUNTABLE_T_H*/