00001 // -*- C++ -*- 00002 00003 /** 00004 * @file ESF_Proxy_List.h 00005 * 00006 * $Id: ESF_Proxy_List.h 76589 2007-01-25 18:04:11Z elliott_c $ 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 00056 /// Insert a new element that could be there already. 00057 void reconnected (PROXY *); 00058 00059 /// Remove an element from the collection 00060 void disconnected (PROXY *); 00061 00062 /// Shutdown the collection, i.e. remove all elements and release 00063 /// resources 00064 void shutdown (void); 00065 00066 private: 00067 /// The underlying implementation object 00068 ACE_Unbounded_Set<PROXY*> impl_; 00069 }; 00070 00071 TAO_END_VERSIONED_NAMESPACE_DECL 00072 00073 #if defined (__ACE_INLINE__) 00074 #include "orbsvcs/ESF/ESF_Proxy_List.inl" 00075 #endif /* __ACE_INLINE__ */ 00076 00077 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00078 #include "orbsvcs/ESF/ESF_Proxy_List.cpp" 00079 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00080 00081 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00082 #pragma implementation ("ESF_Proxy_List.cpp") 00083 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00084 00085 #endif /* TAO_ESF_PROXY_LIST_H */