本文整理汇总了C++中portableinterceptor::ClientRequestInfo_ptr::get_slot方法的典型用法代码示例。如果您正苦于以下问题:C++ ClientRequestInfo_ptr::get_slot方法的具体用法?C++ ClientRequestInfo_ptr::get_slot怎么用?C++ ClientRequestInfo_ptr::get_slot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableinterceptor::ClientRequestInfo_ptr
的用法示例。
在下文中一共展示了ClientRequestInfo_ptr::get_slot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
void
ClientInterceptor::send_request (
PortableInterceptor::ClientRequestInfo_ptr ri)
{
std::cout << "Calling send_request()." << std::endl;
IOP::ServiceContext sc;
sc.context_id = service_ctx_id;
const char user_name[] = "Ron Klein";
std::cout << "User's Name: " << user_name << std::endl;
CORBA::ULong string_len = sizeof (user_name) + 1;
CORBA::Octet *buf = 0;
buf = new CORBA::Octet [string_len];
ACE_OS::strcpy (reinterpret_cast<char*> (buf), user_name);
sc.context_data.replace (string_len, string_len, buf, 1);
// recursive call setup
CORBA::Any *recurse = ri->get_slot(slot);
CORBA::Long x;
*recurse >>= x;
CORBA::Any flag;
if (x == 0)
{
flag <<= 1;
pic->set_slot(slot, flag);
// get server time
std::cout << "Server Time = " << messenger->get_time() << std::endl;
}
// Add this context to the service context list.
ri->add_request_service_context (sc, 0);
// reset recursion test
flag <<= 0;
pic->set_slot(slot,flag);
}