Go to the documentation of this file.
23 MemoryUsagePointers() {
30 ~MemoryUsagePointers() {
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_name
Returns the name of the type.
bool is_derived_from(TypeHandle parent, TypedObject *object=nullptr) const
Returns true if this type is derived from the indicated type, false otherwise.
A base class for all things that want to be reference-counted.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
std::string get_type_name(size_t n) const
Returns the type name of the nth pointer, if it is known.
TypeHandle is the identifier used to differentiate C++ class types.
TypeHandle get_type(size_t n) const
Returns the actual type of the nth pointer, if it is known.
get_typed_pointer
Returns the nth pointer of the set, typecast to a TypedObject if possible.
void clear()
Empties the set of pointers.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_num_pointers
Returns the number of pointers in the set.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_ref_count
Returns the current reference count.
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
get_pointer
Returns the nth pointer of the set.