pfType(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages pfType(3pf)NAMEpfType - pfType data typing system
FUNCTION SPECIFICATION
#include <Performer/pr/pfType.h>
pfType::pfType(pfType *parent, char *name);
void* pfType::operator new(size_t s);
const char * pfType::getName();
pfType * pfType::getParent();
int pfType::isDerivedFrom(pfType *ancestor);
void pfType::setMaxTypes(int n);
DESCRIPTION
Objects derived from pfMemory have an associated pfType. An object's
pfType* is returned by calling pfMemory::getType.
pfType::getParent returns the parent class of the pfType. Note that
Performer only uses single inheritance and the type system only maintains
a single inheritance chain.
pfType::getName returns the name of the class.
pfType::isDerivedFrom tests whether the pfType has ancestor somewhere in
its inheritance ancestry. It returns TRUE if the ancestor was found, and
FALSE otherwise.
The type system must be initialized in shared memory before other
processes that will share the type system are created. When the type
system is initialized by pfInit, each Performer class creates a type for
itself. new pfType(pfType*,char*) allows an application to add
additional types to the type system. parent specifies the parent class,
or NULL if the class has no parents. name is the name of the class.
pfTypes must be explicitly new'ed, i.e. they cannot be created statically
or automatically on the stack.
pfType::setMaxTypes allows an application to increase the number of
allowed types. This must be called before pfInit to have effect.
pfMemory also has two convenience functions pfMemory::isOfType,
pfMemory::getTypeName that allow access to type information with a single
call.
Because OpenGL Performer allows subclassing of built-in types, when
decisions are made based on the type of an object, it is usually better
to use pfType::isDerivedFrom or pfMemory::isOfType to test the type of an
object rather than to test for the strict equality of the pfType*'s.
Page 1
pfType(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages pfType(3pf)NOTES
pfTypes cannot be deleted.
SEE ALSO
pfMemory
Page 2