C++ Example of Passing anys

C++ mapping maps the IDL type any to the C++ class CORBA::Any. A corresponding _var class, CORBA::Any_var, is also generated. The C++ mapping of the any is focussed on the definition of the following two operators: the insertion operator <<= (left-shift assignment) and the extraction operator >>= (right-shift assignment).

The motivation for using operators for insertion and extraction is to take advantage of the C++ overloading mechanism. With the help of operator overloading, the appropriate function is chosen automatically by the C++ compiler according to the type of data being inserted or extracted.

For a variety of reasons, however, overloading cannot automatically cope with the full range of CORBA data types. ...

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.