EC_Lifetime_Utils_T.cpp File Reference

#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
#include "orbsvcs/Event/EC_Lifetime_Utils_T.inl"

Include dependency graph for EC_Lifetime_Utils_T.cpp:

Go to the source code of this file.

Functions

template<typename T>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
void 
activate (T &obj_ref, PortableServer::POA_ptr poa, PortableServer::ServantBase *servant, TAO_EC_Object_Deactivator &suggested_object_deactivator)
 Helper for activating objects. Activates servant with poa and returns the object reference via obj_ref. If object_deactivator != 0, it is populated with info necessary to deactivate the servant from poa.


Function Documentation

template<typename T>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL void activate ( T &  obj_ref,
PortableServer::POA_ptr  poa,
PortableServer::ServantBase servant,
TAO_EC_Object_Deactivator suggested_object_deactivator 
)

Helper for activating objects. Activates servant with poa and returns the object reference via obj_ref. If object_deactivator != 0, it is populated with info necessary to deactivate the servant from poa.

Definition at line 16 of file EC_Lifetime_Utils_T.cpp.

References TAO_Pseudo_Var_T< T >::in(), CORBA::is_nil(), and TAO_EC_Object_Deactivator::set_values().

Referenced by TAO_ECG_UDP_Sender::new_connect(), TAO_ECG_UDP_Receiver::new_connect(), TAO_ECG_Mcast_EH::open(), and TAO_ECG_Mcast_Gateway::run().

00020 {
00021   // Activate the servant into the POA.
00022   PortableServer::ObjectId_var obj_id =
00023     poa->activate_object (servant);
00024 
00025   suggested_object_deactivator.set_values (poa, obj_id.in ());
00026 
00027   // Get the object reference of the activated object.
00028   CORBA::Object_var obj =
00029     poa->id_to_reference (obj_id.in ());
00030 
00031   // Don't try to use T::_obj_type::_narrow, some compilers don't like it so
00032   // do this in two steps
00033   typedef typename T::_obj_type my_object_type;
00034 
00035   obj_ref =
00036     my_object_type::_narrow (obj.in());
00037 
00038   if (CORBA::is_nil (obj_ref.in ()))
00039   {
00040     throw CORBA::INTERNAL ();
00041   }
00042 }


Generated on Tue Feb 2 17:44:13 2010 for TAO_RTEvent by  doxygen 1.4.7