Panda3D
Public Member Functions | List of all members
MemoryUsagePointers Class Reference

This is a list of pointers returned by a MemoryUsage object in response to some query. More...

Public Member Functions

 __init__ ()
 
 __init__ (const MemoryUsagePointers)
 
 clear ()
 Empties the set of pointers. More...
 
double getAge (int n)
 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...
 
int getNumPointers ()
 Returns the number of pointers in the set. More...
 
ReferenceCount getPointer (int n)
 Returns the nth pointer of the set. More...
 
list getPointers ()
 
object getPythonPointer (int n)
 
TypeHandle getType (int n)
 Returns the actual type of the nth pointer, if it is known. More...
 
TypedObject getTypedPointer (int n)
 Returns the nth pointer of the set, typecast to a TypedObject if possible. More...
 
list getTypedPointers ()
 
str getTypeName (int n)
 Returns the type name of the nth pointer, if it is known. More...
 
 output (Ostream out)
 

Detailed Description

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.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

◆ __init__() [2/2]

__init__ ( const  MemoryUsagePointers)

◆ clear()

clear ( )

Empties the set of pointers.

◆ getAge()

double getAge ( int  n)

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().

◆ getNumPointers()

int getNumPointers ( )

Returns the number of pointers in the set.

◆ getPointer()

ReferenceCount getPointer ( int  n)

Returns the nth pointer of the set.

◆ getPointers()

list getPointers ( )

◆ getPythonPointer()

object getPythonPointer ( int  n)

◆ getType()

TypeHandle getType ( int  n)

Returns the actual type of the nth pointer, if it is known.

◆ getTypedPointer()

TypedObject getTypedPointer ( int  n)

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.

◆ getTypedPointers()

list getTypedPointers ( )

◆ getTypeName()

str getTypeName ( int  n)

Returns the type name of the nth pointer, if it is known.

◆ output()

output ( Ostream  out)