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/Configurable_Refcount.h"
#include "tao/Object.inl"

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

Id
Object.h 79610 2007-09-07 18:17:34Z johnnyw

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 677 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().

00678 {
00679   if (x == 0)
00680     {
00681       // NIL objrefs ... marshal as empty type hint, no elements.
00682       cdr.write_ulong (1);
00683       cdr.write_char ('\0');
00684       cdr.write_ulong (0);
00685       return (CORBA::Boolean) cdr.good_bit ();
00686     }
00687 
00688   if (!x->is_evaluated ())
00689     {
00690       // @@ This is too inefficient. Need to speed this up if this is
00691       // a bottle neck.
00692       cdr << const_cast<IOP::IOR &> (x->ior ());
00693       return cdr.good_bit ();
00694     }
00695 
00696    TAO_Stub *stubobj = x->_stubobj ();
00697 
00698    if (stubobj == 0)
00699      return false;
00700 
00701   return (stubobj->marshal (cdr));
00702 }

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

Definition at line 807 of file Object.cpp.

References CORBA::Object::_nil(), ACE_DEBUG, ACE_ERROR_RETURN, ACE_NEW_RETURN, ACE_TEXT, 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().

00808 {
00809   bool lazy_strategy = false;
00810   TAO_ORB_Core *orb_core = cdr.orb_core ();
00811 
00812   if (orb_core == 0)
00813     {
00814       orb_core = TAO_ORB_Core_instance ();
00815       if (TAO_debug_level > 0)
00816         {
00817           ACE_DEBUG ((LM_WARNING,
00818                       ACE_TEXT ("TAO (%P|%t) WARNING: extracting object from ")
00819                       ACE_TEXT ("default ORB_Core\n")));
00820         }
00821     }
00822   else
00823     {
00824       if (orb_core->resource_factory ()->resource_usage_strategy () ==
00825           TAO_Resource_Factory::TAO_LAZY)
00826         lazy_strategy = true;
00827     }
00828 
00829   if (!lazy_strategy)
00830     {
00831       // If the user has set up a eager strategy..
00832       CORBA::String_var type_hint;
00833 
00834       if ((cdr >> type_hint.inout ()) == 0)
00835         return 0;
00836 
00837       CORBA::ULong profile_count;
00838       if ((cdr >> profile_count) == 0)
00839         return 0;
00840 
00841       if (profile_count == 0)
00842         {
00843           x = CORBA::Object::_nil ();
00844           return (CORBA::Boolean) cdr.good_bit ();
00845         }
00846 
00847       // get a profile container to store all profiles in the IOR.
00848       TAO_MProfile mp (profile_count);
00849 
00850       TAO_ORB_Core *orb_core = cdr.orb_core ();
00851       if (orb_core == 0)
00852         {
00853           orb_core = TAO_ORB_Core_instance ();
00854           if (TAO_debug_level > 0)
00855             {
00856               ACE_DEBUG ((LM_WARNING,
00857                           ACE_TEXT ("TAO (%P|%t) - Object::tao_object_initialize ")
00858                           ACE_TEXT ("WARNING: extracting object from ")
00859                           ACE_TEXT ("default ORB_Core\n")));
00860             }
00861         }
00862 
00863       // Ownership of type_hint is given to TAO_Stub
00864       // TAO_Stub will make a copy of mp!
00865 
00866       TAO_Stub *objdata = 0;
00867 
00868       try
00869         {
00870           TAO_Connector_Registry *connector_registry =
00871             orb_core->connector_registry ();
00872 
00873           for (CORBA::ULong i = 0; i != profile_count && cdr.good_bit (); ++i)
00874             {
00875               TAO_Profile *pfile = connector_registry->create_profile (cdr);
00876               if (pfile != 0)
00877                 mp.give_profile (pfile);
00878             }
00879 
00880           // Make sure we got some profiles!
00881           if (mp.profile_count () != profile_count)
00882             {
00883               // @@ This occurs when profile creation fails when decoding the
00884               //    profile from the IOR.
00885               ACE_ERROR_RETURN ((LM_ERROR,
00886                                  ACE_TEXT ("TAO (%P|%t) ERROR: Could not create all ")
00887                                  ACE_TEXT ("profiles while extracting object\n")
00888                                  ACE_TEXT ("TAO (%P|%t) ERROR: reference from the ")
00889                                  ACE_TEXT ("CDR stream.\n")),
00890                                 0);
00891             }
00892 
00893           objdata = orb_core->create_stub (type_hint.in (), mp);
00894         }
00895       catch (const ::CORBA::Exception& ex)
00896         {
00897           if (TAO_debug_level > 0)
00898             ex._tao_print_exception (
00899               ACE_TEXT ("TAO - ERROR creating stub ")
00900               ACE_TEXT ("object when demarshaling object ")
00901               ACE_TEXT ("reference.\n"));
00902 
00903           return 0;
00904         }
00905 
00906       TAO_Stub_Auto_Ptr safe_objdata (objdata);
00907 
00908       x = orb_core->create_object (safe_objdata.get ());
00909       if (x == 0)
00910         return 0;
00911 
00912       // Transfer ownership to the CORBA::Object
00913       (void) safe_objdata.release ();
00914     }
00915   else
00916     {
00917       // Lazy strategy!
00918       IOP::IOR *ior = 0;
00919 
00920       ACE_NEW_RETURN (ior,
00921                       IOP::IOR (),
00922                       0);
00923 
00924       cdr >> *ior;
00925       ACE_NEW_RETURN (x,
00926                       CORBA::Object (ior, orb_core),
00927                       0);
00928     }
00929 
00930   return (CORBA::Boolean) cdr.good_bit ();
00931 }


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 456 of file Object.h.

Referenced by TAO_Stub::is_collocated().

ACE_BEGIN_VERSIONED_NAMESPACE_DECL class ACE_Lock
 

Definition at line 44 of file Object.h.

ACE_END_VERSIONED_NAMESPACE_DECL TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_Stub
 

Definition at line 49 of file Object.h.


Generated on Sun Jan 27 13:11:45 2008 for TAO by doxygen 1.3.6