|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
template<class TYPE> class XInterface { public: XInterface(TYPE *pInt=NULL); XInterface(const XInterface &refInt); ~XInterface(); public: const XInterface &operator=(TYPE *pInt); const XInterface &operator=(const XInterface &refInt); bool operator==(const TYPE *pInt) const; bool operator==(const XInterface &refInt) const; bool operator!=(const TYPE *pInt) const; bool operator!=(const XInterface &refInt) const; TYPE *operator->() const; TYPE &operator*() const; void AddRef() const; void Release() const; };
The template class for pointers to objects, lifetime of which is controlled through reference counting.
Classes created using this template implement the "safe" pointers to dynamically created objects. Each safe pointer "owns" a reference to the object. If an object's lifetime is controlled through reference counting, the object exists while there is at least one safe pointer which owns a reference to it. Once the last safe pointer to this object is deleted, the object itself is deleted.
Throughout the toolkit, the standard naming convention is used
regarding the type names for safe pointers. Names of toolkit classes
are usually started with the letter
'C'
or
'I'
. Names for corresponding safe pointers
are formed via replacing this starting letter with
'X'
.
Constructor/Destructor Summary | |
XInterface
(TYPE *pInt=NULL);
����������Constructs the pointer to the specified object. |
|
XInterface
(const XInterface &refInt);
����������Constructs the pointer copying another pointer. |
|
~XInterface
();
����������Destroys the pointer. |
Function Summary | |
const�XInterface�&
|
operator=
(TYPE *pInt);
����������Assigns the specified object pointer to this pointer. |
const�XInterface�&
|
operator=
(const XInterface &refInt);
����������Assigns another pointer to this pointer. |
bool
|
operator==
(const TYPE *pInt) const;
����������Compares for equality this pointer and the pointer to the specified object. |
bool
|
operator==
(const XInterface &refInt) const;
����������Compares for equality this pointer and another pointer. |
bool
|
operator!=
(const TYPE *pInt) const;
����������Compares for non-equality this pointer and the pointer to the specified object. |
bool
|
operator!=
(const XInterface &refInt) const;
����������Compares for non-equality this pointer and another pointer. |
TYPE�*
|
operator->
() const;
����������Returns the address of the object referenced by this pointer. |
TYPE�&
|
operator*
() const;
����������Returns the object referenced by this pointer. |
void
|
AddRef
() const;
����������Increments by one the reference counter of the object referenced by this pointer. |
void
|
Release
() const;
����������Decrements by one the reference counter of the object referenced by this pointer; deletes the object if the resulting value of the reference counter becomes equal to or less than zero. |
Constructor/Destructor Detail |
XInterface(TYPE *pInt=NULL);
Constructs the pointer to the specified object.
pInt
- the objectXInterface(const XInterface &refInt);
Constructs the pointer copying another pointer.
refInt
- the pointer to copy~XInterface();
Destroys the pointer.
Function Detail |
const XInterface &operator=(TYPE *pInt);
Assigns the specified object pointer to this pointer.
pInt
- the objectconst XInterface &operator=(const XInterface &refInt);
Assigns another pointer to this pointer.
refInt
- the pointer to assignbool operator==(const TYPE *pInt) const;
Compares for equality this pointer and the pointer to the specified object.
Two pointers are equal if they point to the same object,
or if they both are equal to
NULL
.
pInt
- the objecttrue
if the pointers are equal;
false
otherwisebool operator==(const XInterface &refInt) const;
Compares for equality this pointer and another pointer.
Two pointers are equal if they point to the same object,
or if they both are equal to
NULL
.
refInt
- the pointer to compare withtrue
if the pointers are equal;
false
otherwisebool operator!=(const TYPE *pInt) const;
Compares for non-equality this pointer and the pointer to the specified object.
Two pointers are equal if they point to the same object,
or if they both are equal to
NULL
.
pInt
- the objecttrue
if the pointers are not equal;
false
otherwisebool operator!=(const XInterface &refInt) const;
Compares for non-equality this pointer and another pointer.
Two pointers are equal if they point to the same object,
or if they both are equal to
NULL
.
refInt
- the pointer to compare withtrue
if the pointers are not equal;
false
otherwiseTYPE *operator->() const;
Returns the address of the object referenced by this pointer.
TYPE &operator*() const;
Returns the object referenced by this pointer.
void AddRef() const;
Increments by one the reference counter of the object referenced by this pointer.
void Release() const;
Decrements by one the reference counter of the object referenced by this pointer; deletes the object if the resulting value of the reference counter becomes equal to or less than zero.
|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |