本文整理汇总了C++中Stub::doubleit方法的典型用法代码示例。如果您正苦于以下问题:C++ Stub::doubleit方法的具体用法?C++ Stub::doubleit怎么用?C++ Stub::doubleit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stub
的用法示例。
在下文中一共展示了Stub::doubleit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processEvent
void processEvent (int ev) {
Log l("client ");
// client
l.info("getting remote Echo...\n");
Stub<Echo> e;
e.remote = reg->getRemote("test.Echo");
l.info("using Echo(remote:%08x)...\n", e.remote.get());
{
string ret;
if (e.echo(ret, "hi")) {
l.error("echo failed.\n");
}
printf("%s\n", ret.c_str());
}
{
vector<string> args;
args.push_back("a");
args.push_back("b");
args.push_back("c");
string ret;
if (e.concat(ret, args)) {
l.error("concat failed.\n");
}
printf("%s\n", ret.c_str());
}
{
Ref<TestException> ex1;
printf("Invoking touchmenot()\n");
switch (e.touchmenot(ex1)) {
default:
l.error("Unexpected return\n");
break;
case 0:
printf("Silently returned.\n");
break;
case 1:
printf("Got exception :%d\n", *ex1->i);
break;
}
}
Ref<EchoCallback> cb = new EchoCallbackImpl();
if (e.recursiveEcho("rrrrrrrrrrrrrrrrrrrrrrrrrrr", cb)) {
l.error("recursiveEcho failed\n");
}
Person p;
p.name = "Sooin";
p.callback = cb;
if (e.hello(p)) {
l.error("hello failed.\n");
}
if (e.asyncEcho("hi again", cb)) {
l.error("asyncEcho failed.\n");
}
printf("starting doubleit test.\n");
{
int32_t ret;
if (e.doubleit(ret, 3) == 0) {
printf("doubleit(3) returns %d\n", ret);
} else {
l.error("doubleit failed.\n");
}
}
}