Go to the first, previous, next, last section, table of contents.


CNClass -- Class Description

SYNOPSIS

#include <CNCL/Class.h>

TYPE

CN_CLASS

BASE CLASSES

CNObject

DERIVED CLASSES

None

RELATED CLASSES

CNObject

DESCRIPTION

CNClass is used for the type description objects. For each class in the CNCL hierarchy there is a corresponding object of type CNClass. A pointer to this object is used for the CNCL runtime type information.

Constructors:

CNClass(char *name, char *version, CNObject *(*func)(CNParam *p));
The constructor of CNClass takes three arguments: the class' name, the class' version and a pointer to the static CLASS::new_object() member function of classes that provide this functionality. The function pointer may be NIL for classes that do not provide this, such as abstract base classes.

In addition to the member functions required by CNCL, CNClass provides:

const char *name() const;
const char *get_name() const;
Returns the class name.
const char *version() const;
const char *get_version() const;
Returns the class version.
CNObject *new_object(CNParam *param = NIL) const;
CNObject *new_object(Param &param) const;
Creates new objects via the corresponding class' static member function new_object(). The param object is used to pass optional arguments to the constructor.
static CNClass *cast_from_object(CNObject *obj);
Safes (CNClass *) type cast.


Go to the first, previous, next, last section, table of contents.