DynAny Examples

Two examples are presented in this section that illustrate many of the features of the DynAny interfaces.

  • Creating and initializing a DynStruct instance

  • Creating and initializing a DynUnion instance

Creating a DynStruct

Consider how to create a DynAny object that represents the struct VarLen, declared in Listing 17.2.

The code in Listing 17.13 and Listing 17.14 shows how to create and initialize a DynStruct object that represents a VarLen instance.

Listing 17.13. C++ Creating a DynStruct for a VarLen
//C++ #include <ifr.hh> #include <DynamicAny.hh> ... //------------------------------------------------------- // Assume that the following variable is already defined: // 'orbV' - a _var reference to an ORB instance // 'TCVarLenV' ...

Get Pure CORBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.