14#ifndef TYPEREGISTRYNODE_H
15#define TYPEREGISTRYNODE_H
30class EXPCL_DTOOL_DTOOLBASE TypeRegistryNode {
35 const TypeRegistryNode *base);
38 const TypeRegistryNode *base);
48 typedef std::vector<TypeRegistryNode *> Classes;
49 Classes _parent_classes;
50 Classes _child_classes;
51 PyObject *_python_type =
nullptr;
53 AtomicAdjust::Integer _memory_usage[TypeHandle::MC_limit];
55 static bool _paranoid_inheritance;
58 typedef int SubtreeMaskType;
66 INLINE Inherit(TypeRegistryNode *top,
int bit_count,
67 SubtreeMaskType bits);
68 INLINE Inherit(
const Inherit ©);
69 INLINE
void operator = (
const Inherit ©);
71 INLINE
bool operator < (
const Inherit &other)
const;
72 INLINE
static bool is_derived_from(
const Inherit &child,
const Inherit &base);
74 TypeRegistryNode *_top;
75 SubtreeMaskType _mask;
76 SubtreeMaskType _bits;
78 typedef std::vector<Inherit> TopInheritance;
80 void r_build_subtrees(TypeRegistryNode *top,
81 int bit_count, SubtreeMaskType bits);
83 PyObject *r_get_python_type()
const;
85 static bool check_derived_from(
const TypeRegistryNode *child,
86 const TypeRegistryNode *base);
93 TopInheritance _top_inheritance;
TypeHandle is the identifier used to differentiate C++ class types.
static bool is_derived_from(const TypeRegistryNode *child, const TypeRegistryNode *base)
Returns true if the child RegistryNode represents a class that inherits directly or indirectly from t...
PyObject * get_python_type() const
Returns the Python type object associated with this node.
void clear_subtree()
Removes any subtree definition previously set up via define_subtree(), in preparation for rebuilding ...
static TypeHandle get_parent_towards(const TypeRegistryNode *child, const TypeRegistryNode *base)
Returns the first parent class of child that is a descendant of the indicated base class.
void define_subtree()
Indicates that this TypeRegistryNode is the top of a subtree within the inheritance graph (typically,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.