FreeCAD C++
|
#include <Base/Type.h>
Type system class Many of the classes in the FreeCAD must have their type information registered before any instances are created (including, but not limited to: App::Feature, App::Property, Gui::ViewProvider ). The use of Type to store this information provides lots of various functionality for working with class hierarchies, comparing class types, instantiating objects from classnames, etc etc.
It is for instance possible to do things like this:
A notable feature of the Type class is that it is only 16 bits long and therefore should be passed around by value for efficiency reasons.
One important note about the use of Type to register class information: super classes must be registered before any of their derived classes are.
Public Member Functions | |
Type (const Type &type) | |
Construction. | |
virtual | ~Type () |
Destruction. | |
void * | createInstance (void) |
creates a instance of this type | |
Static Public Member Functions | |
static void * | createInstanceByName (const char *TypeName, bool bLoadModule=false) |
creates a instance of the named type | |