15 #ifndef TYPEREGISTRY_H
16 #define TYPEREGISTRY_H
18 #include "dtoolbase.h"
19 #include "mutexImpl.h"
20 #include "memoryBase.h"
45 bool register_type(
TypeHandle &type_handle,
const string &name);
46 TypeHandle register_dynamic_type(
const string &name);
49 void record_alternate_name(
TypeHandle type,
const string &name);
52 TypeHandle find_type(
const 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(ostream &out)
const;
90 static void init_global_pointer();
94 INLINE
void freshen_derivations();
95 void rebuild_derivations();
97 void do_write(ostream &out)
const;
98 void write_node(ostream &out,
int indent_level,
101 static INLINE
void init_lock();
103 typedef vector<TypeRegistryNode *> HandleRegistry;
104 HandleRegistry _handle_registry;
106 typedef map<string, TypeRegistryNode *> NameRegistry;
107 NameRegistry _name_registry;
109 typedef vector<TypeRegistryNode *> RootClasses;
110 RootClasses _root_classes;
112 bool _derivations_fresh;
124 #include "typeHandle.h"
126 #include "typeRegistry.I"
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.
This class is intended to be the base class of all objects in Panda that might be allocated and delet...
int get_best_parent_from_Set(const std::set< int > &legal_vals) const
Return the Index of the BEst fit Classs from a set.
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.