00001 /* -*- C++ -*- */ 00002 00003 //============================================================================= 00004 /** 00005 * @file Intrusive_List_Node.h 00006 * 00007 * $Id: Intrusive_List_Node.h,v 1.1.1.2 2003/02/21 18:36:32 chad Exp $ 00008 * 00009 * @author Carlos O'Ryan <coryan@uci.edu> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef ACE_INTRUSIVE_LIST_NODE_H 00014 #define ACE_INTRUSIVE_LIST_NODE_H 00015 #include "ace/pre.h" 00016 00017 #include "ace/config-all.h" 00018 00019 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00020 # pragma once 00021 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00022 00023 /** 00024 * @class ACE_Intrusive_List_Node 00025 * 00026 * @brief Implement the requirements for ACE_Intrusive_List 00027 * 00028 * The class should be used as follows: 00029 * 00030 * class My_Object : public ACE_Intrusive_List_Node<My_Object> {<BR> 00031 * ....<BR> 00032 * };<BR> 00033 * 00034 * However, ACE is supported on platforms that would surely get 00035 * confused using such templates, the class is provided as a helper 00036 * for our lucky users that only need portability to modern C++ 00037 * compilers. 00038 * 00039 */ 00040 template <class T> 00041 class ACE_Intrusive_List_Node 00042 { 00043 public: 00044 /** @name Accesors and modifiers to the next and previous pointers 00045 * 00046 */ 00047 //@{ 00048 T *prev (void) const; 00049 void prev (T *); 00050 T *next (void) const; 00051 void next (T *); 00052 //@} 00053 00054 protected: 00055 /// Constructor 00056 /** 00057 * The constructor is protected, because only derived classes should 00058 * be instantiated. 00059 */ 00060 ACE_Intrusive_List_Node (void); 00061 00062 private: 00063 /// Head and tail of the list 00064 T *prev_; 00065 T *next_; 00066 }; 00067 00068 #if defined (__ACE_INLINE__) 00069 #include "ace/Intrusive_List_Node.inl" 00070 #endif /* __ACE_INLINE__ */ 00071 00072 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00073 #include "ace/Intrusive_List_Node.cpp" 00074 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00075 00076 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00077 #pragma implementation ("Intrusive_List_Node.cpp") 00078 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00079 00080 #include "ace/post.h" 00081 #endif /* ACE_INTRUSIVE_LIST_NODE_H */
1.2.14 written by Dimitri van Heesch,
© 1997-2002