diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-02-27 23:12:27 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-02-27 23:12:27 +0000 |
commit | 4075bff35deee2c0e332ab5db6fb73936fb375bb (patch) | |
tree | b6f62eec9aa9db67137eb66ae020d41827a7e216 /TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.cpp | |
parent | 4a82d19278e3f1eefd32ab50ebb04d0e1fc42d91 (diff) | |
download | ATCD-4075bff35deee2c0e332ab5db6fb73936fb375bb.tar.gz |
ChangeLogTag:Sat Feb 26 21:45:45 2000 Carlos O'Ryan <coryan@uci.edu>ESF
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.cpp')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.cpp | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.cpp new file mode 100644 index 00000000000..5fd6f3adc5b --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Proxy_List.cpp @@ -0,0 +1,89 @@ +// $Id$ + +#ifndef TAO_ESF_PROXY_LIST_CPP +#define TAO_ESF_PROXY_LIST_CPP + +#include "ESF_Proxy_List.h" + +#if ! defined (__ACE_INLINE__) +#include "ESF_Proxy_List.i" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(ESF, ESF_Proxy_List, "$Id$") + +template<class PROXY> +TAO_ESF_Proxy_List<PROXY>:: + TAO_ESF_Proxy_List (void) +{ +} + +template<class PROXY> void +TAO_ESF_Proxy_List<PROXY>::connected (PROXY *proxy, + CORBA::Environment &) +{ + int r = this->impl_.insert (proxy); + if (r == 0) + return; + + if (r == 1) + { + // @@ Already there, throw some user exception.. + proxy->_decr_refcnt (); + } + if (r == -1) + { + // @@ Cannot insert, running out of memory? throw some other + // user exception + proxy->_decr_refcnt (); + } +} + +template<class PROXY> void +TAO_ESF_Proxy_List<PROXY>::reconnected (PROXY *proxy, + CORBA::Environment &) +{ + int r = this->impl_.insert (proxy); + if (r == 0 || r == 1) + { + // Reference count is incremented by the callers to [re]connected. + // @@ Find out if the protocol could be simplified, and decoupling + // increased. + proxy->_decr_refcnt (); + return; + } + + if (r == -1) + { + // @@ Cannot insert, running out of memory? throw some other + // user exception + proxy->_decr_refcnt (); + } +} + +template<class PROXY> void +TAO_ESF_Proxy_List<PROXY>::disconnected (PROXY *proxy, + CORBA::Environment &) +{ + int r = this->impl_.remove (proxy); + if (r != 0) + { + // @@ Cannot remove, throw some other + // user exception + return; + } + proxy->_decr_refcnt (); +} + +template<class PROXY> void +TAO_ESF_Proxy_List<PROXY>::shutdown (CORBA::Environment &) +{ + Iterator end = this->impl_.end (); + for (Iterator i = this->impl_.begin (); i != end; ++i) + { + // Decrement reference count + (*i)->_decr_refcnt (); + } + this->impl_.reset (); +} + +#endif /* TAO_ESF_PROXY_LIST_CPP */ |