[Ace-users] Re: [tao-users] how to unmarshall an any that is a a
sequence of structures
Johnny Willemsen
jwillemsen at remedy.nl
Sat Aug 11 13:04:51 CDT 2007
Hi,
Have a look at the DynamicAny support in TAO, see TAO/tao/DynamicAny and
TAO/tests/DynAny_Test
Regards,
Johnny Willemsen
Remedy IT
Postbus 101
2650 AC Berkel en Rodenrijs
The Netherlands
www.theaceorb.nl / www.remedy.nl
*** Integrated compile and test statistics see
http://scoreboard.theaceorb.nl ***
*** Commercial service and support for ACE/TAO/CIAO ***
*** See http://www.theaceorb.nl/en/support.html ***
"nospam" <nospam at spamnot.net> wrote in message
news:<46BD8F82.8 at spamnot.net>...
> Hello everyone,
>
> If a server receives an ANY and does not know a priori what original
> type it was (plain CORBA types, but ALSO sequences and structures!), how
> do I
> recreate the original data structure (plain CORBA types, user-defined
> sequences, and structures)?
>
> Hopefully obvious, but I am concerned with the sequences and structures
> and primarily sequences of structures.
>
>
> I assume being able to unmarshall sequence of structs from an ANY is
> doable. I would greatly appreciate a minimal example code. Or maybe
> there are rare or new CORBA-standard built-in functions that make this
> simple?
>
> Here is the IDL I am trying to use:
>
> struct NVPAIR
> {
> string name;
> any value; // this any could hold a POT,sequence,
> // struct, or sequence of struct
> };
> typedef sequence<NVPAIR> NVPAIR_LIST;
>
> struct COMMAND
> {
> string cmd;
> NVPAIR_LIST args;
> }
> typedef sequence<COMMAND> COMMAND_LIST;
>
> In this example, I am receiving a COMMAND_LIST, and need to reconstruct
> the sequence of COMMANDS.
>
> I am using Linux with GNU 4.1.2 compiler, C++, and the newest TAO release
>
> Thanks,
> Jeff
>
More information about the Ace-users
mailing list