mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
dtoolbase: Remove unused get_best_parent_from_Set()
This method is no longer used as of e6f870ece6f973fd57ecf57c62ec96a4a898cc6c Fixes #1421
This commit is contained in:
parent
b10b49bd6b
commit
2d606c07e3
@ -166,25 +166,6 @@ get_python_type() const {
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Return the Index of the BEst fit Classs from a set
|
||||
*/
|
||||
int TypeHandle::
|
||||
get_best_parent_from_Set(const std::set< int > &legal_vals) const {
|
||||
if (legal_vals.find(_index) != legal_vals.end()) {
|
||||
return _index;
|
||||
}
|
||||
|
||||
for (int pi = 0; pi < get_num_parent_classes(); ++pi) {
|
||||
TypeHandle ph = get_parent_class(pi);
|
||||
int val = ph.get_best_parent_from_Set(legal_vals);
|
||||
if (val > 0) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::ostream &
|
||||
operator << (std::ostream &out, TypeHandle::MemoryClass mem_class) {
|
||||
switch (mem_class) {
|
||||
|
@ -123,8 +123,6 @@ PUBLISHED:
|
||||
INLINE TypeHandle get_parent_towards(TypeHandle ancestor,
|
||||
TypedObject *object = nullptr) const;
|
||||
|
||||
int get_best_parent_from_Set(const std::set< int > &legal_vals) const;
|
||||
|
||||
size_t get_memory_usage(MemoryClass memory_class) const;
|
||||
void inc_memory_usage(MemoryClass memory_class, size_t size);
|
||||
void dec_memory_usage(MemoryClass memory_class, size_t size);
|
||||
|
@ -695,21 +695,3 @@ look_up_invalid(TypeHandle handle, TypedObject *object) const {
|
||||
|
||||
return _handle_registry[handle._index];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
extern "C" int
|
||||
get_best_parent_from_Set(int id, const std::set<int> &this_set) {
|
||||
// most common case..
|
||||
if (this_set.find(id) != this_set.end()) {
|
||||
return id;
|
||||
}
|
||||
|
||||
TypeHandle th = TypeRegistry::ptr()->find_type_by_id(id);
|
||||
if (th == TypeHandle::none()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return th.get_best_parent_from_Set(this_set);
|
||||
}
|
||||
|
@ -118,9 +118,6 @@ private:
|
||||
friend class TypeHandle;
|
||||
};
|
||||
|
||||
// Helper function to allow for "C" interaction into the type system
|
||||
extern "C" EXPCL_DTOOL_DTOOLBASE int get_best_parent_from_Set(int id, const std::set<int> &this_set);
|
||||
|
||||
#include "typeHandle.h"
|
||||
|
||||
#include "typeRegistry.I"
|
||||
|
@ -43,14 +43,6 @@ is_exact_type(TypeHandle handle) const {
|
||||
return get_type() == handle;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
INLINE int TypedObject::
|
||||
get_best_parent_from_Set(const std::set<int> &inset) const {
|
||||
return get_type().get_best_parent_from_Set(inset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the object, upcast (if necessary) to a TypedObject pointer.
|
||||
*/
|
||||
|
@ -106,8 +106,6 @@ PUBLISHED:
|
||||
INLINE bool is_exact_type(TypeHandle handle) const;
|
||||
|
||||
public:
|
||||
INLINE int get_best_parent_from_Set(const std::set<int> &) const;
|
||||
|
||||
// Derived classes should override this function to call init_type(). It
|
||||
// will only be called in error situations when the type was for some reason
|
||||
// not properly initialized.
|
||||
|
Loading…
x
Reference in New Issue
Block a user