Public Types |
| enum | MemoryClass {
MCSingleton = 0,
MCArray = 1,
MCDeletedChainActive = 2,
MCDeletedChainInactive = 3,
MCLimit = 4
} |
Public Member Functions |
| | __init__ () |
| | The default constructor must do nothing, because we can't guarantee ordering of static initializers.
|
| | __init__ (TypeHandle const copy) |
| int | compareTo (TypeHandle const other) |
| | Sorts TypeHandles arbitrarily (according to <, >, etc.).
|
| | decMemoryUsage (MemoryClass memory_class, int size) |
| int | getBestParentFromSet (setint const legal_vals) |
| | Return the Index of the BEst fit Classs from a set.
|
| TypeHandle | getChildClass (int index) |
| | Returns the nth child class of this type.
|
| unsigned int | getHash () |
| | Returns a hash code suitable for phash_map.
|
| int | getIndex () |
| | Returns the integer index associated with this TypeHandle.
|
| int | getMemoryUsage (MemoryClass memory_class) |
| string | getName (TypedObject object) |
| | Returns the name of the type.
|
| string | getName () |
| | Returns the name of the type.
|
| int | getNumChildClasses (TypedObject object) |
| | Returns the number of child classes that this type is known to have.
|
| int | getNumChildClasses () |
| | Returns the number of child classes that this type is known to have.
|
| int | getNumParentClasses (TypedObject object) |
| | Returns the number of parent classes that this type is known to have.
|
| int | getNumParentClasses () |
| | Returns the number of parent classes that this type is known to have.
|
| TypeHandle | getParentClass (int index) |
| | Returns the nth parent class of this type.
|
| TypeHandle | getParentTowards (TypeHandle ancestor, TypedObject object) |
| | Returns the parent class that is in a direct line of inheritance to the indicated ancestor class.
|
| TypeHandle | getParentTowards (TypeHandle ancestor) |
| | Returns the parent class that is in a direct line of inheritance to the indicated ancestor class.
|
| | incMemoryUsage (MemoryClass memory_class, int size) |
| bool | isDerivedFrom (TypeHandle parent, TypedObject object) |
| | Returns true if this type is derived from the indicated type, false otherwise.
|
| bool | isDerivedFrom (TypeHandle parent) |
| | Returns true if this type is derived from the indicated type, false otherwise.
|
| bool | operator!= (TypeHandle const other) |
| bool | operator< (TypeHandle const other) |
| bool | operator<= (TypeHandle const other) |
| bool | operator== (TypeHandle const other) |
| bool | operator> (TypeHandle const other) |
| bool | operator>= (TypeHandle const other) |
| | output (ostream out) |
Static Public Member Functions |
| static PyObject | make (PyObject classobj) |
| static TypeHandle | none () |
| | Returns a special zero-valued TypeHandle that is used to indicate no type.
|
TypeHandle is the identifier used to differentiate C++ class types.
Any C++ classes that inherit from some base class, and must be differentiated at run time, should store a static TypeHandle object that can be queried through a static member function named get_class_type(). Most of the time, it is also desirable to inherit from TypedObject, which provides some virtual functions to return the TypeHandle for a particular instance.
At its essence, a TypeHandle is simply a unique identifier that is assigned by the TypeRegistry. The TypeRegistry stores a tree of TypeHandles, so that ancestry of a particular type may be queried, and the type name may be retrieved for run-time display.
Returns the number of parent classes that this type is known to have.
This may then be used to index into get_parent_class(). The result will be 0 if this class does not inherit from any other classes, 1 if normal, single inheritance is in effect, or greater than one if multiple inheritance is in effect.
The "object" pointer is an optional pointer to the TypedObject class that owns this TypeHandle. It is only used in case the TypeHandle is inadvertantly undefined.
Returns the number of parent classes that this type is known to have.
This may then be used to index into get_parent_class(). The result will be 0 if this class does not inherit from any other classes, 1 if normal, single inheritance is in effect, or greater than one if multiple inheritance is in effect.
The "object" pointer is an optional pointer to the TypedObject class that owns this TypeHandle. It is only used in case the TypeHandle is inadvertantly undefined.
Returns the parent class that is in a direct line of inheritance to the indicated ancestor class.
This is useful in the presence of multiple inheritance to try to determine what properties an unknown type may have.
The return value is TypeHandle::none() if the type does not inherit from the ancestor. If ancestor is the same as this type, the return value is this type.
The "object" pointer is an optional pointer to the TypedObject class that owns this TypeHandle. It is only used in case the TypeHandle is inadvertantly undefined.
Returns the parent class that is in a direct line of inheritance to the indicated ancestor class.
This is useful in the presence of multiple inheritance to try to determine what properties an unknown type may have.
The return value is TypeHandle::none() if the type does not inherit from the ancestor. If ancestor is the same as this type, the return value is this type.
The "object" pointer is an optional pointer to the TypedObject class that owns this TypeHandle. It is only used in case the TypeHandle is inadvertantly undefined.