13.3.3.1 out Classes

Structured types (struct, union, sequence), arrays, and interfaces have a corresponding generated _out class. The out class is provided for simplifying the memory management of pointers to variable-length and fixed-length types. For more information about out classes and the common member functions, see the section Using out Classes.

Some differences occur in the operators supported for the user-defined data types. The following table describes the various operators supported by each OMG IDL data type, in the generated C++ code. Because the assignment operators are supported for all of the data types described in the following table, they are not included in the comparison.

Table 13-5 Comparison of Operators Supported for User-defined Data Type Out Classes

OMG IDL Data Type operator -> operator[]
struct Yes No
union Yes No
sequence Yes Yes, non-const only
array No Yes

The signatures are as shown in the following table.

Table 13-6 Operator Signatures for _out Classes

OMG IDL Data Type Operator Member Functions
struct
TYPE * operator-> ()
TYPE * operator-> () const
union
TYPE * operator-> ()
TYPE * operator-> () const
sequence
TYPE * operator-> ()
TYPE * operator-> () const
TYPE & operator[](CORBA::Long index)
array
TYPE_slice & operator[](CORBA::Long index)
TYPE_slice & operator[](CORBA::Long index) const