00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Recyclable.h 00006 * 00007 * $Id: Recyclable.h 80826 2008-03-04 14:51:23Z wotte $ 00008 * 00009 * @author Doug Schmidt 00010 */ 00011 //============================================================================= 00012 #ifndef ACE_RECYCLABLE_H 00013 #define ACE_RECYCLABLE_H 00014 #include /**/ "ace/pre.h" 00015 00016 #include /**/ "ace/ACE_export.h" 00017 00018 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00019 # pragma once 00020 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00021 00022 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00023 00024 /// States of a recyclable object. 00025 enum ACE_Recyclable_State 00026 { 00027 /// Idle and can be purged. 00028 ACE_RECYCLABLE_IDLE_AND_PURGABLE, 00029 00030 /// Idle but cannot be purged. 00031 ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE, 00032 00033 /// Can be purged, but is not idle (mostly for debugging). 00034 ACE_RECYCLABLE_PURGABLE_BUT_NOT_IDLE, 00035 00036 /// Busy (i.e., cannot be recycled or purged). 00037 ACE_RECYCLABLE_BUSY, 00038 00039 /// Closed. 00040 ACE_RECYCLABLE_CLOSED, 00041 00042 /// Unknown state. 00043 ACE_RECYCLABLE_UNKNOWN 00044 }; 00045 00046 /** 00047 * @class ACE_Recyclable 00048 */ 00049 class ACE_Export ACE_Recyclable 00050 { 00051 public: 00052 /// Destructor. 00053 virtual ~ACE_Recyclable (void); 00054 00055 /// Get the recyclable bit 00056 ACE_Recyclable_State recycle_state (void) const; 00057 00058 /// Set the recyclable bit 00059 void recycle_state (ACE_Recyclable_State new_state); 00060 00061 protected: 00062 00063 /// Constructor. 00064 ACE_Recyclable (ACE_Recyclable_State initial_state); 00065 00066 protected: 00067 00068 /// Our state. 00069 ACE_Recyclable_State recycle_state_; 00070 }; 00071 00072 ACE_END_VERSIONED_NAMESPACE_DECL 00073 00074 #if defined (__ACE_INLINE__) 00075 #include "ace/Recyclable.inl" 00076 #endif /* __ACE_INLINE __ */ 00077 00078 #include /**/ "ace/post.h" 00079 #endif /*ACE_RECYCLABLE_STATE_H*/