#include <ctpointer.h>
Inheritance diagram for CTPointerBase:
Public Member Functions | |
virtual | ~CTPointerBase () |
void | setDescription (string descr) |
const string & | description () const |
void | setObjectDescription (string descr) |
string | objectDescription () const |
int | referenceCount () const |
bool | operator== (const CTPointerBase &p) const |
bool | sharingData (const CTPointerBase &p) const |
bool | operator!= (const CTPointerBase &p) const |
virtual void * | voidptr () const |
void | setAutoDelete (bool b) |
bool | isValid () const |
This is the base class to be inherited by a template class. This cannot be used directly.
|
Destructor. If this one gets called, it automagically decrements the usage counter of the object pointed to. If it reaches zero, then no other pointer points to the object and the object faces deletion.
|
|
Get the description of this pointer. Useful for debugging purposes.
|
|
Returns true if this CTPointer is valid. This tells you if this pointer is pointing to accessible data.
|
|
Returns the description of the object. Useful for debugging purposes.
|
|
Inequality operator for the object pointed to. This operator checks whether another pointer and this one are not pointing to the same data.
|
|
Equality operator for the object pointed to. This operator checks whether another pointer and this one are pointing to the same data.
|
|
Returns the reference counter of the object. Useful for debugging purposes.
|
|
Set the auto-deletion behaviour. Set the auto-deletion behaviour of the CTPointerObject (the wrapper object around the "real" object pointed to) that is pointed to by this CTPointer. By default, this is set to setAutoDeletion(true), i.e. the object will automatically be deleted when its last CTPointer gets deleted. On the other hand, when you call this with b=false, then the object this pointer points to will not be deleted by the last CTPointer. This might be useful if you are pointing to constant objects, or if you need to continue using this object through raw pointers elsewhere. This flag is a property of the CTPointerObject, i.e. even for multiple CTPointer's pointing to the same object there is only *one* autoDelete flag per object. Changes to this flag affect all of the CTPointer's at the same time. This CTPointer MUST already point to an object (a NULL pointer is not allowed at this point) since the autodelete flag is a property of the class CTPointerObject. If called on an invalid CTPointer, this method will throw an CTError.
|
|
Set the description of this pointer. Useful for debugging purposes.
|
|
Set the description of the object this pointer points to. Useful for debugging purposes.
|
|
Checks whether both pointers share their data object.
|
|
Returns a raw pointer to the stored data. You should not really use this, but if you do so please NEVER delete the object the pointer points to ! AND you should make sure that as long as you are using the pointer returned there is still a CTPointer pointing to it (because if the last CTPointer stops pointing to an object that object gets deleted) !!
|