A template class representing a reference counted pointer. More...
#include <refcount_ptr.h>
Public Member Functions | |
refcount_ptr (T *p=NULL) | |
~refcount_ptr () | |
refcount_ptr (const refcount_ptr &other) | |
refcount_ptr & | operator= (const refcount_ptr &other) |
operator T* () | |
T & | operator* () |
T * | operator-> () |
operator const T * () const | |
const T & | operator* () const |
const T * | operator-> () const |
bool | IsNULL () const |
Checks whether or not an object is referenced by the reference counted pointer. More... | |
bool | operator< (const refcount_ptr &other) const |
Less-than operator, e.g. for sorting. More... | |
bool | operator== (const refcount_ptr &other) const |
Equals operator. More... | |
bool | operator!= (const refcount_ptr &other) const |
Not-Equals operator. More... | |
A template class representing a reference counted pointer.
Basically, when a pointer assigned to the reference counted pointer, it increases the reference count of the pointed-to object. When the reference counted pointer is destroyed (or NULL is assigned to it), it decreases the reference count of the pointed-to object. If the reference count reaches zero, the object is deleted.
Definition at line 33 of file refcount_ptr.h.
|
inline |
Constructor for a reference counted pointer.
p | Pointer to an object; default is NULL. |
Definition at line 129 of file refcount_ptr.h.
|
inline |
The destructor causes the reference count to be decreased by one. If the reference count of the object reaches zero, it is deleted (freed).
Definition at line 141 of file refcount_ptr.h.
|
inline |
Copy constructor, which causes the reference count of the pointed-to object to be increased.
other | The reference counted pointer to copy from. |
Definition at line 152 of file refcount_ptr.h.
|
inline |
Checks whether or not an object is referenced by the reference counted pointer.
Definition at line 216 of file refcount_ptr.h.
Referenced by Component::CheckConsistency(), RootComponent::CheckVariableWrite(), Component::Clone(), SGI_IP32_Machine::Create(), HP700RXMachine::Create(), CycloneVHMachine::Create(), MVME187Machine::Create(), SGI_IP30_Machine::Create(), TestM88KMachine::Create(), TestMIPSMachine::Create(), GXemul::DumpMachineAsHTML(), DYNTRANS_INSTR(), ListComponentsCommand::Execute(), GXemul::GenerateHTMLListOfComponents(), ComponentFactory::GetAllComponentNames(), DummyComponent::GetAttribute(), CommandInterpreter::GetHistoryLine(), GXemul::IsTemplateMachine(), FileLoader::Load(), GXemul::ModifyStep(), CPUComponent::PreRunCheckForComponent(), ComponentFactory::RegisterComponentClass(), GXemul::SetRootComponent(), MainbusComponent::WriteData(), and CPUComponent::WriteData().
|
inline |
Definition at line 194 of file refcount_ptr.h.
|
inline |
Definition at line 179 of file refcount_ptr.h.
|
inline |
Not-Equals operator.
other | The reference counted pointer to compare this object to. |
Definition at line 256 of file refcount_ptr.h.
|
inline |
Definition at line 184 of file refcount_ptr.h.
|
inline |
Definition at line 199 of file refcount_ptr.h.
|
inline |
Definition at line 189 of file refcount_ptr.h.
|
inline |
Definition at line 204 of file refcount_ptr.h.
|
inline |
Less-than operator, e.g. for sorting.
other | The reference counted pointer to compare this object to. |
Definition at line 229 of file refcount_ptr.h.
|
inline |
Assignment operator. If an object is already referenced, it is released (i.e. its reference is decreased, and if it is zero, it is freed). The object referenced to by the other reference counted pointer then gets its reference count increased.
other | The reference counted pointer to assign from. |
Definition at line 168 of file refcount_ptr.h.
|
inline |
Equals operator.
other | The reference counted pointer to compare this object to. |
Definition at line 243 of file refcount_ptr.h.