#include "tao/Valuetype/valuetype_export.h"#include "tao/Valuetype/Value_CORBA_methods.h"#include "tao/Object_Argument_T.h"#include "tao/Arg_Traits_T.h"#include "tao/Objref_VarOut_T.h"#include "tao/Object.h"#include "tao/Pseudo_VarOut_T.h"#include "tao/Valuetype/AbstractBase.inl"

Go to the source code of this file.
Classes | |
| class | CORBA::AbstractBase |
| Abstract base class for Interfaces and Valuetypes. More... | |
| class | TAO::Arg_Traits< CORBA::AbstractBase > |
Namespaces | |
| namespace | CORBA |
FUZZ: disable check_for_include/. | |
| namespace | TAO |
Define symbolic names for the ORB collocation strategies. | |
Defines | |
| #define | TAO_EXPORT_MACRO TAO_Valuetype_Export |
Typedefs | |
| typedef TAO_Pseudo_Var_T < AbstractBase > | CORBA::AbstractBase_var |
| typedef TAO_Pseudo_Out_T < AbstractBase > | CORBA::AbstractBase_out |
Functions | |
| TAO_Valuetype_Export CORBA::Boolean | operator<< (TAO_OutputCDR &, const CORBA::AbstractBase_ptr) |
| TAO_Valuetype_Export CORBA::Boolean | operator>> (TAO_InputCDR &, CORBA::AbstractBase_ptr &) |
Definition in file AbstractBase.h.
| #define TAO_EXPORT_MACRO TAO_Valuetype_Export |
Definition at line 39 of file AbstractBase.h.
| TAO_Valuetype_Export CORBA::Boolean operator<< | ( | TAO_OutputCDR & | , | |
| const CORBA::AbstractBase_ptr | ||||
| ) |
Definition at line 198 of file AbstractBase.cpp.
{
CORBA::Boolean discriminator = true;
// We marshal a null abstract interface ptr as a discriminator
// plus null object reference (see CORBA::Object::marshal()
// and operator << for CORBA::Object).
if (CORBA::is_nil (abs))
{
// Marshal discriminator, then empty type hint.
strm << ACE_OutputCDR::from_boolean (discriminator);
strm.write_ulong (1);
strm.write_char ('\0');
strm.write_ulong (0);
return (CORBA::Boolean) strm.good_bit ();
}
if (abs->_is_objref ())
{
if (strm << ACE_OutputCDR::from_boolean (discriminator))
{
TAO_Stub *stubobj = abs->_stubobj ();
if (stubobj == 0)
{
return false;
}
// STRING, a type ID hint
if ((strm << stubobj->type_id.in ()) == 0)
{
return false;
}
const TAO_MProfile& mprofile = stubobj->base_profiles ();
CORBA::ULong const profile_count = mprofile.profile_count ();
if ((strm << profile_count) == 0)
{
return false;
}
// @@ The MProfile should be locked during this iteration, is there
// anyway to achieve that?
for (CORBA::ULong i = 0; i < profile_count; ++i)
{
const TAO_Profile *p = mprofile.get_profile (i);
if (p->encode (strm) == 0)
{
return false;
}
}
return (CORBA::Boolean) strm.good_bit ();
}
}
else
{
discriminator = false;
if (strm << ACE_OutputCDR::from_boolean (discriminator))
{
CORBA::Boolean retval = true;
CORBA::ULong value_tag = TAO_OBV_GIOP_Flags::Value_tag_base
| TAO_OBV_GIOP_Flags::Type_info_single;
retval = strm.write_ulong (value_tag);
if (retval == 0)
{
return retval;
}
retval = strm << abs->_tao_obv_repository_id ();
if (retval == 0)
{
return retval;
}
return abs->_tao_marshal_v (strm);
}
}
return false;
}
| TAO_Valuetype_Export CORBA::Boolean operator>> | ( | TAO_InputCDR & | , | |
| CORBA::AbstractBase_ptr & | ||||
| ) |
Definition at line 289 of file AbstractBase.cpp.
{
abs = 0;
CORBA::Boolean discriminator = false;
ACE_InputCDR::to_boolean tb (discriminator);
TAO_ORB_Core *orb_core = 0;
if (strm >> tb)
{
if (!discriminator)
{
CORBA::ULong value_tag;
if (!strm.read_ulong (value_tag))
{
return false;
}
if (TAO_OBV_GIOP_Flags::is_null_ref (value_tag))
{
// Ok, null reference unmarshaled.
return true;
}
if (!TAO_OBV_GIOP_Flags::is_value_tag (value_tag))
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("operator>> CORBA::AbstractBase ")
ACE_TEXT ("not value_tag\n")));
return false;
}
CORBA::String_var repo_id_stream;
// It would be more efficient not to copy the string)
if (strm.read_string (repo_id_stream.inout ()) == 0)
{
return false;
}
orb_core = strm.orb_core ();
if (orb_core == 0)
{
orb_core = TAO_ORB_Core_instance ();
if (TAO_debug_level > 0)
{
ACE_DEBUG ((LM_WARNING,
"TAO (%P|%t) WARNING: extracting "
"valuetype using default ORB_Core\n"));
}
}
CORBA::ValueFactory_var factory =
orb_core->orb ()->lookup_value_factory (repo_id_stream.in ());
// We should throw an exception, if there were an appropriate one.
if (factory.in() == 0)
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("(%N:%l): The following unknown type was received: `%s'."),
repo_id_stream.in ()));
return false;
}
abs = factory->create_for_unmarshal_abstract ();
return (abs == 0 ? false : abs->_tao_unmarshal_v (strm));
}
else
{
CORBA::Object_var generic_objref;
if (strm >> generic_objref.inout ())
{
TAO_Stub *concrete_stubobj = generic_objref->_stubobj ();
CORBA::Boolean const stores_orb =
! CORBA::is_nil (concrete_stubobj->servant_orb_var ().in ());
if (stores_orb)
{
orb_core =
concrete_stubobj->servant_orb_var ()->orb_core ();
}
CORBA::Boolean const collocated =
orb_core != 0
&& orb_core->optimize_collocation_objects ()
&& generic_objref->_is_collocated ();
ACE_NEW_RETURN (abs,
CORBA::AbstractBase (
concrete_stubobj,
collocated,
generic_objref->_servant ()),
false);
return true;
}
}
}
return false;
}
1.7.0