本文整理汇总了C++中corba::ORB_ptr::perform_work方法的典型用法代码示例。如果您正苦于以下问题:C++ ORB_ptr::perform_work方法的具体用法?C++ ORB_ptr::perform_work怎么用?C++ ORB_ptr::perform_work使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::ORB_ptr
的用法示例。
在下文中一共展示了ORB_ptr::perform_work方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
static void
test_ami (CORBA::ORB_ptr orb,
Test::Echo_ptr echo)
{
Test::AMI_EchoHandler_var echo_handler;
Echo_Handler * echo_handler_impl = new Echo_Handler;
PortableServer::ServantBase_var safe_echo_handler = echo_handler_impl;
echo_handler =
echo_handler_impl->_this ();
unsigned long initial_reply_count =
Echo_Client_Request_Interceptor::reply_count;
unsigned long initial_request_count =
Echo_Client_Request_Interceptor::request_count;
unsigned long initial_other_count =
Echo_Client_Request_Interceptor::other_count;
for (unsigned long i = 0; i != ITERATIONS; ++i)
{
echo->sendc_echo_operation (
echo_handler.in (),
"dummy message");
}
unsigned long total_reply_count =
Echo_Client_Request_Interceptor::reply_count - initial_reply_count;
unsigned long total_request_count =
Echo_Client_Request_Interceptor::request_count -
(total_reply_count + initial_request_count);
unsigned long total_other_count =
Echo_Client_Request_Interceptor::other_count - initial_other_count;
if (total_request_count != ITERATIONS
|| total_other_count != ITERATIONS)
{
ACE_ERROR((LM_ERROR,
"ERROR: In test_ami () unexpected request/other "
"count (request = %d, other = %d)\n",
total_request_count, total_other_count));
exit_status = 1;
}
while (echo_handler_impl->replies () != ITERATIONS)
{
CORBA::Boolean pending =
orb->work_pending ();
if (pending)
{
orb->perform_work ();
}
}
total_request_count =
Echo_Client_Request_Interceptor::request_count - initial_request_count;
total_reply_count =
Echo_Client_Request_Interceptor::reply_count - initial_reply_count;
// total_request_count is 2*ITERATIONS since it's incremented twice for
// each call. Once for Echo and once for Echo_Handler.
if (total_request_count != 2 * ITERATIONS
|| total_reply_count != ITERATIONS)
{
ACE_ERROR((LM_ERROR,
"ERROR: In test_ami () unexpected request/reply "
"count (request = %d, reply = %d)\n",
total_request_count, total_reply_count));
exit_status = 1;
}
}