Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Intrusive_Ref_Count_Object_T.h
blob5e2e731e57e9d61a7fbe017f18fb4b4088af212f
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Intrusive_Ref_Count_Object_T.h
7 * @authors Yan Dai <dai_y@ociweb.com>
8 */
9 //=============================================================================
11 #ifndef TAO_INTRUSIVE_REF_COUNT_OBJECT_T_H
12 #define TAO_INTRUSIVE_REF_COUNT_OBJECT_T_H
14 #include /**/ "ace/pre.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 # pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include /**/ "tao/Versioned_Namespace.h"
21 #include /**/ "tao/Intrusive_Ref_Count_Base_T.h"
23 #include "ace/Atomic_Op.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 /**
28 * @class TAO_Intrusive_Ref_Count_Object<ACE_LOCK>
30 * @brief Template class as wrapper of a non reference counted data type but provide
31 * intrusive reference-counting feature by inherited from TAO_Intrusive_Ref_Count_Base.
32 * This makes the parameterized type data be smart pointer by using a
33 * TAO_Intrusive_Ref_Count_Handle<X> to an this wrapper object.
35 template <class OBJ, class ACE_LOCK>
36 class TAO_Intrusive_Ref_Count_Object : public TAO_Intrusive_Ref_Count_Base <ACE_LOCK>
38 public:
39 /// take ownership of obj.
40 TAO_Intrusive_Ref_Count_Object (OBJ* obj);
41 virtual ~TAO_Intrusive_Ref_Count_Object ();
43 OBJ* get () const;
45 private:
46 // Prevent default constructor used.
47 TAO_Intrusive_Ref_Count_Object ();
49 // Prevent copying/assignment.
50 TAO_Intrusive_Ref_Count_Object (const TAO_Intrusive_Ref_Count_Object&);
51 TAO_Intrusive_Ref_Count_Object& operator= (const TAO_Intrusive_Ref_Count_Object&);
53 OBJ* obj_;
56 TAO_END_VERSIONED_NAMESPACE_DECL
58 #if defined (__ACE_INLINE__)
59 #include "tao/Intrusive_Ref_Count_Object_T.inl"
60 #endif /* __ACE_INLINE__ */
62 #include "tao/Intrusive_Ref_Count_Object_T.cpp"
64 #include /**/ "ace/post.h"
66 #endif /* TAO_INTRUSIVE_REF_COUNT_OBJECT_T_H */