Xavax C++ Library Class Index   FAQ   Overview

Class xavax::Class

Class stores the metadata or class record for classes derived from Object. The metadata is used to implement type casting and introspection, and to assist in debugging.

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

Operators Inherited From TypeDescriptor
operator[]

Method Summary
Object* create() const
         Create an object of this class.
bool isA(const Class*) const
         Determine if the specified class is an ancestor of this class, meaning objects of this class have an "is a" relationship with the specified class.
bool hasMembers() const
         Returns true if this class or any base class has metadata describing data members.
const Class* parent() const
         Return the class record for the parent class.

Methods Inherited From TypeDescriptor
size, count, name, type

Related Classes
Object, TypeDescriptor

Constructor Detail

Class

Class(const char* name, size_t size, size_t nmem, const MemberDescriptor* members, const Class* parent, CreateFunctor* cfp)
Construct a Class object.
Parameters:
name - the class name.
size - the instance size.
nmem - the number of member descriptors.
members - the member descriptors.
parent - the parent class record.
cfp - pointer to a create functor.

Method Detail

create

Object* create() const
Create an object of the class to which this class record is associated by calling the create functor (usually a static create method) provided by the class. If no create functor was specified, a NotImplementedException is thrown.
Returns:
a pointer to a new object.

isA

bool isA(const Class* cp)
Determine if the specified class is an ancestor of this class, meaning objects of this class have an "is a" relationship with the specified class.
Parameters:
cp - a class record.
Returns:
true if the specified class is an ancestor.

hasMembers

bool hasMembers() const
Returns true if this class or any base class has metadata describing data members.
Returns:
true if this class has data members.

parent

const Class* parent() const
Return the class record for the parent class.
Returns:
the parent class record.

Example Code

See Object for examples.

Copyright © 2003 Xavax Inc. -- All Rights Reserved