Object.h File Reference

#include "tao/IOP_IORC.h"
#include "tao/CORBA_methods.h"
#include "tao/Policy_ForwardC.h"
#include "tao/Pseudo_VarOut_T.h"
#include "tao/Object_Argument_T.h"
#include "tao/Arg_Traits_T.h"
#include "tao/Any_Insert_Policy_T.h"
#include "tao/Object.i"

Include dependency graph for Object.h:

Include dependency graph

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

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  TAO
namespace  CORBA

Functions

TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const CORBA::Object *)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &, CORBA::Object *&)

Variables

ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class 
ACE_Lock
ACE_END_VERSIONED_NAMESPACE_DECL
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
class 
TAO_Stub
TAO_Export TAO::Object_Proxy_Broker *(* _TAO_Object_Proxy_Broker_Factory_function_pointer )(void)


Detailed Description

Object.h,v 1.115 2006/06/27 06:22:13 jwillemsen Exp

A "Object" is an entity that can be the target of an invocation using an ORB. All CORBA objects provide this functionality. See the CORBA 3.x specification for details.

Author:
Portions Copyright 1994-1995 by Sun Microsystems Inc.

Portions Copyright 1997-2002 by Washington University

Definition in file Object.h.


Function Documentation

TAO_Export CORBA::Boolean operator<< TAO_OutputCDR ,
const CORBA::Object
 

Definition at line 709 of file Object.cpp.

References CORBA::Object::_stubobj(), ACE_OutputCDR::good_bit(), CORBA::Object::ior(), CORBA::Object::is_evaluated(), TAO_Stub::marshal(), ACE_OutputCDR::write_char(), and ACE_OutputCDR::write_ulong().

00710 {
00711   if (x == 0)
00712     {
00713       // NIL objrefs ... marshal as empty type hint, no elements.
00714       cdr.write_ulong (1);
00715       cdr.write_char ('\0');
00716       cdr.write_ulong (0);
00717       return (CORBA::Boolean) cdr.good_bit ();
00718     }
00719 
00720   if (!x->is_evaluated ())
00721     {
00722       // @@ This is too inefficient. Need to speed this up if this is
00723       // a bottle neck.
00724       cdr << const_cast<IOP::IOR &> (x->ior ());
00725       return cdr.good_bit ();
00726     }
00727 
00728    TAO_Stub *stubobj = x->_stubobj ();
00729 
00730    if (stubobj == 0)
00731      return false;
00732 
00733   return (stubobj->marshal (cdr));
00734 }

TAO_Export CORBA::Boolean operator>> TAO_InputCDR ,
CORBA::Object *& 
 

Definition at line 850 of file Object.cpp.

References CORBA::Object::_nil(), ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_CHECK_RETURN, ACE_DEBUG, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_ERROR_RETURN, ACE_NEW_RETURN, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, TAO_ORB_Core::connector_registry(), TAO_ORB_Core::create_object(), TAO_Connector_Registry::create_profile(), TAO_ORB_Core::create_stub(), TAO_Stub_Auto_Ptr::get(), TAO_MProfile::give_profile(), ACE_InputCDR::good_bit(), TAO::String_var< charT >::in(), TAO::String_var< charT >::inout(), LM_ERROR, LM_WARNING, TAO_InputCDR::orb_core(), TAO_MProfile::profile_count(), TAO_Stub_Auto_Ptr::release(), TAO_ORB_Core::resource_factory(), TAO_Resource_Factory::resource_usage_strategy(), CORBA::String_var, TAO_debug_level, and TAO_ORB_Core_instance().

00851 {
00852   bool lazy_strategy = false;
00853   TAO_ORB_Core *orb_core = cdr.orb_core ();
00854 
00855   if (orb_core == 0)
00856     {
00857       orb_core = TAO_ORB_Core_instance ();
00858       if (TAO_debug_level > 0)
00859         {
00860           ACE_DEBUG ((LM_WARNING,
00861                       ACE_TEXT ("TAO (%P|%t) WARNING: extracting object from ")
00862                       ACE_TEXT ("default ORB_Core\n")));
00863         }
00864     }
00865   else
00866     {
00867       if (orb_core->resource_factory ()->resource_usage_strategy () ==
00868           TAO_Resource_Factory::TAO_LAZY)
00869         lazy_strategy = true;
00870     }
00871 
00872   if (!lazy_strategy)
00873     {
00874       // If the user has set up a eager strategy..
00875       CORBA::String_var type_hint;
00876 
00877       if ((cdr >> type_hint.inout ()) == 0)
00878         return 0;
00879 
00880       CORBA::ULong profile_count;
00881       if ((cdr >> profile_count) == 0)
00882         return 0;
00883 
00884       if (profile_count == 0)
00885         {
00886           x = CORBA::Object::_nil ();
00887           return (CORBA::Boolean) cdr.good_bit ();
00888         }
00889 
00890       // get a profile container to store all profiles in the IOR.
00891       TAO_MProfile mp (profile_count);
00892 
00893       TAO_ORB_Core *orb_core = cdr.orb_core ();
00894       if (orb_core == 0)
00895         {
00896           orb_core = TAO_ORB_Core_instance ();
00897           if (TAO_debug_level > 0)
00898             {
00899               ACE_DEBUG ((LM_WARNING,
00900                           ACE_TEXT ("TAO (%P|%t) - Object::tao_object_initialize ")
00901                           ACE_TEXT ("WARNING: extracting object from ")
00902                           ACE_TEXT ("default ORB_Core\n")));
00903             }
00904         }
00905 
00906       // Ownership of type_hint is given to TAO_Stub
00907       // TAO_Stub will make a copy of mp!
00908 
00909       TAO_Stub *objdata = 0;
00910 
00911       ACE_DECLARE_NEW_CORBA_ENV;
00912       ACE_TRY
00913         {
00914           TAO_Connector_Registry *connector_registry =
00915             orb_core->connector_registry (ACE_ENV_SINGLE_ARG_PARAMETER);
00916           ACE_TRY_CHECK;
00917 
00918           for (CORBA::ULong i = 0; i != profile_count && cdr.good_bit (); ++i)
00919             {
00920               TAO_Profile *pfile =
00921                 connector_registry->create_profile (cdr);
00922               if (pfile != 0)
00923                 mp.give_profile (pfile);
00924             }
00925 
00926           // Make sure we got some profiles!
00927           if (mp.profile_count () != profile_count)
00928             {
00929               // @@ This occurs when profile creation fails when decoding the
00930               //    profile from the IOR.
00931               ACE_ERROR_RETURN ((LM_ERROR,
00932                                  ACE_TEXT ("TAO (%P|%t) ERROR: Could not create all ")
00933                                  ACE_TEXT ("profiles while extracting object\n")
00934                                  ACE_TEXT ("TAO (%P|%t) ERROR: reference from the ")
00935                                  ACE_TEXT ("CDR stream.\n")),
00936                                 0);
00937             }
00938 
00939 
00940           objdata = orb_core->create_stub (type_hint.in (),
00941                                            mp
00942                                            ACE_ENV_ARG_PARAMETER);
00943           ACE_TRY_CHECK;
00944         }
00945       ACE_CATCHANY
00946         {
00947           if (TAO_debug_level > 0)
00948             ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00949                                  ACE_TEXT ("TAO - ERROR creating stub ")
00950                                  ACE_TEXT ("object when demarshaling object ")
00951                                  ACE_TEXT ("reference.\n"));
00952 
00953           return 0;
00954         }
00955       ACE_ENDTRY;
00956       ACE_CHECK_RETURN (0);
00957 
00958       TAO_Stub_Auto_Ptr safe_objdata (objdata);
00959 
00960       x = orb_core->create_object (safe_objdata.get ());
00961       if (x == 0)
00962         return 0;
00963 
00964       // Transfer ownership to the CORBA::Object
00965       (void) safe_objdata.release ();
00966     }
00967   else
00968     {
00969       // Lazy strategy!
00970       IOP::IOR *ior = 0;
00971 
00972       ACE_NEW_RETURN (ior,
00973                       IOP::IOR (),
00974                       0);
00975 
00976       cdr >> *ior;
00977       ACE_NEW_RETURN (x,
00978                       CORBA::Object (ior,
00979                                      orb_core),
00980                       0);
00981     }
00982 
00983   return (CORBA::Boolean) cdr.good_bit ();
00984 }


Variable Documentation

TAO_Export TAO::Object_Proxy_Broker*(* _TAO_Object_Proxy_Broker_Factory_function_pointer)(void)
 

This function pointer is set only when the Portable server library is present.

Definition at line 449 of file Object.h.

Referenced by TAO_Stub::is_collocated().

ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Lock
 

Definition at line 43 of file Object.h.

ACE_END_VERSIONED_NAMESPACE_DECL TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_Stub
 

Definition at line 48 of file Object.h.


Generated on Thu Nov 9 12:02:37 2006 for TAO by doxygen 1.3.6