Arxx::ReferenceImplementation Class Reference

#include <ReferenceImplementation.h>

Collaboration diagram for Arxx::ReferenceImplementation:

Collaboration graph
[legend]
List of all members.

Detailed Description

The real Arxx::Item reference used by Arxx::Reference to implement shared references.


Public Member Functions

Arxx::u4byte u4GetUniqueID (void) const
 Returns the unique ID of the reference.
Arxx::ItempGetItem (void)
 Returns the Arxx::Item pointer of the reference.
const Arxx::ItempGetItem (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::ReferenceImplementationpGetReference (Arxx::Item &Item)
 Returns a new ReferenceImplementation instance created from a Arxx::Item.
static Arxx::ReferenceImplementationpGetReference (Arxx::u4byte u4UniqueID, Arxx::Archive *pArchive=0)
 Returns a new ReferenceImplementation instance created from a unique ID.
static Arxx::ReferenceImplementationpGetReference (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::ReferenceImplementationoperator= (const Arxx::ReferenceImplementation &Reference)
 No assigment semantic for ReferenceImplementation objects.

Private Attributes

Arxx::u4byte m_u4UniqueID
Arxx::Itemm_pItem
Arxx::u4byte m_u4ReferenceCount
Arxx::Archivem_pArchive


Constructor & Destructor Documentation

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.


Member Function Documentation

bool Arxx::ReferenceImplementation::bRelease ( Arxx::ReferenceImplementation pReference  )  [static]

Decreases the reference counter and possible deletes the reference.

Parameters:
pReference The ReferenceImplementation object that you want to release.
Returns:
A boolean value indicating whether the reference was deleted or not.
If decreasing the reference counter of pReference make it equal to zero, the object pReference is deleted.

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.

Parameters:
pReference The ReferenceImplementation object that you want to reference.
Since the new reference is equal to the old reference its resolved status is equal as well.

Arxx::ReferenceImplementation * Arxx::ReferenceImplementation::pGetReference ( Arxx::u4byte  u4UniqueID,
Arxx::Archive pArchive = 0 
) [static]

Returns a new ReferenceImplementation instance created from a unique ID.

Parameters:
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.
The new reference of course is unresolved.

Arxx::ReferenceImplementation * Arxx::ReferenceImplementation::pGetReference ( Arxx::Item Item  )  [static]

Returns a new ReferenceImplementation instance created from a Arxx::Item.

Parameters:
Item The Arxx::Item that the new reference should refer to.
Of course, the new reference is resolved.

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.

Parameters:
Item The Arxx::Item that will be used to resolve the reference.
This functions checks for two things:

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.


Member Data Documentation

Arxx::Archive* Arxx::ReferenceImplementation::m_pArchive [private]

Arxx::Item* Arxx::ReferenceImplementation::m_pItem [private]

Arxx::u4byte Arxx::ReferenceImplementation::m_u4ReferenceCount [private]

Arxx::u4byte Arxx::ReferenceImplementation::m_u4UniqueID [private]


The documentation for this class was generated from the following files:
Generated on Tue Oct 10 11:34:40 2006 for libarxx by  doxygen 1.4.7