dboo::cls::constructor

explicit cls(const char* name);                                                               1)
explicit cls(cls_creator_base<T>* creator, const char* name);                                 2)
explicit cls(const char* name, void (*class_init)(cls<T>&));                                  3)
explicit cls(cls_creator_base<T>* creator, const char* name, void (*class_init)(cls<T>&));    4)
n/a

Constructs a class descriptor object. For Node.js, use the function dboo.class (Node.js).

1

Constructs a class object with name and using dboo_class_init for member registration. The class must have a default constructor and a dboo_class_init function.

2

Constructs a class object with name and a specified creator. The creator takes care of construction. The class must have a dboo_class_init function.

3

Constructs a class object with name and using the specified class_init function for member registration. The class must have a default constructor.

4

Constructs a class object with nameand a creator and using the specified class_init function for member registration.

Parameters

name

The name of the class as known to the DBOO.

creator

A creator object. It inherits cls_creator_base<T> with the class being described as teemplate argument and defines the following two operators for construction:

T * operator()() const; T * operator()(void* pos) const;

class_init

An member initialization function. It has the signature:

void class_init(cls<T>&); Where T is the class being described.

Return value

(none)

Example