BlitzMax Extended  0.8.11
Pushing Blitz to the Max.
Data Structures | Defines | Functions
blitz_class.h File Reference

The class description used by every object. More...

#include "_common.h"
#include "blitz_debug.h"
#include "blitz_gc.h"

Go to the source code of this file.

Data Structures

struct  BBClass
 Contains critical information and functionality for object instances. More...

Defines

#define BBCLASS_MAX_INSTANCESIZE   BBSIZE_MAX
 The maximum size an instance of a class (object) can take up.
#define BBCLASS_ABSTRACT_METHOD   bbNullMethodError
 Declares a virtual function to be an abstract method.
#define BBCLASS_ABSTRACT_FUNCTION   bbNullFunctionError
 Declares a virtual function to be an abstract function.

Functions

void bb_class_register_multiple (unsigned int count,...)
 Register multiple classes at once with the runtime.
void bbClassRegister (const BBClass *clas)
 Registers a class with the runtime.
BBClass ** bbClassAllRegistered (BBInt *count)
 Lists all registered classes.

Detailed Description

The class description used by every object.

Classes contain general information and functionality to work with instances of the respective object. They do not store individual information for every object instance.

Apart from the obvious functionality via virtual functions and information necessary for allocation and such, each BBClass also contains a debug_scope property that holds descriptions used by BlitzMax.

Author:
Mark Sibly
Fabian Niemann

Define Documentation

Declares a virtual function to be an abstract function.

When assigned to a (named) virtual function, each call to that function will result in a new BBNullFunctionException to be thrown.

See also:
BBNullFunctionException

Declares a virtual function to be an abstract method.

When assigned to a (named) virtual function, each call to that function will result in a new BBNullMethodException to be thrown.

See also:
BBNullMethodException
#define BBCLASS_MAX_INSTANCESIZE   BBSIZE_MAX

The maximum size an instance of a class (object) can take up.

Note:
While theoretically this could be SIZE_MAX, it is not since BlitzMax operates on an int basis. This however should not be a problem, as it is very unlikely to ever have objects which are even nearly that large.

Referenced by bb_class_register_multiple(), and bbClassRegister().


Function Documentation

void bb_class_register_multiple ( unsigned int  count,
  ... 
)

Register multiple classes at once with the runtime.

Parameters:
countThe number of classes given in the variable argument list

Lists all registered classes.

Parameters:
countAn pointer to an integer in which the number of registered classes is stored.
Returns:
A pointer to the first element in the list of registered classes
void bbClassRegister ( const BBClass clas)

Registers a class with the runtime.

Internally the runtime keeps track of all registered classes to use them when necessary, for example reflection.

Note:
You can use classes implemented in C without calling this, if you include them in the ".i" files of the module. Then, of course, they are not visible when using reflection.
Warning:
This does not check if a class is already included, since this is usually done by the compiler. So be careful not to include something twice.
Parameters:
clasThe class to register