#include <ESF_Copy_On_Read.h>
Inheritance diagram for TAO_ESF_Copy_On_Read< PROXY, COLLECTION, ITERATOR, ACE_LOCK >:
Public Member Functions | |
TAO_ESF_Copy_On_Read (void) | |
Constructors. | |
TAO_ESF_Copy_On_Read (const COLLECTION &collection) | |
virtual void | for_each (TAO_ESF_Worker< PROXY > *worker ACE_ENV_ARG_DECL) |
virtual void | connected (PROXY *proxy ACE_ENV_ARG_DECL) |
virtual void | reconnected (PROXY *proxy ACE_ENV_ARG_DECL) |
virtual void | disconnected (PROXY *proxy ACE_ENV_ARG_DECL) |
virtual void | shutdown (ACE_ENV_SINGLE_ARG_DECL) |
Private Attributes | |
COLLECTION | collection_ |
ACE_LOCK | lock_ |
The class is parametric on the kind of collection and locking mechanism used.
Definition at line 38 of file ESF_Copy_On_Read.h.
|
Constructors.
Definition at line 13 of file ESF_Copy_On_Read.cpp.
00014 { 00015 } |
|
Definition at line 19 of file ESF_Copy_On_Read.cpp.
00020 : collection_ (collection) 00021 { 00022 } |
|
Definition at line 79 of file ESF_Copy_On_Read.cpp. References ACE_ENV_ARG_PARAMETER, and ACE_GUARD.
00081 { 00082 ACE_GUARD (ACE_LOCK, ace_mon, this->lock_); 00083 00084 proxy->_incr_refcnt (); 00085 this->collection_.connected (proxy ACE_ENV_ARG_PARAMETER); 00086 } |
|
Definition at line 101 of file ESF_Copy_On_Read.cpp. References ACE_ENV_ARG_PARAMETER, and ACE_GUARD.
00103 { 00104 ACE_GUARD (ACE_LOCK, ace_mon, this->lock_); 00105 00106 this->collection_.disconnected (proxy ACE_ENV_ARG_PARAMETER); 00107 } |
|
Definition at line 26 of file ESF_Copy_On_Read.cpp. References ACE_CATCHANY, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_GUARD, ACE_NEW, ACE_RE_THROW, ACE_TRY, and ACE_TRY_CHECK.
00028 { 00029 // @@ Use an allocator for this memory... 00030 PROXY **proxies = 0; 00031 size_t size = 0; 00032 ACE_TRY 00033 { 00034 { 00035 ACE_GUARD (ACE_LOCK, ace_mon, this->lock_); 00036 00037 size = this->collection_.size (); 00038 ACE_NEW (proxies, PROXY*[size]); 00039 PROXY **j = proxies; 00040 00041 for (; j != proxies + size; ++j) 00042 *j = 0; 00043 00044 j = proxies; 00045 00046 ITERATOR end = this->collection_.end (); 00047 for (ITERATOR i = this->collection_.begin (); i != end; ++i) 00048 { 00049 *j = *i; 00050 (*j)->_incr_refcnt (); 00051 ++j; 00052 } 00053 } 00054 worker->set_size(size); 00055 for (PROXY **j = proxies; j != proxies + size; ++j) 00056 { 00057 worker->work (*j ACE_ENV_ARG_PARAMETER); 00058 ACE_TRY_CHECK; 00059 (*j)->_decr_refcnt (); 00060 } 00061 delete[] proxies; 00062 } 00063 ACE_CATCHANY 00064 { 00065 for (PROXY **j = proxies; j != proxies + size; ++j) 00066 { 00067 if (*j != 0) 00068 (*j)->_decr_refcnt (); 00069 } 00070 delete[] proxies; 00071 00072 ACE_RE_THROW; 00073 } 00074 ACE_ENDTRY; 00075 } |
|
Definition at line 90 of file ESF_Copy_On_Read.cpp. References ACE_ENV_ARG_PARAMETER, and ACE_GUARD.
00092 { 00093 ACE_GUARD (ACE_LOCK, ace_mon, this->lock_); 00094 00095 proxy->_incr_refcnt (); 00096 this->collection_.reconnected (proxy ACE_ENV_ARG_PARAMETER); 00097 } |
|
Definition at line 111 of file ESF_Copy_On_Read.cpp. References ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_GUARD.
00112 { 00113 ACE_GUARD (ACE_LOCK, ace_mon, this->lock_); 00114 00115 this->collection_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); 00116 } |
|
Definition at line 57 of file ESF_Copy_On_Read.h. |
|
Definition at line 59 of file ESF_Copy_On_Read.h. |