14 #ifndef TYPEREGISTRY_H 15 #define TYPEREGISTRY_H 47 void record_alternate_name(
TypeHandle type,
const std::string &name);
49 void record_python_type(
TypeHandle type, PyObject *python_type);
52 TypeHandle find_type(
const std::string &name)
const;
59 int get_num_typehandles();
61 MAKE_SEQ(get_typehandles, get_num_typehandles, get_typehandle);
63 int get_num_root_classes();
65 MAKE_SEQ(get_root_classes, get_num_root_classes, get_root_class);
78 static void reregister_types();
80 void write(std::ostream &out)
const;
85 MAKE_SEQ_PROPERTY(typehandles, get_num_typehandles, get_typehandle);
86 MAKE_SEQ_PROPERTY(root_classes, get_num_root_classes, get_root_class);
93 static void init_global_pointer();
97 INLINE
void freshen_derivations();
98 void rebuild_derivations();
100 void do_write(std::ostream &out)
const;
101 void write_node(std::ostream &out,
int indent_level,
104 static INLINE
void init_lock();
106 typedef std::vector<TypeRegistryNode *> HandleRegistry;
107 HandleRegistry _handle_registry;
109 typedef std::map<std::string, TypeRegistryNode *> NameRegistry;
110 NameRegistry _name_registry;
112 typedef std::vector<TypeRegistryNode *> RootClasses;
113 RootClasses _root_classes;
115 bool _derivations_fresh;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_best_parent_from_Set(const std::set< int > &legal_vals) const
Return the Index of the BEst fit Classs from a set.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
This is a single entry in the TypeRegistry.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is intended to be the base class of all objects in Panda that might be allocated and delet...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The TypeRegistry class maintains all the assigned TypeHandles in a given system.
A fake mutex implementation for single-threaded applications that don't need any synchronization cont...
TypeHandle is the identifier used to differentiate C++ class types.
TypeHandle register_dynamic_type(const std::string &name)
This is essentially similar to register_type(), except that it doesn't store a reference to any TypeH...