00001 // -*- C++ -*- 00002 00003 /** 00004 * @file ESF_Copy_On_Read.h 00005 * 00006 * $Id: ESF_Copy_On_Read.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_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 virtual void connected (PROXY *proxy); 00048 virtual void reconnected (PROXY *proxy); 00049 virtual void disconnected (PROXY *proxy); 00050 virtual void shutdown (void); 00051 00052 private: 00053 COLLECTION collection_; 00054 00055 ACE_LOCK lock_; 00056 }; 00057 00058 // **************************************************************** 00059 00060 TAO_END_VERSIONED_NAMESPACE_DECL 00061 00062 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00063 #include "orbsvcs/ESF/ESF_Copy_On_Read.cpp" 00064 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00065 00066 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00067 #pragma implementation ("ESF_Copy_On_Read.cpp") 00068 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00069 00070 #endif /* TAO_ESF_COPY_ON_READ_H */