在 Any 中插入对象数组
我正在使用 corba,但有一个问题: 我必须将对象数组放入任何对象中。 当我使用简单类型(例如 double)时,我可以做到这一点。
DoubleSeqHelper.insert(Any, double[])
问题是我无法对 IDL 中定义的文件执行相同的操作。
假设我有一个类 A。我可以使用 AHelper
来放置 A 的一个实例在 Any 对象中。
AHelper.insert(Any, A)
但是如何将 A 数组放入 Any 对象中呢?
谢谢, 卢卡
I'm working with corba and I have a problem:
I have to put an array of object in an any object.
I can do it when i'm using simple types, for example double.
DoubleSeqHelper.insert(Any, double[])
The problem is that I'm not able to do the same with files that I have defined in my IDL..
Let's suppose that I have a class A. I can use AHelper
for putting one instance of A in an Any object.
AHelper.insert(Any, A)
But how can i put an array of A in an Any object?
Thanks,
Luca
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案1:
创建一个任意的序列/数组。
将一个 A 插入数组/序列的任意元素中。
然后将完整的 Any 序列/数组插入到单个 Any 中。
OR
解决方案2:
在接口中定义A 的数组。
然后就可以直接将A的Array插入到any中了。
Solution1:
Create a sequence/array of any's.
Insert one A into one any element of array/sequence.
Then insert complete Any sequence/array into a single Any.
OR
Solution2:
Define Array of A in interface.
Then you can directly insert Array of A into any.