#include <CNCL/Class.h>
CN_CLASS
CNObject
None
CNObject
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));
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;
const char *version() const;
const char *get_version() const;
CNObject *new_object(CNParam *param = NIL) const;
CNObject *new_object(Param ¶m) const;
new_object()
. The param
object is used to pass
optional arguments to the constructor.
static CNClass *cast_from_object(CNObject *obj);
(CNClass *)
type cast.
Go to the first, previous, next, last section, table of contents.