Logo Search packages:      
Sourcecode: pwlib version File versions

PSmartPointer Class Reference

#include <smartptr.h>

Inheritance diagram for PSmartPointer:

PObject PNotifier

List of all members.


Detailed Description

This is the class for pointers to objects that use the { smart pointer} system. In conjunction with the PSmartObject# class, this class references objects that can have the automatic deletion of the object instance when there are no more smart pointer instances pointing to it.

A PSmartPointer carries the pointer to a PSmartObject# instance which contains a reference count. Assigning or copying instances of smart pointers will automatically increment and decrement the reference count. When the last instance that references a PSmartObject# instance is destroyed or overwritten, the PSmartObject# is deleted.

A NULL value is possible for a smart pointer. It can be detected via the IsNULL()# function.

Definition at line 55 of file smartptr.h.


Comparison functions

virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator>= (const PObject &obj) const
enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
virtual BOOL InternalIsDescendant (const char *clsName) const
BOOL IsClass (const char *cls) const
static const char * Class ()

I/O functions

virtual void PrintOn (ostream &strm) const
virtual void ReadFrom (istream &strm)
ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)

Public Member Functions

Miscellaneous functions
virtual PObjectClone () const
virtual PINDEX HashFunction () const
Overrides from class PObject
virtual Comparison Compare (const PObject &obj) const
Pointer access functions
PSmartObjectGetObject () const
BOOL IsNULL () const
Construction
PSmartPointeroperator= (const PSmartPointer &ptr)
 PSmartPointer (const PSmartPointer &ptr)
 PSmartPointer (PSmartObject *obj=NULL)
virtual ~PSmartPointer ()

Protected Attributes

PSmartObjectobject
 Object the smart pointer points to.

Private Member Functions

 PCLASSINFO (PSmartPointer, PObject)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index