CORBA::Any 类型的插入与提取操作详解
1. 插入任意类型到 CORBA::Any
在 C++ 中,将任意类型插入到 CORBA::Any 可以通过不同的方式实现。以下是示例代码:
// Inserting Anys
CORBA::Any anyToBeInserted;
anyToBeInserted <<= (CORBA::Long) 123;
theAny <<= anyToBeInserted; // Copying insertion
CORBA::Any_var anyToBeInsertedV = new CORBA::Any();
*anyToBeInsertedV <<= (CORBA::Long) 123;
theAny <<= *anyToBeInsertedV; // Copying insertion
CORBA::Any * anyToBeInsertedP = new CORBA::Any();
*anyToBeInsertedP <<= (CORBA::Long) 123;
theAny <<= anyToBeInsertedP; // Consuming insertion
theAny <<= anyToBeInsertedV._retn(); // Consuming insertion
这里有复制插入(Copying insertion)和消耗
超级会员免费看
订阅专栏 解锁全文
40

被折叠的 条评论
为什么被折叠?



