This is a list of pointers returned by a MemoryUsage object in response to some query. More...
#include "memoryUsagePointers.h"
Public Member Functions | |
void | clear () |
Empties the set of pointers. More... | |
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 and the time it was added to this set via a call to MemoryUsage::get_pointers(). More... | |
size_t | get_num_pointers () const |
ReferenceCount * | get_pointer (size_t n) const |
TypeHandle | get_type (size_t n) const |
Returns the actual type of the nth pointer, if it is known. More... | |
std::string | get_type_name (size_t n) const |
Returns the type name of the nth pointer, if it is known. More... | |
TypedObject * | get_typed_pointer (size_t n) const |
void | output (std::ostream &out) const |
Public Attributes | |
get_num_pointers | |
Returns the number of pointers in the set. More... | |
get_pointer | |
Returns the nth pointer of the set. More... | |
get_typed_pointer | |
Returns the nth pointer of the set, typecast to a TypedObject if possible. More... | |
Friends | |
class | MemoryUsage |
This is a list of pointers returned by a MemoryUsage object in response to some query.
Warning: once pointers are stored in a MemoryUsagePointers object, they are reference-counted, and will not be freed until the MemoryUsagePointers object is freed (or clear() is called on the object). However, they may not even be freed then; pointers may leak once they have been added to this structure. This is because we don't store enough information in this structure to correctly free the pointers that have been added. Since this is intended primarily as a debugging tool, this is not a major issue.
This class is just a user interface to talk about pointers stored in a MemoryUsage object. It doesn't even exist when compiled with NDEBUG.
Definition at line 38 of file memoryUsagePointers.h.
void MemoryUsagePointers::clear | ( | ) |
Empties the set of pointers.
Definition at line 143 of file memoryUsagePointers.cxx.
double MemoryUsagePointers::get_age | ( | size_t | n | ) | const |
Returns the age of the nth pointer: the number of seconds elapsed between the time it was allocated and the time it was added to this set via a call to MemoryUsage::get_pointers().
Definition at line 130 of file memoryUsagePointers.cxx.
TypeHandle MemoryUsagePointers::get_type | ( | size_t | n | ) | const |
Returns the actual type of the nth pointer, if it is known.
Definition at line 102 of file memoryUsagePointers.cxx.
std::string MemoryUsagePointers::get_type_name | ( | size_t | n | ) | const |
Returns the type name of the nth pointer, if it is known.
Definition at line 115 of file memoryUsagePointers.cxx.
size_t MemoryUsagePointers::get_num_pointers |
Returns the number of pointers in the set.
Definition at line 45 of file memoryUsagePointers.h.
ReferenceCount * MemoryUsagePointers::get_pointer |
Returns the nth pointer of the set.
Definition at line 45 of file memoryUsagePointers.h.
TypedObject * MemoryUsagePointers::get_typed_pointer |
Returns the nth pointer of the set, typecast to a TypedObject if possible.
If the pointer is not a TypedObject or if the cast cannot be made, returns nullptr.
Definition at line 47 of file memoryUsagePointers.h.