00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Node.h 00006 * 00007 * $Id: Node.h 78460 2007-05-23 13:33:56Z johnnyw $ 00008 * 00009 * @author Doug Schmidt 00010 */ 00011 //============================================================================= 00012 00013 00014 #ifndef ACE_NODE_H 00015 #define ACE_NODE_H 00016 #include /**/ "ace/pre.h" 00017 00018 #include /**/ "ace/config-all.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00025 00026 // Forward declarations. 00027 template <class T> class ACE_Unbounded_Set; 00028 template <class T> class ACE_Unbounded_Set_Iterator; 00029 template <class T> class ACE_Unbounded_Set_Const_Iterator; 00030 template <class T> class ACE_Unbounded_Queue; 00031 template <class T> class ACE_Unbounded_Queue_Iterator; 00032 template <class T> class ACE_Unbounded_Queue_Const_Iterator; 00033 template <class T> class ACE_Unbounded_Stack; 00034 template <class T> class ACE_Unbounded_Stack_Iterator; 00035 00036 /** 00037 * @class ACE_Node 00038 * 00039 * @brief Implementation element in a Queue, Set, and Stack. 00040 */ 00041 template<class T> 00042 class ACE_Node 00043 { 00044 public: 00045 friend class ACE_Unbounded_Queue<T>; 00046 friend class ACE_Unbounded_Queue_Iterator<T>; 00047 friend class ACE_Unbounded_Queue_Const_Iterator<T>; 00048 friend class ACE_Unbounded_Set<T>; 00049 friend class ACE_Unbounded_Set_Iterator<T>; 00050 friend class ACE_Unbounded_Set_Const_Iterator<T>; 00051 friend class ACE_Unbounded_Stack<T>; 00052 friend class ACE_Unbounded_Stack_Iterator<T>; 00053 00054 /// This isn't necessary, but it keeps some compilers happy. 00055 ~ACE_Node (void); 00056 00057 private: 00058 // = Initialization methods 00059 ACE_Node (const T &i, ACE_Node<T> *n); 00060 ACE_Node (ACE_Node<T> *n = 0, int = 0); 00061 ACE_Node (const ACE_Node<T> &n); 00062 private: 00063 /// Not possible 00064 void operator= (const ACE_Node<T> &); 00065 00066 private: 00067 /// Pointer to next element in the list of ACE_Nodes. 00068 ACE_Node<T> *next_; 00069 00070 /// Current value of the item in this node. 00071 T item_; 00072 }; 00073 00074 ACE_END_VERSIONED_NAMESPACE_DECL 00075 00076 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00077 #include "ace/Node.cpp" 00078 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00079 00080 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00081 #pragma implementation ("Node.cpp") 00082 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00083 00084 #include /**/ "ace/post.h" 00085 #endif /* ACE_NODE_H */