00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Synch_Refcountable.h 00006 * 00007 * $Id: Synch_Refcountable.h 71473 2006-03-10 07:19:20Z jtc $ 00008 * 00009 * Definition for a synchronised refcountable interface. 00010 * 00011 * @author Fred Kuhns <fredk@cs.wustl.edu> 00012 */ 00013 //============================================================================= 00014 00015 #ifndef TAO_SYNCH_REFCOUNTABLE_H 00016 #define TAO_SYNCH_REFCOUNTABLE_H 00017 00018 #include /**/ "ace/pre.h" 00019 #include "ace/Refcountable.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "tao/Utils/utils_export.h" 00026 #include "tao/Versioned_Namespace.h" 00027 00028 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00029 class ACE_Lock; 00030 ACE_END_VERSIONED_NAMESPACE_DECL 00031 00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00033 00034 /** 00035 * @class TAO_Synch_Refcountable 00036 * 00037 * @brief Definition for a synchronised refcountable interface. 00038 */ 00039 class TAO_UTILS_Export TAO_Synch_Refcountable : private ACE_Refcountable 00040 { 00041 public: 00042 virtual ~TAO_Synch_Refcountable (void); 00043 00044 int increment (void); 00045 int decrement (void); 00046 00047 int refcount (void) const; 00048 00049 protected: 00050 TAO_Synch_Refcountable (ACE_Lock *lock, int refcount); 00051 00052 ACE_Lock *refcount_lock_; 00053 }; 00054 00055 TAO_END_VERSIONED_NAMESPACE_DECL 00056 00057 #if defined (__ACE_INLINE__) 00058 # include "tao/Utils/Synch_Refcountable.inl" 00059 #endif /* __ACE_INLINE__ */ 00060 00061 #include /**/ "ace/post.h" 00062 00063 #endif /*TAO_SYNCH_REFCOUNTABLE*/