ESF_Proxy_List.cpp

Go to the documentation of this file.
00001 // ESF_Proxy_List.cpp,v 1.7 2006/03/14 06:14:25 jtc Exp
00002 
00003 #ifndef TAO_ESF_PROXY_LIST_CPP
00004 #define TAO_ESF_PROXY_LIST_CPP
00005 
00006 #include "orbsvcs/ESF/ESF_Proxy_List.h"
00007 
00008 #if ! defined (__ACE_INLINE__)
00009 #include "orbsvcs/ESF/ESF_Proxy_List.i"
00010 #endif /* __ACE_INLINE__ */
00011 
00012 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00013 
00014 template<class PROXY>
00015 TAO_ESF_Proxy_List<PROXY>::TAO_ESF_Proxy_List (void)
00016 {
00017 }
00018 
00019 template<class PROXY> void
00020 TAO_ESF_Proxy_List<PROXY>::connected (PROXY *proxy
00021                                       ACE_ENV_ARG_DECL_NOT_USED)
00022 {
00023   int r = this->impl_.insert (proxy);
00024   if (r == 0)
00025     return;
00026 
00027   if (r == 1)
00028     {
00029       // @@ Already there, throw some user exception..
00030       proxy->_decr_refcnt ();
00031     }
00032   if (r == -1)
00033     {
00034       // @@ Cannot insert, running out of memory? throw some other
00035       // user exception
00036       proxy->_decr_refcnt ();
00037     }
00038 }
00039 
00040 template<class PROXY> void
00041 TAO_ESF_Proxy_List<PROXY>::reconnected (PROXY *proxy
00042                                         ACE_ENV_ARG_DECL_NOT_USED)
00043 {
00044   int r = this->impl_.insert (proxy);
00045   if (r == 0)
00046     return;
00047 
00048   if (r == 1)
00049     {
00050       // Reference count is incremented by the callers to [re]connected.
00051       // @@ Find out if the protocol could be simplified, and decoupling
00052       //    increased.
00053       proxy->_decr_refcnt ();
00054       return;
00055     }
00056 
00057   if (r == -1)
00058     {
00059       // @@ Cannot insert, running out of memory? throw some other
00060       // user exception
00061       proxy->_decr_refcnt ();
00062     }
00063 }
00064 
00065 template<class PROXY> void
00066 TAO_ESF_Proxy_List<PROXY>::disconnected (PROXY *proxy
00067                                          ACE_ENV_ARG_DECL_NOT_USED)
00068 {
00069   int r = this->impl_.remove (proxy);
00070   if (r != 0)
00071     {
00072       // @@ Cannot remove, throw some other
00073       // user exception
00074       return;
00075     }
00076   proxy->_decr_refcnt ();
00077 }
00078 
00079 template<class PROXY> void
00080 TAO_ESF_Proxy_List<PROXY>::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
00081 {
00082   Iterator end = this->impl_.end ();
00083   for (Iterator i = this->impl_.begin (); i != end; ++i)
00084     {
00085       // Decrement reference count
00086       (*i)->_decr_refcnt ();
00087     }
00088   this->impl_.reset ();
00089 }
00090 
00091 TAO_END_VERSIONED_NAMESPACE_DECL
00092 
00093 #endif /* TAO_ESF_PROXY_LIST_CPP */

Generated on Thu Nov 9 13:08:13 2006 for TAO_ESF by doxygen 1.3.6