23 MemoryUsagePointers() {
30 ~MemoryUsagePointers() {
36 size_t MemoryUsagePointers::
37 get_num_pointers()
const {
38 #ifdef DO_MEMORY_USAGE 39 return _entries.size();
50 #ifdef DO_MEMORY_USAGE 52 return _entries[n]._ref_ptr;
65 #ifdef DO_MEMORY_USAGE 69 if (typed_ptr !=
nullptr) {
90 if (type != TypeHandle::none() &&
103 #ifdef DO_MEMORY_USAGE 105 return _entries[n]._type;
107 return TypeHandle::none();
116 #ifdef DO_MEMORY_USAGE 131 #ifdef DO_MEMORY_USAGE 133 return _entries[n]._age;
144 #ifdef DO_MEMORY_USAGE 152 void MemoryUsagePointers::
153 output(std::ostream &out)
const {
154 #ifdef DO_MEMORY_USAGE 155 out << _entries.size() <<
" pointers.";
162 void MemoryUsagePointers::
165 #ifdef DO_MEMORY_USAGE 170 _entries.push_back(Entry(ref_ptr, typed_ptr, type, age));
get_ref_count
Returns the current reference count.
get_num_pointers
Returns the number of pointers in the set.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::string get_type_name(size_t n) const
Returns the type name of the nth pointer, if it is known.
void clear()
Empties the set of pointers.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
TypeHandle get_type(size_t n) const
Returns the actual type of the nth pointer, if it is known.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for all things that want to be reference-counted.
get_pointer
Returns the nth pointer of the set.
get_typed_pointer
Returns the nth pointer of the set, typecast to a TypedObject if possible.
TypeHandle is the identifier used to differentiate C++ class types.
double get_age(size_t n) const
Returns the age of the nth pointer: the number of seconds elapsed between the time it was allocated a...