00001 // -*- C++ -*- 00002 00003 /** 00004 * @file ESF_Proxy_List.h 00005 * 00006 * $Id: ESF_Proxy_List.h 90386 2010-06-02 13:52:08Z vzykov $ 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 /**/ "tao/Versioned_Namespace.h" 00021 00022 #include "ace/Unbounded_Set.h" 00023 #include "ace/Containers.h" 00024 00025 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00026 00027 /// A concrete proxy collection. 00028 /** 00029 * Based on the ACE_Unbounded_Set<> collection, used a double 00030 * linked list internally. 00031 */ 00032 template<class PROXY> 00033 class TAO_ESF_Proxy_List 00034 { 00035 public: 00036 /// A typedef for the underlying implementaiton class 00037 typedef ACE_Unbounded_Set<PROXY*> Implementation; 00038 00039 /// A typedef for the underlying iterator 00040 typedef ACE_Unbounded_Set_Iterator<PROXY*> Iterator; 00041 00042 /// Constructor 00043 TAO_ESF_Proxy_List (void); 00044 00045 /// Return the first element in the collection, or end() if there 00046 /// are none 00047 ACE_Unbounded_Set_Iterator<PROXY*> begin (void); 00048 00049 /// Return one past the last element in the collection 00050 ACE_Unbounded_Set_Iterator<PROXY*> end (void); 00051 00052 /// Return the number of elements in the collection 00053 size_t size (void) const; 00054 00055 /// Insert a new element to the collection 00056 void connected (PROXY *); 00057 00058 /// Insert a new element that could be there already. 00059 void reconnected (PROXY *); 00060 00061 /// Remove an element from the collection 00062 void disconnected (PROXY *); 00063 00064 /// Shutdown the collection, i.e. remove all elements and release 00065 /// resources 00066 void shutdown (void); 00067 00068 private: 00069 /// The underlying implementation object 00070 ACE_Unbounded_Set<PROXY*> impl_; 00071 }; 00072 00073 TAO_END_VERSIONED_NAMESPACE_DECL 00074 00075 #if defined (__ACE_INLINE__) 00076 #include "orbsvcs/ESF/ESF_Proxy_List.inl" 00077 #endif /* __ACE_INLINE__ */ 00078 00079 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00080 #include "orbsvcs/ESF/ESF_Proxy_List.cpp" 00081 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00082 00083 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00084 #pragma implementation ("ESF_Proxy_List.cpp") 00085 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00086 00087 #endif /* TAO_ESF_PROXY_LIST_H */