17 INLINE
bool TypeHandle::
19 return (_index == other._index);
25 INLINE
bool TypeHandle::
27 return (_index != other._index);
33 INLINE
bool TypeHandle::
35 return (_index < other._index);
41 INLINE
bool TypeHandle::
43 return (_index <= other._index);
49 INLINE
bool TypeHandle::
51 return (_index > other._index);
57 INLINE
bool TypeHandle::
59 return (_index >= other._index);
69 return _index - other._index;
77 return (
size_t)_index;
89 if ((*
this) == TypeHandle::none()) {
181 INLINE
int TypeHandle::
189 INLINE
void TypeHandle::
190 output(std::ostream &out)
const {
198 operator bool ()
const {
199 return (_index != 0);
206 constexpr TypeHandle::
207 TypeHandle(
int index) : _index(index) {
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.
std::string get_name(TypeHandle type, TypedObject *object) const
Returns the name of the indicated type.
size_t get_hash() const
Returns a hash code suitable for phash_map.
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.
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
bool is_derived_from(TypeHandle parent, TypedObject *object=nullptr) const
Returns true if this type is derived from the indicated type, false otherwise.
get_name
Returns the name of the type.
TypeHandle get_parent_class(TypeHandle child, int index) const
Returns the nth parent class of this type.
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_parent_classes(TypeHandle child, TypedObject *child_object) const
Returns the number of parent classes that the indicated type is known to have.
TypeHandle get_child_class(TypeHandle child, int index) const
Returns the nth child class of this type.
int compare_to(const TypeHandle &other) const
Sorts TypeHandles arbitrarily (according to <, >, etc.).
get_num_child_classes
Returns the number of child classes that this type is known to have.
get_parent_class
Returns the nth parent class of this type.
static TypeRegistry * ptr()
Returns the pointer to the global TypeRegistry object.
TypeHandle get_parent_towards(TypeHandle ancestor, TypedObject *object=nullptr) const
Returns the parent class that is in a direct line of inheritance to the indicated ancestor class.
get_child_class
Returns the nth child class of this type.
get_num_parent_classes
Returns the number of parent classes that this type is known to have.
TypeHandle is the identifier used to differentiate C++ class types.