本文整理汇总了C++中corba::Any_var::impl方法的典型用法代码示例。如果您正苦于以下问题:C++ Any_var::impl方法的具体用法?C++ Any_var::impl怎么用?C++ Any_var::impl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::Any_var
的用法示例。
在下文中一共展示了Any_var::impl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: INTERNAL
CORBA::Boolean
TAO_DynEnum_i::equal (DynamicAny::DynAny_ptr rhs)
{
CORBA::TypeCode_var tc = rhs->type ();
CORBA::Boolean equivalent = tc->equivalent (this->type_.in ());
if (!equivalent)
{
return false;
}
CORBA::Any_var any = rhs->to_any ();
TAO::Any_Impl *impl = any->impl ();
CORBA::ULong value;
if (impl->encoded ())
{
TAO::Unknown_IDL_Type * const unk =
dynamic_cast<TAO::Unknown_IDL_Type *> (impl);
if (!unk)
throw CORBA::INTERNAL ();
// We don't want unk's rd_ptr to move, in case we are shared by
// another Any, so we use this to copy the state, not the buffer.
TAO_InputCDR for_reading (unk->_tao_get_cdr ());
for_reading.read_ulong (value);
}
else
{
TAO_OutputCDR out;
impl->marshal_value (out);
TAO_InputCDR in (out);
in.read_ulong (value);
}
return value == this->value_;
}
示例2: in_cdr
bool
TAO::TypeCode::Case_Enum_T<StringType,
TypeCodeType>::equal_label (::CORBA::ULong index,
::CORBA::TypeCode_ptr tc) const
{
CORBA::Any_var any = tc->member_label (index);
TAO_OutputCDR out_cdr;
if (! any->impl ()->marshal_value (out_cdr))
{
return false;
}
TAO_InputCDR in_cdr (out_cdr);
CORBA::ULong tc_label = ACE_UINT32_MAX;
if (! in_cdr.read_ulong (tc_label))
{
return false;
}
return (this->label_ == tc_label);
}
示例3: catch
int
TAO_Log_Constraint_Visitor::visit_in (
ETCL_Binary_Expr *binary)
{
int return_value = -1;
ETCL_Constraint *lhs = binary->lhs ();
// Determine if the left operand is contained in the right.
if (lhs->accept (this) == 0)
{
TAO_ETCL_Literal_Constraint left;
this->queue_.dequeue_head (left);
ETCL_Constraint *rhs = binary->rhs ();
if (rhs->accept (this) == 0)
{
TAO_ETCL_Literal_Constraint bag;
this->queue_.dequeue_head (bag);
if (bag.expr_type () == ETCL_COMPONENT)
{
CORBA::Any_ptr any_ptr = 0;
ACE_NEW_RETURN (any_ptr,
CORBA::Any,
-1);
CORBA::Any_var component = any_ptr;
component->replace (bag);
component->impl ()->_add_ref ();
CORBA::TCKind kind = CORBA::tk_null;
try
{
CORBA::TypeCode_var tc = component->type ();
kind = TAO_DynAnyFactory::unalias (tc.in ());
}
catch (const CORBA::Exception&)
{
return return_value;
}
CORBA::Boolean result = 0;
switch (kind)
{
case CORBA::tk_sequence:
result = this->sequence_does_contain (&component.in (),
left);
break;
case CORBA::tk_array:
result = this->array_does_contain (&component.in (),
left);
break;
case CORBA::tk_struct:
result = this->struct_does_contain (&component.in (),
left);
break;
case CORBA::tk_union:
result = this->union_does_contain (&component.in (),
left);
break;
case CORBA::tk_any:
result = this->any_does_contain (&component.in (),
left);
break;
default:
return return_value;
}
this->queue_.enqueue_head (TAO_ETCL_Literal_Constraint (result));
return_value = 0;
}
}
}
return return_value;
}
示例4: ftr
void
ReplicaController::send_reply (
PortableInterceptor::ServerRequestInfo_ptr ri)
{
FT::FTRequestServiceContext_var ftr (
extract_context (ri));
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) Sending reply for %s with rid %i\n",
ftr->client_id.in (),
ftr->retention_id));
// Prepare reply for logging.
CORBA::Any_var result =
ri->result ();
TAO_OutputCDR cdr;
result->impl ()->marshal_value (cdr);
Dynamic::ParameterList_var pl =
ri->arguments ();
CORBA::ULong len = pl->length ();
for (CORBA::ULong index = 0; index != len ; ++index)
{
//@@ No chance for PARAM_OUT
if ((*pl)[index].mode == CORBA::PARAM_INOUT)
{
(*pl)[index].argument.impl ()->marshal_value (cdr);
}
}
CORBA::OctetSeq_var reply;
ACE_NEW (reply.out (), CORBA::OctetSeq (cdr.total_length ()));
reply->length (cdr.total_length ());
CORBA::Octet* buf = reply->get_buffer ();
// @@ What if this throws an exception?? We don't have any way to
// check whether this succeeded
for (ACE_Message_Block const* mb = cdr.begin ();
mb != 0;
mb = mb->cont ())
{
ACE_OS::memcpy (buf, mb->rd_ptr (), mb->length ());
buf += mb->length ();
}
// Logging the reply and state update.
//
// First send message to members.
//
{
// Extract state update.
CORBA::OctetSeq_var oid = ri->object_id ();
PortableInterceptor::AdapterName_var an = ri->adapter_name ();
CORBA::Any_var state = ri->get_slot (state_slot_id ());
CORBA::TypeCode_var tc = state->type ();
if (tc->kind () == CORBA::tk_null)
{
ACE_DEBUG ((LM_DEBUG, "Slot update is void\n"));
PortableServer::POA_var poa = resolve_poa (an.in ());
PortableServer::ServantBase_var servant =
poa->id_to_servant (oid.in ());
Checkpointable* target =
dynamic_cast<Checkpointable*> (servant.in ());
if (target)
{
CORBA::Any_var tmp = target->get_state ();
if (tmp.ptr () != 0) state = tmp._retn ();
}
}
TAO_OutputCDR cdr;
cdr << oid.in ();
cdr << an.in ();
cdr << ftr->client_id.in ();
cdr << ftr->retention_id;
cdr << reply.in ();
cdr << state.in ();
size_t size = cdr.total_length ();
//.........这里部分代码省略.........