Xavax C++ Library Class Index   FAQ   Overview

Class xavax::TypeDescriptor

TypeDescriptor stores the metadata that describes a type. The metadata is used to implement type casting and introspection, and to assist in debugging.

Constructor Summary
TypeDescriptor(...)
         Construct a TypeDescriptor object.

Operator Summary
const MemberDescriptor& operator[](size_t n)
         Return the nth member descriptor.

Method Summary
size_t size() const
         Return the size of an instance of this type.
size_t count() const
         Return the number of member descriptors.
const char* name() const
         Return the basic type name.
Type type() const
         Return the basic type.

Related Classes
MemberDescriptor, Type, TypeQualifier.

Macros

TypeDescriptor

TypeDescriptor(name, type)
Defines a TypeDescriptor for a type using the standard naming convention. For example, for the class Shape, this macro assumes the existance of an array of member descriptors named ShapeMembers and creates a type descriptor named ShapeTypeDescriptor.
Parameters:
name - the type name.
type - the basic type (see Type).

Constructor Detail

TypeDescriptor

TypeDescriptor(const char* name, Type type, size_t size, size_t nmem, const MemberDescriptor* members)
Construct a TypeDescriptor object.
Parameters:
name - the type name.
type - the basic type (see Type).
size - the instance size.
nmem - the number of member descriptors.
members - the member descriptors.

Operator Detail

operator[]

const MemberDescriptor& operator[](size_t n)
Return the nth element of the array of member descriptors.
Parameters:
n - the index into the member descriptor array.

Method Detail

size

size_t size() const
Return the size of an instance of this type.
Returns:
the instance size.

count

size_t count() const
Return the number of elements in the array of member descriptors.
Returns:
the number of member descriptors.

name

const char*name() const
Return the type name.
Returns:
the basic type name.

type

Type type() const
Return the basic type (see Type).
Returns:
the basic type.

Example Code

Copyright © 2003 Xavax Inc. -- All Rights Reserved