14.20 TypeCode Member Functions

A TypeCode represents OMG IDL type information.

No constructors for TypeCodes are defined. However, in addition to the mapped interface, for each basic and defined OMG IDL type, an implementation provides access to a TypeCode pseudo-object reference (TypeCode_ptr) of the form _tc_<type> that may be used to set types in Any, as arguments for equal, and so on. In the names of these TypeCode reference constants, <type> refers to the local name of the type within its defining scope. Each C++ _tc_<type> constant is defined at the same scoping level as its matching type.

Like all other serverless objects, the C++ mapping for TypeCode provides a _nil() operation that returns a nil object reference for a TypeCode. This operation can be used to initialize TypeCode references embedded within constructed types. However, a nil TypeCode reference may never be passed as an argument to an operation, since TypeCodes are effectively passed as values, not as object references.

The mapping of these member functions to C++ is as follows:

class CORBA
{
class TypeCode
{
public:
class Bounds { ... };
class BadKind { ... };

Boolean equal(TypeCode_ptr) const;
TCKind kind() const;
Long param_count() const;
Any *parameter(Long) const;
RepositoryId id () const;
}; // TypeCode
}; // CORBA