EC_Lifetime_Utils_T.h File Reference

#include "orbsvcs/Event/EC_Lifetime_Utils.h"

Include dependency graph for EC_Lifetime_Utils_T.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TAO_EC_Auto_Command< T >
 Utility class which executes COMMAND in its destructor. More...
class  TAO_EC_Shutdown_Command< T >
class  TAO_EC_Servant_Var< T >

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 &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.
template<class X, class Y>
bool operator== (TAO_EC_Servant_Var< X > const &x, TAO_EC_Servant_Var< Y > const &y)
 Compare two TAO_EC_Servant_Vars for equivalence.
template<class X, class Y>
bool operator!= (TAO_EC_Servant_Var< X > const &x, TAO_EC_Servant_Var< Y > const &y)
 Compare two TAO_EC_Servant_Vars for non-equivalence.


Detailed Description

Id
EC_Lifetime_Utils_T.h 76589 2007-01-25 18:04:11Z elliott_c

Author:
Jody Hagins (jody@atdesk.com)

Marina Spivak (marina@atdesk.com)

This file is a temporary place for general CORBA application utility classes. These classes will be moved out from the EC library and into TAO or will be replaced by other TAO classes with similar functionality.

Definition in file EC_Lifetime_Utils_T.h.


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 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_Receiver::new_connect(), TAO_ECG_UDP_Sender::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 }

template<class X, class Y>
bool operator!= ( TAO_EC_Servant_Var< X > const &  x,
TAO_EC_Servant_Var< Y > const &  y 
)

Compare two TAO_EC_Servant_Vars for non-equivalence.

Definition at line 327 of file EC_Lifetime_Utils_T.inl.

References TAO_EC_Servant_Var< T >::in().

00329 {
00330   return x.in() != y.in();
00331 }

template<class X, class Y>
bool operator== ( TAO_EC_Servant_Var< X > const &  x,
TAO_EC_Servant_Var< Y > const &  y 
)

Compare two TAO_EC_Servant_Vars for equivalence.

Definition at line 319 of file EC_Lifetime_Utils_T.inl.

References TAO_EC_Servant_Var< T >::in().

00321 {
00322   return x.in() == y.in();
00323 }


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