Web Analytics Made Easy - Statcounter
Skip to content

Class SBCReferenceIndexer#

ClassList > SBCReferenceIndexer

Inherits the following classes: SBCContainerIndexer

Public Functions inherited from SBCContainerIndexer#

See SBCContainerIndexer

Type Name
SBCContainerIndexer ()
Creates an indexer.
SBCContainerIndexer (unsigned int initialSize)
Creates an indexer with a default pre-allocated size.
SBCContainerIndexer (std::set< ObjectType > & objectSet)
Indexes a set of objects.
SBCContainerIndexer (std::vector< ObjectType > & objectVector)
Indexes a vector of objects.
SBCContainerIndexer (const SBCContainerIndexer & indexer)
Copy constructor.
SBCContainerIndexer (SBCContainerIndexer && indexer)
Move constructor.
iterator begin ()
Returns an iterator that points to the beginning of the indexer.
const_iterator begin () const
Returns an iterator that points to the beginning of the indexer.
void clear ()
Clears the indexer.
bool empty () const
Returns true if and only if the indexer is empty.
iterator end ()
Returns an iterator that points to the end of the indexer.
const_iterator end () const
Returns an iterator that points to the end of the indexer.
unsigned int eraseIndex (unsigned int objectIndex)
Erases object objectIndex from the indexer.
unsigned int eraseObject (const ObjectType & object)
Erases the object from the indexer.
unsigned int getIndex (const ObjectType & object) const
Returns the index associated to the object .
bool getIndex (const ObjectType & object, unsigned int & index) const
Returns the index associated to the object .
ObjectType getObject (unsigned int index) const
Returns the object associated to the index .
bool hasIndex (const ObjectType & object) const
Returns true if the object has an index.
unsigned int insert (unsigned int i, const ObjectType & object)
Inserts an object in the indexer at position i if possible, and returns the index of the object.
SBCContainerIndexer & operator= (const SBCContainerIndexer & indexer)
Copy assignment.
SBCContainerIndexer & operator= (SBCContainerIndexer && indexer)
Move assignment.
ObjectType operator[] (unsigned int index) const
Returns the object associated to the index .
unsigned int pop_back ()
Adds an object in the indexer and returns the index of the object.
void print () const
Prints some debugging information.
unsigned int push_back (const ObjectType & object)
Adds an object in the indexer if possible, and returns the index of the object.
reverse_iterator rbegin ()
Returns a reverse iterator that points to the reverse beginning of the indexer.
const_reverse_iterator rbegin () const
Returns a reverse iterator that points to the reverse beginning of the indexer.
reverse_iterator rend ()
Returns a reverse iterator that points to the reverse end of the indexer.
const_reverse_iterator rend () const
Returns a reverse iterator that points to the reverse end of the indexer.
unsigned int size () const
Returns the number of indexed objects.
virtual ~SBCContainerIndexer ()
Destructs the indexer.

Protected Attributes inherited from SBCContainerIndexer#

See SBCContainerIndexer

Type Name
HashMap * indexMap
The hash map.
Vector * objectVector
The object vector.

Protected Functions#

Type Name
SBCReferenceIndexer ()
Creates a reference indexer.
SBCReferenceIndexer (unsigned int initialSize)
Creates a reference indexer.
SBCReferenceIndexer (std::vector< SBCReferenceToTarget * > & referenceToTargetVector)
SBCReferenceIndexer (std::set< SBCReferenceToTarget * > & referenceToTargetSet)
SBCReferenceIndexer (const SBCReferenceIndexer & referenceIndex)
unsigned int eraseReferenceTarget (SBCReferenceTarget * referenceTarget)
Erases the reference from the indexer.
unsigned int eraseReferenceTarget (unsigned int referenceTargetIndex)
Erases reference referenceIndex from the indexer.
unsigned int eraseReferenceToTarget (SBCReferenceToTarget * referenceToTarget)
Erases the reference from the indexer.
unsigned int eraseReferenceToTarget (unsigned int referenceToTargetIndex)
Erases reference referenceIndex from the indexer.
unsigned int getIndex (SBCReferenceToTarget * referenceToTarget) const
Returns the index associated to the reference .
bool getIndex (SBCReferenceToTarget * referenceToTarget, unsigned int & index) const
Returns the index associated to the reference .
unsigned int getIndex (SBCReferenceTarget * referenceTarget) const
Returns the index associated to the reference .
bool getIndex (SBCReferenceTarget * referenceTarget, unsigned int & index) const
Returns the index associated to the reference .
SBCReferenceTarget * getReferenceTarget (unsigned int index) const
Returns the reference associated to the index .
SBCReferenceToTarget * getReferenceToTarget (unsigned int index) const
Returns the reference associated to the index .
SBCReferenceToTarget * getReferenceToTarget (SBCReferenceTarget * referenceTarget) const
Returns the reference associated to the index .
bool hasIndex (SBCReferenceToTarget * referenceToTarget) const
Returns true if the reference has an index.
bool hasIndex (SBCReferenceTarget * referenceTarget) const
Returns true if the reference has an index.
virtual ~SBCReferenceIndexer ()

Protected Functions Documentation#

function SBCReferenceIndexer [1/5]#

Creates a reference indexer.

SBCReferenceIndexer::SBCReferenceIndexer () 


function SBCReferenceIndexer [2/5]#

Creates a reference indexer.

SBCReferenceIndexer::SBCReferenceIndexer (
    unsigned int initialSize
) 


function SBCReferenceIndexer [3/5]#

SBCReferenceIndexer::SBCReferenceIndexer (
    std::vector< SBCReferenceToTarget * > & referenceToTargetVector
) 

function SBCReferenceIndexer [4/5]#

SBCReferenceIndexer::SBCReferenceIndexer (
    std::set< SBCReferenceToTarget * > & referenceToTargetSet
) 

function SBCReferenceIndexer [5/5]#

SBCReferenceIndexer::SBCReferenceIndexer (
    const SBCReferenceIndexer & referenceIndex
) 

function eraseReferenceTarget [1/2]#

Erases the reference from the indexer.

unsigned int SBCReferenceIndexer::eraseReferenceTarget (
    SBCReferenceTarget * referenceTarget
) 

The function returns an unsigned int with the following meaning:

  • if the reference was not present in the index, the returned value is the number of indexed references.
  • else, the returned value is the index of the reference that was removed, in [0, size-1].

Note that these two returned values coincide when the client (unsuccessfully) attempts to erase reference with index size.


function eraseReferenceTarget [2/2]#

Erases reference referenceIndex from the indexer.

unsigned int SBCReferenceIndexer::eraseReferenceTarget (
    unsigned int referenceTargetIndex
) 

The function returns an unsigned int with the following meaning:

  • if the reference was not present in the index, the returned value is the number of indexed references.
  • else, the returned value is the index of the reference that was removed, in [0, size-1].

Note that these two returned values coincide when the client (unsuccessfully) attempts to erase reference with index size.


function eraseReferenceToTarget [1/2]#

Erases the reference from the indexer.

unsigned int SBCReferenceIndexer::eraseReferenceToTarget (
    SBCReferenceToTarget * referenceToTarget
) 

The function returns an unsigned int with the following meaning:

  • if the reference was not present in the index, the returned value is the number of indexed references.
  • else, the returned value is the index of the reference that was removed, in [0, size-1].

Note that these two returned values coincide when the client (unsuccessfully) attempts to erase reference with index size.


function eraseReferenceToTarget [2/2]#

Erases reference referenceIndex from the indexer.

unsigned int SBCReferenceIndexer::eraseReferenceToTarget (
    unsigned int referenceToTargetIndex
) 

The function returns an unsigned int with the following meaning:

  • if the reference was not present in the index, the returned value is the number of indexed references.
  • else, the returned value is the index of the reference that was removed, in [0, size-1].

Note that these two returned values coincide when the client (unsuccessfully) attempts to erase reference with index size.


function getIndex [1/4]#

Returns the index associated to the reference .

unsigned int SBCReferenceIndexer::getIndex (
    SBCReferenceToTarget * referenceToTarget
) const


function getIndex [2/4]#

Returns the index associated to the reference .

bool SBCReferenceIndexer::getIndex (
    SBCReferenceToTarget * referenceToTarget,
    unsigned int & index
) const


function getIndex [3/4]#

Returns the index associated to the reference .

unsigned int SBCReferenceIndexer::getIndex (
    SBCReferenceTarget * referenceTarget
) const


function getIndex [4/4]#

Returns the index associated to the reference .

bool SBCReferenceIndexer::getIndex (
    SBCReferenceTarget * referenceTarget,
    unsigned int & index
) const


function getReferenceTarget#

Returns the reference associated to the index .

SBCReferenceTarget * SBCReferenceIndexer::getReferenceTarget (
    unsigned int index
) const


function getReferenceToTarget [1/2]#

Returns the reference associated to the index .

SBCReferenceToTarget * SBCReferenceIndexer::getReferenceToTarget (
    unsigned int index
) const


function getReferenceToTarget [2/2]#

Returns the reference associated to the index .

SBCReferenceToTarget * SBCReferenceIndexer::getReferenceToTarget (
    SBCReferenceTarget * referenceTarget
) const


function hasIndex [1/2]#

Returns true if the reference has an index.

bool SBCReferenceIndexer::hasIndex (
    SBCReferenceToTarget * referenceToTarget
) const


function hasIndex [2/2]#

Returns true if the reference has an index.

bool SBCReferenceIndexer::hasIndex (
    SBCReferenceTarget * referenceTarget
) const


function ~SBCReferenceIndexer#

virtual SBCReferenceIndexer::~SBCReferenceIndexer ()