gem5
v20.1.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. More... | |
virtual | ~RefCounted () |
We make the destructor virtual because we're likely to have virtual functions on reference counted objects. More... | |
void | incref () const |
Increment the reference count. More... | |
void | decref () const |
Decrement the reference count and destroy the object if all references are gone. More... | |
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 64 of file refcnt.hh.
Referenced by ArmISA::ArmStaticInst::cSwap(), decref(), incref(), and ArmISA::MacroVFPMemOp::MacroVFPMemOp().