#include <Ptr.hh>
Inheritance diagram for rovsoft::lib::Ptr:
Public Member Functions | |
Ptr (PtrTarget *ptr=0) | |
Creates a new Ptr object initilized with ptr. | |
Ptr (const Ptr &orig) | |
Just copy this object, it's a cheap copy, the size of this object is only 4 byte. | |
Ptr & | operator= (const Ptr &orig) |
Copy a Ptr object. | |
Ptr & | operator= (PtrTarget *ptr) |
Set this pointer to a new target. | |
PtrTarget & | operator * () |
Gets the target. | |
const PtrTarget & | operator * () const |
Gets the target- const version. | |
PtrTarget * | operator-> () |
Gets the object to which this pointer points to. | |
const PtrTarget * | operator-> () const |
A Ptr object associates its self so much with the object it points to, that if you declare the Ptr object to be constant, you only get a const version of the target. | |
bool | isNull () const |
Test if this is a null pointer. | |
bool | operator== (const Ptr &op) const |
Compare two pointers with each other. | |
bool | operator!= (const Ptr &op) const |
~Ptr () | |
Destructor, deletes the target if this pointer was the last. | |
Protected Member Functions | |
void | removeTarget () |
This method is used for decrementing the reference counter of the target and is responsible for deleting the target if the reference counter reaches 0. | |
Protected Attributes | |
PtrTarget * | target |
If such a pointer is copied it increments its targets counter, if a ptr object gets destroyed it decrements its targets counter, if the counter reaches 0 the target gets destroyed. This class and all of its subclasses only work with classes derieved from PtrTarget.
|
Creates a new Ptr object initilized with ptr.
|
|
Just copy this object, it's a cheap copy, the size of this object is only 4 byte.
|
|
Destructor, deletes the target if this pointer was the last.
Here is the call graph for this function: ![]() |
|
Test if this is a null pointer.
|
|
|
|
|
|
|
|
Set this pointer to a new target.
Here is the call graph for this function: ![]() |
|
Copy a Ptr object.
Here is the call graph for this function: ![]() |
|
Compare two pointers with each other. (Is their target the same?) |
|
This method is used for decrementing the reference counter of the target and is responsible for deleting the target if the reference counter reaches 0. It does this by calling the function refered by the targets deleteFunction pointer. For further information please see the PtrTarget class. |
|
|