00001 // -*- C++ -*- 00002 00003 /** 00004 * @file ESF_Proxy_List.h 00005 * 00006 * ESF_Proxy_List.h,v 1.12 2006/03/15 07:52:21 jtc Exp 00007 * 00008 * @author Carlos O'Ryan (coryan@cs.wustl.edu) 00009 * 00010 * http://doc.ece.uci.edu/~coryan/EC/index.html 00011 */ 00012 00013 #ifndef TAO_ESF_PROXY_LIST_H 00014 #define TAO_ESF_PROXY_LIST_H 00015 00016 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00017 # pragma once 00018 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00019 00020 #include "ace/Unbounded_Set.h" 00021 #include "ace/Containers.h" 00022 00023 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00024 00025 /// A concrete proxy collection. 00026 /** 00027 * Based on the ACE_Unbounded_Set<> collection, used a double 00028 * linked list internally. 00029 */ 00030 template<class PROXY> 00031 class TAO_ESF_Proxy_List 00032 { 00033 public: 00034 /// A typedef for the underlying implementaiton class 00035 typedef ACE_Unbounded_Set<PROXY*> Implementation; 00036 00037 /// A typedef for the underlying iterator 00038 typedef ACE_Unbounded_Set_Iterator<PROXY*> Iterator; 00039 00040 /// Constructor 00041 TAO_ESF_Proxy_List (void); 00042 00043 /// Return the first element in the collection, or end() if there 00044 /// are none 00045 ACE_Unbounded_Set_Iterator<PROXY*> begin (void); 00046 00047 /// Return one past the last element in the collection 00048 ACE_Unbounded_Set_Iterator<PROXY*> end (void); 00049 00050 /// Return the number of elements in the collection 00051 size_t size (void) const; 00052 00053 /// Insert a new element to the collection 00054 void connected (PROXY * 00055 ACE_ENV_ARG_DECL_NOT_USED); 00056 00057 /// Insert a new element that could be there already. 00058 void reconnected (PROXY * 00059 ACE_ENV_ARG_DECL_NOT_USED); 00060 00061 /// Remove an element from the collection 00062 void disconnected (PROXY * 00063 ACE_ENV_ARG_DECL_NOT_USED); 00064 00065 /// Shutdown the collection, i.e. remove all elements and release 00066 /// resources 00067 void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED); 00068 00069 private: 00070 /// The underlying implementation object 00071 ACE_Unbounded_Set<PROXY*> impl_; 00072 }; 00073 00074 TAO_END_VERSIONED_NAMESPACE_DECL 00075 00076 #if defined (__ACE_INLINE__) 00077 #include "orbsvcs/ESF/ESF_Proxy_List.i" 00078 #endif /* __ACE_INLINE__ */ 00079 00080 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00081 #include "orbsvcs/ESF/ESF_Proxy_List.cpp" 00082 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00083 00084 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00085 #pragma implementation ("ESF_Proxy_List.cpp") 00086 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00087 00088 #endif /* TAO_ESF_PROXY_LIST_H */