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