Stores meta-information about Object instances.
More...
#include <mitsuba/mitsuba.h>
Stores meta-information about Object instances.
This class provides a thin layer of RTTI (run-time type information), which is useful for doing things like:
-
Checking if an object derives from a certain class
-
Determining the parent of a class at runtime
-
Instantiating a class by name
-
Unserializing a class from a binary data stream
- See Also
- ref, Object
Class::Class |
( |
const std::string & |
name, |
|
|
bool |
abstract, |
|
|
const std::string & |
superClassName, |
|
|
void * |
instPtr = NULL , |
|
|
void * |
unSerPtr = NULL |
|
) |
| |
Construct a new class descriptor.
This method should never be called manually. Instead, use one of the MTS_IMPLEMENT_CLASS, MTS_IMPLEMENT_CLASS_S, MTS_IMPLEMENT_CLASS_I or MTS_IMPLEMENT_CLASS_IS macros to automatically do this for you.
- Parameters
-
name | Name of the class |
abstract | true if the class contains pure virtual methods |
superClassName | Name of the parent class |
instPtr | Pointer to an instantiation function |
unSerPtr | Pointer to an unserialization function |
bool Class::derivesFrom |
( |
const Class * |
theClass | ) |
const |
Check whether this class derives from theClass.
static const Class* Class::forName |
( |
const std::string & |
name | ) |
|
|
static |
Look up a class by its name.
static const Class* Class::forName |
( |
const char * |
name | ) |
|
|
static |
Look up a class by its name. Avoids allocating heap space by taking a character array as parameter.
const std::string& Class::getName |
( |
| ) |
const |
|
inline |
Return the name of the represented class.
const Class* Class::getSuperClass |
( |
| ) |
const |
|
inline |
Return the Class object associated with the parent class of NULL if it does not have one.
Object* Class::instantiate |
( |
| ) |
const |
Generate an instance of this class (if this is supported)
bool Class::isAbstract |
( |
| ) |
const |
|
inline |
Return whether or not the class represented by this Class object contains pure virtual methods.
bool Class::isInstantiable |
( |
| ) |
const |
|
inline |
Does the class support instantiation over RTTI?
bool Class::isSerializable |
( |
| ) |
const |
|
inline |
Does the class support serialization?
static bool Class::rttiIsInitialized |
( |
| ) |
|
|
inlinestatic |
Check if the RTTI layer has been initialized.
static void Class::staticInitialization |
( |
| ) |
|
|
static |
Initializes the built-in RTTI and creates a list of all compiled classes.
static void Class::staticShutdown |
( |
| ) |
|
|
static |
Object* Class::unserialize |
( |
Stream * |
stream = NULL , |
|
|
InstanceManager * |
manager = NULL |
|
) |
| const |
Unserialize an instance of the class (if this is supported).
The documentation for this class was generated from the following file: