pfType(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages pfType(3pf)NAME
pfNewType, pfGetTypeName, pfGetTypeParent, pfIsDerivedFrom, pfMaxTypes -
pfType data typing system
FUNCTION SPECIFICATION
#include <Performer/pf.h>
pfType * pfNewType(pfType *parent, char *name);
const char * pfGetTypeName(void* type);
pfType * pfGetTypeParent(pfType* type);
int pfIsDerivedFrom(pfType* type, pfType *ancestor);
void pfMaxTypes(int n);
DESCRIPTION
Objects derived from pfMemory have an associated pfType. An object's
pfType* is returned by calling pfGetType.
pfGetTypeParent returns the parent class of the pfType. Note that
Performer only uses single inheritance and the type system only maintains
a single inheritance chain.
pfGetTypeName returns the name of the class.
pfIsDerivedFrom 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. pfNewType 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.
pfMaxTypes 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 pfIsOfType, pfGetTypeName
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 pfIsDerivedFrom or pfIsOfType 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