Unicorn XML Toolkit
Version 1.50.00

Namespace Core
Class XInterface

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' .

Since:
1.00.00
Version:
1.50.00
Author:
Alexey Gokhberg
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

XInterface(TYPE *pInt=NULL);

Constructs the pointer to the specified object.

Parameters:
pInt - the object

XInterface

XInterface(const XInterface &refInt);

Constructs the pointer copying another pointer.

Parameters:
refInt - the pointer to copy

~XInterface

~XInterface();

Destroys the pointer.

Function Detail

operator=

const XInterface &operator=(TYPE *pInt);

Assigns the specified object pointer to this pointer.

Parameters:
pInt - the object
Returns:
this pointer

operator=

const XInterface &operator=(const XInterface &refInt);

Assigns another pointer to this pointer.

Parameters:
refInt - the pointer to assign
Returns:
this pointer

operator==

bool 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 .

Parameters:
pInt - the object
Returns:
true if the pointers are equal; false otherwise

operator==

bool 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 .

Parameters:
refInt - the pointer to compare with
Returns:
true if the pointers are equal; false otherwise

operator!=

bool 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 .

Parameters:
pInt - the object
Returns:
true if the pointers are not equal; false otherwise

operator!=

bool 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 .

Parameters:
refInt - the pointer to compare with
Returns:
true if the pointers are not equal; false otherwise

operator->

TYPE *operator->() const;

Returns the address of the object referenced by this pointer.

Returns:
the address of the object referenced by this pointer

operator*

TYPE &operator*() const;

Returns the object referenced by this pointer.

Returns:
the object referenced by this pointer

AddRef

void AddRef() const;

Increments by one the reference counter of the object referenced by this pointer.

Release

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


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.