gem5 v24.0.0.0
|
Derive from RefCounted if you want to enable reference counting of this class. More...
#include <refcnt.hh>
Public Member Functions | |
RefCounted () | |
We initialize the reference count to zero and the first object to take ownership of it must increment it to one. | |
virtual | ~RefCounted () |
We make the destructor virtual because we're likely to have virtual functions on reference counted objects. | |
void | incref () const |
Increment the reference count. | |
void | decref () const |
Decrement the reference count and destroy the object if all references are gone. | |
Private Member Functions | |
RefCounted (const RefCounted &) | |
RefCounted & | operator= (const RefCounted &) |
Private Attributes | |
int | count |
Derive from RefCounted if you want to enable reference counting of this class.
If you want to use automatic reference counting, you should use RefCountingPtr<T> instead of regular pointers.
|
private |
|
inline |
|
inlinevirtual |
We make the destructor virtual because we're likely to have virtual functions on reference counted objects.
|
inline |
|
inline |
|
private |
|
mutableprivate |
Definition at line 67 of file refcnt.hh.
Referenced by gem5::ArmISA::ArmStaticInst::cSwap(), decref(), and incref().