#include <ReferenceImplementation.h>
Collaboration diagram for Arxx::ReferenceImplementation:
Public Member Functions | |
Arxx::u4byte | u4GetUniqueID (void) const |
Returns the unique ID of the reference. | |
Arxx::Item * | pGetItem (void) |
Returns the Arxx::Item pointer of the reference. | |
const Arxx::Item * | pGetItem (void) const |
Returns the Arxx::Item pointer of the reference. | |
Arxx::u4byte | u4GetReferenceCount (void) const |
Returns m_u4ReferenceCounter, the number of Arxx::Reference objects that hold this ReferenceImplementation object. | |
void | vResolve (Arxx::Item &Item) |
Resolves an unresolved reference with a given item. | |
void | vUnresolve (void) |
Unresolves the resolved reference by setting its Arxx::Item pointer to 0. | |
void | vDecoupleFromArchive (void) |
This function sets m_pArchive to `0`. | |
Static Public Member Functions | |
static Arxx::ReferenceImplementation * | pGetReference (Arxx::Item &Item) |
Returns a new ReferenceImplementation instance created from a Arxx::Item. | |
static Arxx::ReferenceImplementation * | pGetReference (Arxx::u4byte u4UniqueID, Arxx::Archive *pArchive=0) |
Returns a new ReferenceImplementation instance created from a unique ID. | |
static Arxx::ReferenceImplementation * | pGetReference (Arxx::ReferenceImplementation *pReference) |
Increases the reference counter and conveniently returns the parameter. | |
static bool | bRelease (Arxx::ReferenceImplementation *pReference) |
Decreases the reference counter and possible deletes the reference. | |
Private Member Functions | |
ReferenceImplementation (void) | |
The constructor of a ReferenceImplementation object. | |
~ReferenceImplementation (void) | |
The destructor of a ReferenceImplementation object. | |
ReferenceImplementation (const Arxx::ReferenceImplementation &Reference) | |
No copy semantic for ReferenceImplementation objects. | |
Arxx::ReferenceImplementation & | operator= (const Arxx::ReferenceImplementation &Reference) |
No assigment semantic for ReferenceImplementation objects. | |
Private Attributes | |
Arxx::u4byte | m_u4UniqueID |
Arxx::Item * | m_pItem |
Arxx::u4byte | m_u4ReferenceCount |
Arxx::Archive * | m_pArchive |
Arxx::ReferenceImplementation::ReferenceImplementation | ( | void | ) | [private] |
The constructor of a ReferenceImplementation object.
Instances of this class are only created via the pGetReference() calls.
Arxx::ReferenceImplementation::~ReferenceImplementation | ( | void | ) | [private] |
The destructor of a ReferenceImplementation object.
Instances of this class may only be destroyed using the vRelease() call.
Arxx::ReferenceImplementation::ReferenceImplementation | ( | const Arxx::ReferenceImplementation & | Reference | ) | [private] |
No copy semantic for ReferenceImplementation objects.
bool Arxx::ReferenceImplementation::bRelease | ( | Arxx::ReferenceImplementation * | pReference | ) | [static] |
Decreases the reference counter and possible deletes the reference.
pReference | The ReferenceImplementation object that you want to release. |
Arxx::ReferenceImplementation& Arxx::ReferenceImplementation::operator= | ( | const Arxx::ReferenceImplementation & | Reference | ) | [private] |
No assigment semantic for ReferenceImplementation objects.
const Arxx::Item * Arxx::ReferenceImplementation::pGetItem | ( | void | ) | const |
Returns the Arxx::Item pointer of the reference.
If the reference is resolved this correctly returns the Arxx::Item's pointer. In case of an unresolved reference the returned pointer is 0.
Arxx::Item * Arxx::ReferenceImplementation::pGetItem | ( | void | ) |
Returns the Arxx::Item pointer of the reference.
If the reference is resolved this correctly returns the Arxx::Item's pointer. In case of an unresolved reference the returned pointer is 0.
Arxx::ReferenceImplementation * Arxx::ReferenceImplementation::pGetReference | ( | Arxx::ReferenceImplementation * | pReference | ) | [static] |
Increases the reference counter and conveniently returns the parameter.
pReference | The ReferenceImplementation object that you want to reference. |
Arxx::ReferenceImplementation * Arxx::ReferenceImplementation::pGetReference | ( | Arxx::u4byte | u4UniqueID, | |
Arxx::Archive * | pArchive = 0 | |||
) | [static] |
Returns a new ReferenceImplementation instance created from a unique ID.
u4UniqueID | The unique ID that the new reference shoud refer to. | |
pArchive | Since unique IDs are not strictly bound to but only sensible in Archives, this lets you pass the appropriate Archive. |
Arxx::ReferenceImplementation * Arxx::ReferenceImplementation::pGetReference | ( | Arxx::Item & | Item | ) | [static] |
Returns a new ReferenceImplementation instance created from a Arxx::Item.
Item | The Arxx::Item that the new reference should refer to. |
Arxx::u4byte Arxx::ReferenceImplementation::u4GetReferenceCount | ( | void | ) | const |
Returns m_u4ReferenceCounter, the number of Arxx::Reference objects that hold this ReferenceImplementation object.
Arxx::u4byte Arxx::ReferenceImplementation::u4GetUniqueID | ( | void | ) | const |
Returns the unique ID of the reference.
It does not matter if the reference is resolved or unresolved, the unique ID is certain to be returned.
void Arxx::ReferenceImplementation::vDecoupleFromArchive | ( | void | ) |
This function sets m_pArchive to `0`.
void Arxx::ReferenceImplementation::vResolve | ( | Arxx::Item & | Item | ) |
Resolves an unresolved reference with a given item.
Item | The Arxx::Item that will be used to resolve the reference. |
Not meeting one of these requirements will throw an std::runtime_error exception.
void Arxx::ReferenceImplementation::vUnresolve | ( | void | ) |
Unresolves the resolved reference by setting its Arxx::Item pointer to 0.
Arxx::Item* Arxx::ReferenceImplementation::m_pItem [private] |