在 Any 中插入对象数组

发布于 2024-11-29 00:47:45 字数 335 浏览 1 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雪若未夕 2024-12-06 00:47:45

解决方案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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文