#include <tbox/ReferenceCounter.h>
Class ReferenceCounter manages the shared reference counter and arena resources used by Pointer and Array.
{Do not subclass!} Changing the size of a ReferenceCounter object will cause my simple memory allocation mechanism to break in horrible and disgusting ways.
- See also
- tbox::Array
-
tbox::Pointer
◆ ReferenceCounter() [1/3]
| SAMRAI::tbox::ReferenceCounter::ReferenceCounter |
( |
| ) |
|
Create a ReferenceCounter with an unmanaged memory arena. The number of references is set to one.
◆ ReferenceCounter() [2/3]
Create a ReferenceCounter with a managed memory arena. Argument newArena is the managed memory arena and arenaCounter is the reference counter for that arena. The number of references is set to one.
◆ ~ReferenceCounter()
| SAMRAI::tbox::ReferenceCounter::~ReferenceCounter |
( |
| ) |
|
Destructor for ReferenceCounter. The destructor releases the managed memory arena if its count has gone to zero.
◆ ReferenceCounter() [3/3]
◆ getArena()
| Arena* SAMRAI::tbox::ReferenceCounter::getArena |
( |
| ) |
|
Get the managed memory arena (or NULL if none exists).
◆ deleteReference()
| bool SAMRAI::tbox::ReferenceCounter::deleteReference |
( |
| ) |
|
Decrement the number of references. True is returned if the reference count has gone to zero; false otherwise.
◆ addReference()
| void SAMRAI::tbox::ReferenceCounter::addReference |
( |
| ) |
|
Increment the number of references.
◆ operator=()
◆ d_references
| int SAMRAI::tbox::ReferenceCounter::d_references |
|
private |
◆ d_arena
| Arena* SAMRAI::tbox::ReferenceCounter::d_arena |
|
private |
◆ d_counter
The documentation for this class was generated from the following file: