43 INLINE
bool TypeHandle::
45 return (_index == other._index);
53 INLINE
bool TypeHandle::
55 return (_index != other._index);
63 INLINE
bool TypeHandle::
65 return (_index < other._index);
73 INLINE
bool TypeHandle::
75 return (_index <= other._index);
83 INLINE
bool TypeHandle::
85 return (_index > other._index);
93 INLINE
bool TypeHandle::
95 return (_index >= other._index);
108 return _index - other._index;
118 return (
size_t)_index;
262 INLINE
void TypeHandle::
263 output(ostream &out)
const {
285 operator bool ()
const {
286 return (_index != 0);
296 if(legal_vals.find(_index) != legal_vals.end())
TypeHandle get_child_class(int index) const
Returns the nth child class of this type.
bool is_derived_from(TypeHandle parent, TypedObject *object=(TypedObject *) NULL) const
Returns true if this type is derived from the indicated type, false otherwise.
bool is_derived_from(TypeHandle child, TypeHandle base, TypedObject *child_object)
Returns true if the first type is derived from the second type, false otherwise.
static TypeHandle none()
Returns a special zero-valued TypeHandle that is used to indicate no type.
TypeHandle get_parent_class(int index) const
Returns the nth parent class of this type.
size_t get_hash() const
Returns a hash code suitable for phash_map.
int get_index() const
Returns the integer index associated with this TypeHandle.
TypeHandle()
The default constructor must do nothing, because we can't guarantee ordering of static initializers...
string get_name(TypedObject *object=(TypedObject *) NULL) const
Returns the name of the type.
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
TypeHandle get_child_class(TypeHandle child, int index) const
Returns the nth child class of this type.
int get_num_child_classes(TypeHandle child, TypedObject *child_object) const
Returns the number of child classes that the indicated type is known to have.
TypeHandle get_parent_towards(TypeHandle child, TypeHandle base, TypedObject *child_object)
Returns the parent of the indicated child class that is in a direct line of inheritance to the indica...
int get_num_child_classes(TypedObject *object=(TypedObject *) NULL) const
Returns the number of child classes that this type is known to have.
string get_name(TypeHandle type, TypedObject *object) const
Returns the name of the indicated type.
static TypeRegistry * ptr()
Returns the pointer to the global TypeRegistry object.
int get_best_parent_from_Set(const std::set< int > &legal_vals) const
Return the Index of the BEst fit Classs from a set.
TypeHandle get_parent_towards(TypeHandle ancestor, TypedObject *object=(TypedObject *) NULL) const
Returns the parent class that is in a direct line of inheritance to the indicated ancestor class...
int compare_to(const TypeHandle &other) const
Sorts TypeHandles arbitrarily (according to <, >, etc.).
TypeHandle is the identifier used to differentiate C++ class types.
int get_num_parent_classes(TypedObject *object=(TypedObject *) NULL) const
Returns the number of parent classes that this type is known to have.
int get_num_parent_classes(TypeHandle child, TypedObject *child_object) const
Returns the number of parent classes that the indicated type is known to have.
TypeHandle get_parent_class(TypeHandle child, int index) const
Returns the nth parent class of this type.