SBCReferencePointer< ReferenceTargetType > Class Template Reference

This class describes a pointer to a reference target. More...

Constructors and destructors

 SBCReferencePointer ()
 SBCReferencePointer (ReferenceTargetType *t)
 SBCReferencePointer (const SBCReferencePointer< ReferenceTargetType > &p)
virtual ~SBCReferencePointer ()


SBCReferencePointeroperator= (ReferenceTargetType *t)
SBCReferencePointeroperator= (const SBCReferencePointer &p)
bool operator== (const SBCReferencePointer &p)
bool operator!= (const SBCReferencePointer &p)
bool operator== (const SBCReferencePointer &p) const
bool operator!= (const SBCReferencePointer &p) const
bool operator== (ReferenceTargetType *t)
bool operator!= (ReferenceTargetType *t)
bool operator== (ReferenceTargetType *t) const
bool operator!= (ReferenceTargetType *t) const
ReferenceTargetType * operator() () const
ReferenceTargetType * operator-> () const
ReferenceTargetType & operator* ()

Convenience functions

ReferenceTargetType * getPointer () const

Additional Inherited Members

- Public Member Functions inherited from SBCReferenceOwnerSingleton
 SBCReferenceOwnerSingleton ()
 SBCReferenceOwnerSingleton (SBCReferenceTarget *referenceTarget)
 SBCReferenceOwnerSingleton (const SBCReferenceOwnerSingleton &p)
virtual ~SBCReferenceOwnerSingleton ()
bool isValid () const
 Returns true if and only if the reference target is non null.
void setReferenceTarget (SBCReferenceTarget *referenceTarget)
 Sets the reference target.
SBCReferenceTargetgetReferenceTarget () const
 Returns the reference target.
virtual void deleteReferenceTarget ()
 Deletes the reference target.
virtual void print () const
unsigned int getMemoryFootprint () const
- Protected Member Functions inherited from SBCReferenceOwner
 SBCReferenceOwner ()
 Constructs a reference owner.
virtual ~SBCReferenceOwner ()
 Destructs the reference owner.

Detailed Description

template<class ReferenceTargetType = SBCReferenceTarget>
class SBCReferencePointer< ReferenceTargetType >

This class defines SAMSON pointers, used to maintain references to a pointer target, i.e. objects of classes which derive from SBCReferenceTarget. Each SAMSON pointer may hold one reference at most. With SAMSON pointer indexes and SAMSON pointer lists, SAMSON pointers collectively form reference owners.

Unlike traditional C++ pointers, SAMSON pointers have two main characteristics: