本文整理汇总了C++中TAO_Stub::base_profiles方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_Stub::base_profiles方法的具体用法?C++ TAO_Stub::base_profiles怎么用?C++ TAO_Stub::base_profiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAO_Stub
的用法示例。
在下文中一共展示了TAO_Stub::base_profiles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
Invocation_Adapter::object_forwarded (CORBA::Object_var &effective_target,
TAO_Stub *stub,
CORBA::Boolean permanent_forward)
{
// The object pointer has to be changed to a TAO_Stub pointer
// in order to obtain the profiles.
TAO_Stub *stubobj = 0;
bool nil_forward_ref = false;
if (CORBA::is_nil (effective_target.in ()))
nil_forward_ref = true;
else
{
stubobj = effective_target->_stubobj ();
if (stubobj && stubobj->base_profiles ().size () == 0)
nil_forward_ref = true;
}
if (nil_forward_ref)
throw ::CORBA::TRANSIENT (
CORBA::SystemException::_tao_minor_code (
TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE,
0),
CORBA::COMPLETED_NO);
if (stubobj == 0)
throw ::CORBA::INTERNAL (
CORBA::SystemException::_tao_minor_code (
TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE,
EINVAL),
CORBA::COMPLETED_NO);
// Reset the profile in the stubs
stub->add_forward_profiles (stubobj->base_profiles (), permanent_forward);
if (stub->next_profile () == 0)
throw ::CORBA::TRANSIENT (
CORBA::SystemException::_tao_minor_code (
TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE,
0),
CORBA::COMPLETED_NO);
}
示例2: return
CORBA::Boolean
operator<< (TAO_OutputCDR &strm, const CORBA::AbstractBase_ptr abs)
{
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);
return strm << CORBA::Object::_nil ();
}
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::ULong value_tag = TAO_OBV_GIOP_Flags::Value_tag_base
| TAO_OBV_GIOP_Flags::Type_info_single;
if ((strm.write_ulong (value_tag)) == 0)
{
return false;
}
if ((strm << abs->_tao_obv_repository_id ()) == 0)
{
return false;
}
return abs->_tao_marshal_v (strm);
}
}
return false;
}