Refcounted_ObjectKey.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file Refcounted_ObjectKey.h
00006  *
00007  *  Refcounted_ObjectKey.h,v 1.7 2006/04/20 13:36:42 jwillemsen Exp
00008  *
00009  *  @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_REFCOUNTED_OBJECTKEY_H
00014 #define TAO_REFCOUNTED_OBJECTKEY_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "tao/TAO_Export.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "tao/Object_KeyC.h"
00025 
00026 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00027 
00028 namespace TAO
00029 {
00030   /**
00031    * @class Refcounted_ObjectKey
00032    *
00033    * @brief A wrapper class that ties together a refcount to an
00034    * ObjectKey.
00035    *
00036    * The refcount in this class is manipulated within the context of
00037    * the lock in the TAO::ObjectKey_Table. Manipulating the refcount
00038    * from anywhere else is strictly forbidden.
00039    */
00040   class TAO_Export Refcounted_ObjectKey
00041   {
00042   public:
00043     /// Constructor
00044     Refcounted_ObjectKey (const ObjectKey &ref);
00045 
00046     /// Accessor for the underlying ObjectKey.
00047     const ObjectKey &object_key (void) const;
00048 
00049   protected:
00050     friend class ObjectKey_Table;
00051 
00052     /// Protected destructor
00053     ~Refcounted_ObjectKey (void);
00054 
00055     /// Methods for incrementing refcount.
00056     void incr_refcount (void);
00057 
00058     /// Methods for decrementing refcount. Return the refcount, used by the
00059     /// ObjectKey table.
00060     CORBA::ULong decr_refcount (void);
00061 
00062   private:
00063     /// The object key
00064     ObjectKey object_key_;
00065 
00066     /// The refcount on the object key..
00067     CORBA::ULong ref_count_;
00068   };
00069 }
00070 
00071 TAO_END_VERSIONED_NAMESPACE_DECL
00072 
00073 #if defined (__ACE_INLINE__)
00074 #include "tao/Refcounted_ObjectKey.inl"
00075 #endif /* defined INLINE */
00076 
00077 #include /**/ "ace/post.h"
00078 
00079 #endif /*TAO_REFCOUNTED_OBJECTKEY_H*/

Generated on Thu Nov 9 11:54:21 2006 for TAO by doxygen 1.3.6