TAO::Narrow_Utils< T > Class Template Reference

#include <Object_T.h>

List of all members.

Public Types

typedef T * T_ptr

Static Public Member Functions

T_ptr narrow (CORBA::Object_ptr, const char *repo_id, Proxy_Broker_Factory)
T_ptr unchecked_narrow (CORBA::Object_ptr, Proxy_Broker_Factory)
T_ptr unchecked_narrow (CORBA::Object_ptr, const char *repo_id, Proxy_Broker_Factory)

Static Private Member Functions

T_ptr lazy_evaluation (CORBA::Object_ptr)

template<typename T>
class TAO::Narrow_Utils< T >


Member Typedef Documentation

template<typename T>
typedef T* TAO::Narrow_Utils< T >::T_ptr
 

Definition at line 48 of file Object_T.h.

Referenced by TAO::Narrow_Utils< T >::lazy_evaluation(), and TAO::Narrow_Utils< T >::unchecked_narrow().


Member Function Documentation

template<typename T>
T * TAO::Narrow_Utils< T >::lazy_evaluation CORBA::Object_ptr   )  [static, private]
 

Definition at line 117 of file Object_T.cpp.

References ACE_NEW_RETURN, CORBA::Object::is_evaluated(), CORBA::Object_ptr, CORBA::Object::orb_core(), CORBA::Object::steal_ior(), and TAO::Narrow_Utils< T >::T_ptr.

00118   {
00119     T_ptr default_proxy = T::_nil ();
00120 
00121     // Code for lazily evaluated IORs.
00122     if (!obj->is_evaluated ())
00123       {
00124         ACE_NEW_RETURN (default_proxy,
00125                         T (obj->steal_ior (),
00126                            obj->orb_core ()),
00127                         T::_nil ());
00128       }
00129 
00130     return default_proxy;
00131   }

template<typename T>
T * TAO::Narrow_Utils< T >::narrow CORBA::Object_ptr  ,
const char *  repo_id,
Proxy_Broker_Factory 
[static]
 

Definition at line 16 of file Object_T.cpp.

References CORBA::Object::_is_a(), ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, CORBA::is_nil(), CORBA::Object_ptr, TAO::Proxy_Broker_Factory, and TAO::Narrow_Utils< T >::unchecked_narrow().

Referenced by CORBA::Policy::_narrow(), CORBA::ConstructionPolicy::_narrow(), and CORBA::DomainManager::_narrow().

00020   {
00021     if (CORBA::is_nil (obj))
00022       {
00023         return T::_nil ();
00024       }
00025 
00026     CORBA::Boolean is_it = obj->_is_a (repo_id
00027                                        ACE_ENV_ARG_PARAMETER);
00028     ACE_CHECK_RETURN (T::_nil ());
00029 
00030     if (is_it == 0)
00031       {
00032         return T::_nil ();
00033       }
00034 
00035     return TAO::Narrow_Utils<T>::unchecked_narrow (obj,
00036                                                    repo_id,
00037                                                    pbf
00038                                                    ACE_ENV_ARG_PARAMETER);
00039   }

template<typename T>
T * TAO::Narrow_Utils< T >::unchecked_narrow CORBA::Object_ptr  ,
const char *  repo_id,
Proxy_Broker_Factory 
[static]
 

Definition at line 69 of file Object_T.cpp.

References TAO_Stub::_incr_refcnt(), CORBA::Object::_is_collocated(), CORBA::Object::_is_local(), CORBA::Object::_servant(), CORBA::Object::_stubobj(), ACE_NEW_THROW_EX, ACE_THROW_RETURN, TAO_Pseudo_Var_T< T >::in(), CORBA::is_nil(), CORBA::Object_ptr, TAO_Stub::optimize_collocation_objects(), TAO::Proxy_Broker_Factory, TAO_Stub::servant_orb_var(), and TAO::Narrow_Utils< T >::T_ptr.

00073   {
00074     if (CORBA::is_nil (obj))
00075       {
00076         return T::_nil ();
00077       }
00078 
00079     if (obj->_is_local ())
00080       {
00081         return T::_duplicate (dynamic_cast<T *> (obj));
00082       }
00083 
00084     T_ptr proxy = Narrow_Utils<T>::lazy_evaluation (obj);
00085 
00086     if (!CORBA::is_nil (proxy))
00087       {
00088         return proxy;
00089       }
00090 
00091     TAO_Stub* stub = obj->_stubobj ();
00092 
00093     if (stub == 0)
00094       {
00095         // If we're here, we have been passed a bogus objref.
00096         ACE_THROW_RETURN (CORBA::BAD_PARAM (), T::_nil ());
00097       }
00098 
00099     stub->_incr_refcnt ();
00100 
00101     bool collocated =
00102       !CORBA::is_nil (stub->servant_orb_var ().in ())
00103       && stub->optimize_collocation_objects ()
00104       && obj->_is_collocated ()
00105       && pbf != 0;
00106 
00107     ACE_NEW_THROW_EX (proxy,
00108                       T (stub,
00109                          collocated ? 1 : 0,
00110                          obj->_servant ()),
00111                       CORBA::NO_MEMORY ());
00112     return proxy;
00113   }

template<typename T>
T * TAO::Narrow_Utils< T >::unchecked_narrow CORBA::Object_ptr  ,
Proxy_Broker_Factory 
[static]
 

Definition at line 42 of file Object_T.cpp.

References ACE_CATCHANY, ACE_CHECK_RETURN, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY, ACE_TRY_CHECK, CORBA::Object_ptr, and TAO::Proxy_Broker_Factory.

Referenced by CORBA::Policy::_unchecked_narrow(), CORBA::ConstructionPolicy::_unchecked_narrow(), CORBA::DomainManager::_unchecked_narrow(), TAO::Narrow_Utils< T >::narrow(), and operator>>().

00044   {
00045     ACE_DECLARE_NEW_CORBA_ENV;
00046 
00047     T *proxy = 0;
00048     ACE_TRY
00049       {
00050         proxy =
00051           TAO::Narrow_Utils<T>::unchecked_narrow (obj,
00052                                                   0,
00053                                                   pbf
00054                                                   ACE_ENV_ARG_PARAMETER);
00055         ACE_TRY_CHECK;
00056       }
00057     ACE_CATCHANY
00058       {
00059         // Swallow the exception
00060         return T::_nil ();
00061       }
00062     ACE_ENDTRY;
00063     ACE_CHECK_RETURN (proxy);
00064 
00065     return proxy;
00066   }


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:26:34 2006 for TAO by doxygen 1.3.6