gem5
|
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 () |
Increment the reference count. More... | |
void | decref () |
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 52 of file refcnt.hh.
Referenced by ArmISA::ArmStaticInst::cSwap(), decref(), incref(), and ArmISA::MacroVFPMemOp::MacroVFPMemOp().