【发布时间】:2015-10-22 16:07:57
【问题描述】:
I was reading about CORBA 我注意到了一些有趣的事情。 CORBA 接口方法用返回类型定义,例如string in
module HelloApp
{
interface Hello
{
string sayHello();
oneway void shutdown();
};
};
并且还有一个关键字out,当作为参数传递时,意味着返回值。 For example here
struct Data { ... };
typedef sequence<Data> DataSeq;
interface DataIterator {
DataSeq next_n_items(in unsigned long how_many);
void destroy();
};
interface SearchEngine {
DataSeq query(
in string search_condition,
in unsigned long how_many,
out DataSeq results,
out DataIterator iter);
};
似乎是多余的。 为什么两者都需要?
【问题讨论】: