00001 // -*- C++ -*- 00002 00003 /** 00004 * @file ESF_Copy_On_Read.h 00005 * 00006 * ESF_Copy_On_Read.h,v 1.10 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_COPY_ON_READ_H 00014 #define TAO_ESF_COPY_ON_READ_H 00015 00016 #include "orbsvcs/ESF/ESF_Proxy_Collection.h" 00017 00018 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00019 # pragma once 00020 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00021 00022 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00023 00024 template<class Target> class TAO_ESF_Worker; 00025 00026 // **************************************************************** 00027 00028 /** 00029 * @class TAO_ESF_Copy_On_Read 00030 * 00031 * @brief Implement the Copy_On_Read protocol 00032 * 00033 * 00034 * The class is parametric on the kind of collection and locking 00035 * mechanism used. 00036 */ 00037 template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK> 00038 class TAO_ESF_Copy_On_Read : public TAO_ESF_Proxy_Collection<PROXY> 00039 { 00040 public: 00041 /// Constructors 00042 TAO_ESF_Copy_On_Read (void); 00043 TAO_ESF_Copy_On_Read (const COLLECTION &collection); 00044 00045 // = The TAO_ESF_Proxy_Collection methods 00046 virtual void for_each (TAO_ESF_Worker<PROXY> *worker 00047 ACE_ENV_ARG_DECL); 00048 virtual void connected (PROXY *proxy 00049 ACE_ENV_ARG_DECL); 00050 virtual void reconnected (PROXY *proxy 00051 ACE_ENV_ARG_DECL); 00052 virtual void disconnected (PROXY *proxy 00053 ACE_ENV_ARG_DECL); 00054 virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL); 00055 00056 private: 00057 COLLECTION collection_; 00058 00059 ACE_LOCK lock_; 00060 }; 00061 00062 // **************************************************************** 00063 00064 TAO_END_VERSIONED_NAMESPACE_DECL 00065 00066 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00067 #include "orbsvcs/ESF/ESF_Copy_On_Read.cpp" 00068 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00069 00070 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00071 #pragma implementation ("ESF_Copy_On_Read.cpp") 00072 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00073 00074 #endif /* TAO_ESF_COPY_ON_READ_H */