Web Analytics Made Easy - Statcounter
Skip to content

Class SBCReferencePointer#

template <class ReferenceTargetType>

ClassList > SBCReferencePointer

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

  • #include <SBCReferencePointer.hpp>

Inherits the following classes: SBCReferenceOwnerSingleton

Public Functions#

Type Name
SBCReferencePointer ()
SBCReferencePointer (ReferenceTargetType * t)
SBCReferencePointer (const SBCReferencePointer< ReferenceTargetType > & p)
ReferenceTargetType * getPointer () const
bool operator!= (const SBCReferencePointer & p)
bool operator!= (const SBCReferencePointer & p) const
bool operator!= (ReferenceTargetType * t)
bool operator!= (ReferenceTargetType * t) const
ReferenceTargetType * operator() () const
ReferenceTargetType & operator* ()
ReferenceTargetType * operator-> () const
SBCReferencePointer & operator= (ReferenceTargetType * t)
SBCReferencePointer & operator= (const SBCReferencePointer & p)
bool operator== (const SBCReferencePointer & p)
bool operator== (const SBCReferencePointer & p) const
bool operator== (ReferenceTargetType * t)
bool operator== (ReferenceTargetType * t) const
virtual ~SBCReferencePointer ()

Public Functions inherited from SBCReferenceOwnerSingleton#

See SBCReferenceOwnerSingleton

Type Name
SBCReferenceOwnerSingleton ()
SBCReferenceOwnerSingleton (SBCReferenceTarget * referenceTarget)
SBCReferenceOwnerSingleton (const SBCReferenceOwnerSingleton & p)
virtual void deleteReferenceTarget ()
Deletes the reference target.
unsigned int getMemoryFootprint () const
SBCReferenceTarget * getReferenceTarget () const
Returns the reference target.
bool isValid () const
Returns true if and only if the reference target is non null.
virtual void print () const
void setReferenceTarget (SBCReferenceTarget * referenceTarget)
Sets the reference target.
virtual ~SBCReferenceOwnerSingleton ()

Public Static Functions#

Type Name
void operator delete (void * p, std::size_t size)
void * operator new (std::size_t size)

Protected Attributes inherited from SBCReferenceOwnerSingleton#

See SBCReferenceOwnerSingleton

Type Name
SBCReferenceToTarget referenceToTarget

Protected Functions inherited from SBCReferenceOwnerSingleton#

See SBCReferenceOwnerSingleton

Type Name
virtual void detachReferenceTarget ()

Protected Functions inherited from SBCReferenceOwner#

See SBCReferenceOwner

Type Name
SBCReferenceOwner ()
Constructs a reference owner.
virtual ~SBCReferenceOwner ()
Destructs the reference owner.

Detailed Description#

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:

  • they (collectively) own the reference target they point to: when the last reference owner is destructed, the reference target is deleted. In the data graph of SAMSON, objects may be created and deleted by some objects, SAMSON Extensions, etc. A SAMSON pointer will be automatically set to zero when the referenced object is deleted.

Short name: SBPointer

Public Functions Documentation#

function SBCReferencePointer [1/3]#

inline SBCReferencePointer::SBCReferencePointer () 

function SBCReferencePointer [2/3]#

inline SBCReferencePointer::SBCReferencePointer (
    ReferenceTargetType * t
) 

function SBCReferencePointer [3/3]#

inline SBCReferencePointer::SBCReferencePointer (
    const SBCReferencePointer < ReferenceTargetType > & p
) 

function getPointer#

inline ReferenceTargetType * SBCReferencePointer::getPointer () const

function operator!=#

inline bool SBCReferencePointer::operator!= (
    const SBCReferencePointer & p
) 

function operator!=#

inline bool SBCReferencePointer::operator!= (
    const SBCReferencePointer & p
) const

function operator!=#

inline bool SBCReferencePointer::operator!= (
    ReferenceTargetType * t
) 

function operator!=#

inline bool SBCReferencePointer::operator!= (
    ReferenceTargetType * t
) const

function operator()#

inline ReferenceTargetType * SBCReferencePointer::operator() () const

function operator*#

inline ReferenceTargetType & SBCReferencePointer::operator* () 

function operator->#

inline ReferenceTargetType * SBCReferencePointer::operator-> () const

function operator=#

inline SBCReferencePointer & SBCReferencePointer::operator= (
    ReferenceTargetType * t
) 

function operator=#

inline SBCReferencePointer & SBCReferencePointer::operator= (
    const SBCReferencePointer & p
) 

function operator==#

inline bool SBCReferencePointer::operator== (
    const SBCReferencePointer & p
) 

function operator==#

inline bool SBCReferencePointer::operator== (
    const SBCReferencePointer & p
) const

function operator==#

inline bool SBCReferencePointer::operator== (
    ReferenceTargetType * t
) 

function operator==#

inline bool SBCReferencePointer::operator== (
    ReferenceTargetType * t
) const

function ~SBCReferencePointer#

inline virtual SBCReferencePointer::~SBCReferencePointer () 

Public Static Functions Documentation#

function operator delete#

static inline void SBCReferencePointer::operator delete (
    void * p,
    std::size_t size
) 

function operator new#

static inline void * SBCReferencePointer::operator new (
    std::size_t size
)