本文整理汇总了C++中portableinterceptor::ClientRequestInfo_ptr::get_reply_service_context方法的典型用法代码示例。如果您正苦于以下问题:C++ ClientRequestInfo_ptr::get_reply_service_context方法的具体用法?C++ ClientRequestInfo_ptr::get_reply_service_context怎么用?C++ ClientRequestInfo_ptr::get_reply_service_context使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableinterceptor::ClientRequestInfo_ptr
的用法示例。
在下文中一共展示了ClientRequestInfo_ptr::get_reply_service_context方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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:
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);
}
示例3:
void
Echo_Client_Request_Interceptor::receive_exception (
PortableInterceptor::ClientRequestInfo_ptr ri)
{
if (CORBA::is_nil (this->orb_.in ()))
{
int argc = 0;
ACE_TCHAR **argv = 0;
this->orb_ = CORBA::ORB_init (argc, argv,
this->orb_id_.in ());
}
CORBA::String_var operation = ri->operation ();
CORBA::Object_var target = ri->target ();
CORBA::String_var ior =
this->orb_->object_to_string (target.in ());
#if 0
ACE_DEBUG ((LM_DEBUG,
"%C.received_exception "
"from \"%C\" on object: %C\n",
this->myname_,
operation.in (),
ior.in ()));
#endif /*if 0*/
// Check that the reply service context was received as
// expected.
IOP::ServiceContext_var sc =
ri->get_reply_service_context (::service_id);
const char *buf =
reinterpret_cast<const char *> (sc->context_data.get_buffer ());
#if 0
ACE_DEBUG ((LM_DEBUG,
" Received reply service context: %C\n",
buf));
#endif /*if 0*/
if (ACE_OS::strcmp (buf, reply_msg) != 0)
{
ACE_ERROR ((LM_ERROR,
"ERROR: Expected reply service context to be: %C\n",
reply_msg));
}
// Check that no one has messed with the request service context.
IOP::ServiceContext_var sc2 =
ri->get_request_service_context (::service_id);
const char *buf2 =
reinterpret_cast<const char *> (sc2->context_data.get_buffer ());
if (ACE_OS::strcmp (buf2, request_msg) != 0)
{
ACE_ERROR ((LM_ERROR,
"ERROR: Expected request service context to be: %C.\n"
" Got: %C\n",
request_msg,
buf2));
}
}