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 () Builds a SAMSON pointer. |
|
SBCReferencePointer (ReferenceTargetType * t) Builds a SAMSON pointer to the reference target t . |
|
SBCReferencePointer (const SBCReferencePointer< ReferenceTargetType > & p) Copy constructor. |
|
ReferenceTargetType * | getPointer () const Returns a pointer to the reference target. |
bool | operator!= (const SBCReferencePointer & p) Inequality operator: returns true if both SAMSON pointers refer to different targets. |
bool | operator!= (const SBCReferencePointer & p) const Inequality operator: returns true if both SAMSON pointers refer to different targets. |
bool | operator!= (ReferenceTargetType * t) Inequality operator: returns true if this SAMSON pointer does not refer to the given targett . |
bool | operator!= (ReferenceTargetType * t) const Inequality operator: returns true if this SAMSON pointer does not refer to the given targett . |
ReferenceTargetType * | operator() () const Returns a pointer to the reference target. |
ReferenceTargetType & | operator* () Returns a reference to the reference target. |
ReferenceTargetType * | operator-> () const Returns a pointer to the reference target. |
SBCReferencePointer & | operator= (ReferenceTargetType * t) Assignment operator. |
SBCReferencePointer & | operator= (const SBCReferencePointer & p) Copy assignment operator. |
bool | operator== (const SBCReferencePointer & p) Equality operator: returns true if both SAMSON pointers refer to the same target. |
bool | operator== (const SBCReferencePointer & p) const Equality operator: returns true if both SAMSON pointers refer to the same target. |
bool | operator== (ReferenceTargetType * t) Equality operator: returns true if this SAMSON pointer refers to the given targett . |
bool | operator== (ReferenceTargetType * t) const Equality operator: returns true if this SAMSON pointer refers to the given targett . |
virtual | ~SBCReferencePointer () Destructor. |
Public Functions inherited from SBCReferenceOwnerSingleton#
See SBCReferenceOwnerSingleton
Type | Name |
---|---|
SBCReferenceOwnerSingleton () Default constructor. |
|
SBCReferenceOwnerSingleton (SBCReferenceTarget * referenceTarget) Builds a reference owner referencing the target referenceTarget . |
|
SBCReferenceOwnerSingleton (const SBCReferenceOwnerSingleton & p) Copy constructor. |
|
virtual void | deleteReferenceTarget () Deletes the reference target. |
unsigned int | getMemoryFootprint () const Returns the memory footprint. |
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 Prints debugging information. |
void | setReferenceTarget (SBCReferenceTarget * referenceTarget) Sets the reference target. |
virtual | ~SBCReferenceOwnerSingleton () Destructor. |
Public Static Functions#
Type | Name |
---|---|
void | operator delete (void * p, std::size_t size) The new operator. |
void * | operator new (std::size_t size) |
Protected Attributes inherited from SBCReferenceOwnerSingleton#
See SBCReferenceOwnerSingleton
Type | Name |
---|---|
SBCReferenceToTarget | referenceToTarget The reference to the target. |
Protected Functions inherited from SBCReferenceOwnerSingleton#
See SBCReferenceOwnerSingleton
Type | Name |
---|---|
virtual void | detachReferenceTarget () |
Protected Functions inherited from 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]#
Builds a SAMSON pointer.
function SBCReferencePointer [2/3]#
Builds a SAMSON pointer to the reference target t
.
function SBCReferencePointer [3/3]#
Copy constructor.
inline SBCReferencePointer::SBCReferencePointer (
const SBCReferencePointer < ReferenceTargetType > & p
)
function getPointer#
Returns a pointer to the reference target.
function operator!=#
Inequality operator: returns true
if both SAMSON pointers refer to different targets.
function operator!=#
Inequality operator: returns true
if both SAMSON pointers refer to different targets.
function operator!=#
Inequality operator: returns true
if this SAMSON pointer does not refer to the given targett
.
function operator!=#
Inequality operator: returns true
if this SAMSON pointer does not refer to the given targett
.
function operator()#
Returns a pointer to the reference target.
function operator*#
Returns a reference to the reference target.
function operator->#
Returns a pointer to the reference target.
function operator=#
Assignment operator.
function operator=#
Copy assignment operator.
function operator==#
Equality operator: returns true
if both SAMSON pointers refer to the same target.
function operator==#
Equality operator: returns true
if both SAMSON pointers refer to the same target.
function operator==#
Equality operator: returns true
if this SAMSON pointer refers to the given targett
.
function operator==#
Equality operator: returns true
if this SAMSON pointer refers to the given targett
.
function ~SBCReferencePointer#
Destructor.
Public Static Functions Documentation#
function operator delete#
The new
operator.