3 //=============================================================================
5 * @file Refcounted_ObjectKey.h
7 * @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
9 //=============================================================================
11 #ifndef TAO_REFCOUNTED_OBJECTKEY_H
12 #define TAO_REFCOUNTED_OBJECTKEY_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "tao/TAO_Export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/Object_KeyC.h"
24 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
29 * @class Refcounted_ObjectKey
31 * @brief A wrapper class that ties together a refcount to an
34 * The refcount in this class is manipulated within the context of
35 * the lock in the TAO::ObjectKey_Table. Manipulating the refcount
36 * from anywhere else is strictly forbidden.
38 class TAO_Export Refcounted_ObjectKey
42 Refcounted_ObjectKey (const ObjectKey
&ref
);
44 /// Accessor for the underlying ObjectKey.
45 const ObjectKey
&object_key (void) const;
48 friend class ObjectKey_Table
;
50 /// Protected destructor
51 ~Refcounted_ObjectKey (void);
53 /// Methods for incrementing refcount.
54 void incr_refcount (void);
56 /// Methods for decrementing refcount. Return the refcount, used by the
58 CORBA::ULong
decr_refcount (void);
62 ObjectKey object_key_
;
64 /// The refcount on the object key..
65 CORBA::ULong refcount_
;
69 TAO_END_VERSIONED_NAMESPACE_DECL
71 #if defined (__ACE_INLINE__)
72 #include "tao/Refcounted_ObjectKey.inl"
73 #endif /* defined INLINE */
75 #include /**/ "ace/post.h"
77 #endif /*TAO_REFCOUNTED_OBJECTKEY_H*/