本文整理汇总了C++中corba::Any_var::in方法的典型用法代码示例。如果您正苦于以下问题:C++ Any_var::in方法的具体用法?C++ Any_var::in怎么用?C++ Any_var::in使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::Any_var
的用法示例。
在下文中一共展示了Any_var::in方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
EDF_Scheduler::receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri)
{
int int_guid;
DSUI_EVENT_LOG (EDF_SCHED_FAM, ENTER_RECEIVE_REPLY, 0, 0, 0);
RTScheduling::Current::IdType guid;
CORBA::String_var operation = ri->operation ();
CORBA::Object_var target = ri->target ();
ACE_CString opname = operation.in ();
#ifdef KOKYU_DSRT_LOGGING
ACE_DEBUG ((LM_DEBUG,
"(%t|%T):receive_reply from "
"\"%s\"\n",
opname.c_str ()));
#endif
// Check that the reply service context was received as
// expected.
IOP::ServiceContext_var sc =
ri->get_reply_service_context (Client_Interceptor::SchedulingInfo);
CORBA::Long importance;
TimeBase::TimeT deadline;
if (sc.ptr () == 0)
{
ACE_DEBUG ((LM_DEBUG, "service context was not filled\n"));
//24 hrs from now - infinity
ACE_Time_Value deadline_tv = ACE_OS::gettimeofday () + ACE_Time_Value (24*60*60,0);
deadline = deadline_tv.sec ()*1000000 + deadline_tv.usec ()*10; //100s of nanoseconds for TimeBase::TimeT
importance = 0;
}
else
{
CORBA::OctetSeq oc_seq = CORBA::OctetSeq (sc->context_data.length (),
sc->context_data.length (),
sc->context_data.get_buffer (),
0);
//Don't store in a _var, since >>= returns a pointer to an internal buffer
//and we are not supposed to free it.
Kokyu::Svc_Ctxt_DSRT_QoS* sc_qos_ptr;
CORBA::Any sc_qos_as_any;
CORBA::Any_var scqostmp = codec_->decode (oc_seq);
sc_qos_as_any = scqostmp.in ();
sc_qos_as_any >>= sc_qos_ptr;
deadline = sc_qos_ptr->deadline;
importance = sc_qos_ptr->importance;
guid.length (sc_qos_ptr->guid.length ());
guid_copy (guid, sc_qos_ptr->guid);
ACE_DEBUG ((LM_DEBUG,
"(%t|%T):Importance = %d in recvd service context\n",
importance));
}
ACE_OS::memcpy (&int_guid,
guid.get_buffer (),
guid.length ());
EDF_Scheduler_Traits::QoSDescriptor_t qos;
qos.deadline_ = qos.importance_ = importance;
qos.deadline_ = deadline;
this->kokyu_dispatcher_->schedule (guid, qos);
DSUI_EVENT_LOG (EDF_SCHED_FAM, EXIT_RECEIVE_REPLY, int_guid, 0, 0);
}
示例2: execute
bool execute() {
try {
if (mdocall) {
CORBA::Any_var any = mfact->callOperation( mop.c_str(), nargs.inout() );
for (size_t i=0; i < margs.size(); ++i ) {
const types::TypeInfo* ti = margs[i]->getTypeInfo();
CorbaTypeTransporter* ctt = dynamic_cast<CorbaTypeTransporter*>( ti->getProtocol(ORO_CORBA_PROTOCOL_ID) );
assert( ctt );
ctt->updateFromAny( &nargs[i], margs[i] );
}
// convert returned any to local type:
if (mctt)
return mctt->updateFromAny(&any.in(), mresult);
} else {
CSendHandle_var sh = mfact->sendOperation( mop.c_str(), nargs.in() );
AssignableDataSource<CSendHandle_var>::shared_ptr ads = AssignableDataSource<CSendHandle_var>::narrow( mresult.get() );
if (ads) {
ads->set( sh ); // _var creates a copy of the obj reference.
}
}
return true;
} catch ( corba::CNoSuchNameException& ) {
return false;
} catch ( corba::CWrongNumbArgException& ) {
return false;
} catch ( corba::CWrongTypeArgException& ) {
return false;
}
}
示例3:
DynamicAny::AnySeq *
TAO_DynSequence_i::get_elements (void)
{
if (this->destroyed_)
{
throw ::CORBA::OBJECT_NOT_EXIST ();
}
CORBA::ULong length = static_cast<CORBA::ULong> (this->da_members_.size ());
DynamicAny::AnySeq *elements;
ACE_NEW_THROW_EX (elements,
DynamicAny::AnySeq (length),
CORBA::NO_MEMORY ());
elements->length (length);
DynamicAny::AnySeq_var safe_retval = elements;
// Initialize each Any.
for (CORBA::ULong i = 0; i < length; ++i)
{
CORBA::Any_var tmp =
this->da_members_[i]->to_any ();
safe_retval[i] = tmp.in ();
}
return safe_retval._retn ();
}
示例4:
CORBA::Contained::Description *
TAO_ConstantDef_i::describe_i (void)
{
CORBA::Contained::Description *desc_ptr = 0;
ACE_NEW_THROW_EX (desc_ptr,
CORBA::Contained::Description,
CORBA::NO_MEMORY ());
CORBA::Contained::Description_var retval = desc_ptr;
retval->kind = this->def_kind ();
CORBA::ConstantDescription cd;
cd.name = this->name_i ();
cd.id = this->id_i ();
ACE_TString container_id;
this->repo_->config ()->get_string_value (this->section_key_,
"container_id",
container_id);
cd.defined_in = container_id.c_str ();
cd.version = this->version_i ();
cd.type = this->type_i ();
CORBA::Any_var val = this->value_i ();
cd.value = val.in ();
retval->value <<= cd;
return retval._retn ();
}
示例5:
void
MIF_Scheduler::receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri)
{
RTScheduling::Current::IdType guid;
CORBA::Short importance=0;
CORBA::String_var operation = ri->operation ();
CORBA::Object_var target = ri->target ();
ACE_CString opname = operation.in ();
#ifdef KOKYU_DSRT_LOGGING
ACE_DEBUG ((LM_DEBUG,
"(%t|%T):receive_reply from "
"\"%s\"\n",
opname.c_str ()));
#endif
// Check that the reply service context was received as
// expected.
IOP::ServiceContext_var sc =
ri->get_reply_service_context (Client_Interceptor::SchedulingInfo);
if (sc.ptr () == 0)
{
importance = 0;
}
else
{
CORBA::OctetSeq oc_seq = CORBA::OctetSeq (sc->context_data.length (),
sc->context_data.length (),
sc->context_data.get_buffer (),
0);
//Don't store in a _var, since >>= returns a pointer to an internal buffer
//and we are not supposed to free it.
Kokyu::Svc_Ctxt_DSRT_QoS* sc_qos_ptr;
CORBA::Any sc_qos_as_any;
CORBA::Any_var scqostmp = codec_->decode (oc_seq);
sc_qos_as_any = scqostmp.in ();
sc_qos_as_any >>= sc_qos_ptr;
importance = sc_qos_ptr->importance;
guid.length (sc_qos_ptr->guid.length ());
guid_copy (guid, sc_qos_ptr->guid);
#ifdef KOKYU_DSRT_LOGGING
ACE_DEBUG ((LM_DEBUG,
"(%t|%T): Importance = %d in recvd service context\n",
importance ));
#endif
}
MIF_Scheduler_Traits::QoSDescriptor_t qos;
qos.importance_ = importance;
this->kokyu_dispatcher_->schedule (guid, qos);
}
示例6:
void
OCI_APT::ArgList::prepare_request(CORBA::NVList_ptr args,
CORBA::TypeCode_ptr &result_tc,
bool &is_oneway)
{
is_oneway = this->is_oneway_;
if (!is_oneway)
result_tc = CORBA::TypeCode::_duplicate (this->result_.tc_);
for (CORBA::ULong i = 0; i < this->num_args_; i++)
{
TAO::Unknown_IDL_Type *ut = 0;
ACE_NEW(ut, TAO::Unknown_IDL_Type(this->args_[i].tc_));
CORBA::Any_var value = new CORBA::Any;
value->replace(ut);
args->add_value("",value.in(), this->args_[i].mode_);
}
}
示例7: catch
void
TAO_CEC_Pull_Event::work (TAO_CEC_ProxyPullConsumer *consumer)
{
CORBA::Boolean has_event = 0;
CORBA::Any_var any;
try
{
any = consumer->try_pull_from_supplier (has_event);
}
catch (const CORBA::Exception&)
{
// Ignore all exceptions
return;
}
if (has_event)
{
this->consumer_admin_->push (any.in ());
}
}
示例8: 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;
}
示例9: 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 ();
//.........这里部分代码省略.........
示例10: analyze
void DynAnyAnalyzer::analyze (DynamicAny::DynAny_ptr da)
{
CORBA::TypeCode_var tc = da->type ();
CORBA::TCKind kind = tc->kind ();
CORBA::TypeCode_var dup = CORBA::TypeCode::_duplicate (tc.in ());
// strip aliases
while (kind == CORBA::tk_alias)
{
dup = dup->content_type ();
kind = dup->kind ();
}
switch (kind)
{
case CORBA::tk_struct:
{
DynamicAny::DynStruct_var ds
= DynamicAny::DynStruct::_narrow (da);
tab (level_);
if (debug_)
{
ACE_DEBUG ((LM_DEBUG,
"STRUCT\n"));
}
if (da->seek (0) )
{
level_++;
do
{
DynamicAny::DynAny_var cc =
ds->current_component ();
DynamicAny::FieldName_var fn =
ds->current_member_name ();
tab(level_);
if (debug_)
{
ACE_DEBUG ((LM_DEBUG,
"Member = %C\n", fn.in ()));
}
if (!CORBA::is_nil (cc.in ()))
{
this->analyze (cc.in ());
}
} while (da->next ());
level_--;
}
}
break; // end tk_struct
case CORBA::tk_sequence:
{
if (TAO_DynCommon::is_basic_type_seq (tc.in ()))
{
this->analyze_basic_seq (dup.in (), da);
}
else
{
DynamicAny::DynSequence_var ds =
DynamicAny::DynSequence::_narrow (da);
int i = 0;
tab(level_);
if (debug_)
{
ACE_DEBUG ((LM_DEBUG,
"SEQUENCE\n"));
}
if (ds->seek (0UL))
{
level_++;
do
{
tab(level_);
if (debug_)
ACE_DEBUG ((LM_DEBUG,
"[%d]\n", i));
DynamicAny::DynAny_var cc (ds->current_component ());
if (!CORBA::is_nil (cc.in ()))
{
analyze (cc.in ());
//.........这里部分代码省略.........