Murl::IndexBase< KeyType, ArrayType, HashFunc > Class Template Reference

A generic index template base class. More...

#include "murl_index_base.h"

Inheritance diagram for Murl::IndexBase< KeyType, ArrayType, HashFunc >:

Public Types

typedef ArrayType::ConstIterator ConstIterator
 Definition of the const iterator.
 

Public Member Functions

void Clear ()
 Clear the index object and remove the underlying storage.
 
void ClearIndex ()
 Clear the hash index.
 
void Empty ()
 Empty the index object, but keep the underlying storage.
 
void RebuildHash (SInt32 n)
 Clear and rebuild the hash index for a given number of items. More...
 
void RebuildHash ()
 Clear and rebuild the hash index.
 
void Shrink ()
 Shrink the index object so that the underlying storage is only as large as necessary.
 
void Trim (SInt32 n)
 Reduce the index object to a given number of items. More...
 
void Drop (SInt32 n=1)
 Reduce the index object by removing a given number of items from the end. More...
 
void Reserve (SInt32 n)
 Reserve storage space. More...
 
void Unlink (SInt32 index)
 Unlink the item at a given index. More...
 
SInt32 UnlinkKey (const KeyType &key)
 Unlink all items matching a given key. More...
 
SInt32 UnlinkKey (const KeyType &key, UInt32 hash)
 Unlink all items matching a given key, using a precalculated hash value. More...
 
Bool IsUnlinked (SInt32 index) const
 Check if the item at a given index is unlinked. More...
 
SInt32Array GetUnlinked () const
 Get an array of indices of all unlinked items. More...
 
void Sweep ()
 Remove all unlinked items from the index.
 
KeyType & Set (SInt32 index, const KeyType &key, UInt32 hash)
 Replace the item at a specified index using a precomputed hash. More...
 
KeyType & Set (SInt32 index, const KeyType &key)
 Replace the item at a specified index. More...
 
KeyType & Add (const KeyType &key, UInt32 hash)
 Add an item with a precomputed hash value. More...
 
KeyType & Add (const KeyType &key)
 Add an item. More...
 
SInt32 Put (const KeyType &key, UInt32 hash)
 Add an item or replace an unlinked item if present, using a precomputed hash value. More...
 
SInt32 Put (const KeyType &key)
 Add an item or replace an unlinked item if present. More...
 
SInt32 FindAdd (const KeyType &key, UInt32 hash)
 Find the first occurrence of a given item in the index, or add an item if the item was not found, using a precomputed hash value. More...
 
SInt32 FindAdd (const KeyType &key)
 Find the first occurrence of a given item in the index, or add an item if the item was not found. More...
 
SInt32 FindPut (const KeyType &key, UInt32 hash)
 Find the first occurrence of a given item or add the item if the item was not found, using a precomputed hash value. More...
 
SInt32 FindPut (const KeyType &key)
 Find the first occurrence of a given item or put the item if the item was not found. More...
 
SInt32 Find (const KeyType &key, UInt32 hash) const
 Find the first occurrence of a given item using a precomputed hash value. More...
 
SInt32 Find (const KeyType &key) const
 Find the first occurrence of a given item. More...
 
SInt32 FindNext (SInt32 index) const
 Find the next occurrence of an item that is specified by a given index. More...
 
SInt32 FindPrev (SInt32 index) const
 Find the previous occurrence of an item that is specified by a given index. More...
 
SInt32 FindLast (const KeyType &key, UInt32 hash) const
 Find the last occurrence of a given item, using a precomputed hash value. More...
 
SInt32 FindLast (const KeyType &key) const
 Find the last occurrence of a given item. More...
 
KeyType & Insert (SInt32 index, const KeyType &key, UInt32 hash)
 Insert an item at a given position, using a precomputed hash value. More...
 
KeyType & Insert (SInt32 index, const KeyType &key)
 Insert an item at a given position. More...
 
void Remove (SInt32 index)
 Remove the item at a given position. More...
 
void Remove (SInt32 index, SInt32 count)
 Remove a number of items at a given starting position. More...
 
void Remove (const SInt32 *sortedIndices, SInt32 count)
 Remove a number of items at given positions. More...
 
void Remove (const SInt32Array &sortedIndices)
 Remove a number of items at given positions. More...
 
SInt32 RemoveKey (const KeyType &key, UInt32 hash)
 Remove all items that match a given item, using a precomputed hash value. More...
 
SInt32 RemoveKey (const KeyType &key)
 Remove all items that match a given item. More...
 
const KeyType & Bottom () const
 Get a reference to the first item. More...
 
const KeyType & Top () const
 Get a reference to the last item. More...
 
Bool IsIndexValid (SInt32 index) const
 Check if a given index is a valid index. More...
 
const KeyType & operator[] (SInt32 index) const
 Get a const reference to the item at a given index. More...
 
const KeyType & Get (SInt32 index) const
 Get a const reference to the item at a given index. More...
 
SInt32 GetAlloc () const
 Get the number of actually allocated items. More...
 
SInt32 GetCount () const
 Get the number of items. More...
 
Bool IsEmpty () const
 Check if the Index is empty. More...
 
const ArrayType & GetKeys () const
 Get a const reference to the array of items. More...
 
void Swap (IndexBase &other)
 Exchange the content of the index object with a given second one. More...
 
ConstIterator Begin () const
 Get the const iterator to the first item. More...
 
ConstIterator End () const
 Get the const iterator next to the last item. More...
 
ConstIterator GetIter (SInt32 index) const
 Get the const iterator of a specified index. More...
 
SInt32 GetIterIndex (ConstIterator iterator) const
 Get the item index by iterator. More...
 
UInt32 CalculateHash (const KeyType &key) const
 Calculate the hash for an item. More...
 
Bool IsEqual (const IndexBase &other) const
 Compare the index to another one. More...
 
bool operator== (const IndexBase &rhs) const
 The "equal to" comparison operator, calls IsEqual(). More...
 
bool operator!= (const IndexBase &rhs) const
 The "not equal to" comparison operator, calls IsEqual(). More...
 

Detailed Description

template<class KeyType, class ArrayType, class HashFunc>
class Murl::IndexBase< KeyType, ArrayType, HashFunc >

A generic index template base class.

The index class stores a number of (not necessarily unique) keys in a hash table.
This is the base class of the Index and ObjectIndex class.
This class is based on the NTL AIndex container, see http://www.ultimatepp.org

Template Parameters
KeyTypeThe key's data type of the index.
ArrayTypeThe array type of the keys.
HashFuncThe hash function of the key.

Member Function Documentation

◆ RebuildHash()

template<class KeyType, class ArrayType, class HashFunc>
void Murl::IndexBase< KeyType, ArrayType, HashFunc >::RebuildHash ( SInt32  n)
inline

Clear and rebuild the hash index for a given number of items.

Parameters
nThe number of items to rebuild.

◆ Trim()

template<class KeyType, class ArrayType, class HashFunc>
void Murl::IndexBase< KeyType, ArrayType, HashFunc >::Trim ( SInt32  n)
inline

Reduce the index object to a given number of items.

Parameters
nThe new number of items in the index, must be smaller than the current item count.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::Trim().

◆ Drop()

template<class KeyType, class ArrayType, class HashFunc>
void Murl::IndexBase< KeyType, ArrayType, HashFunc >::Drop ( SInt32  n = 1)
inline

Reduce the index object by removing a given number of items from the end.

Parameters
nThe number of items to remove from the end.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::Drop().

◆ Reserve()

template<class KeyType, class ArrayType, class HashFunc>
void Murl::IndexBase< KeyType, ArrayType, HashFunc >::Reserve ( SInt32  n)
inline

Reserve storage space.

If the given size is less than the actual size, nothing is done.

Parameters
nThe number of items the underlying storage should hold.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::Reserve().

◆ Unlink()

template<class KeyType, class ArrayType, class HashFunc>
void Murl::IndexBase< KeyType, ArrayType, HashFunc >::Unlink ( SInt32  index)
inline

Unlink the item at a given index.

Unlinked items remain in the Index, but are ignored by any search operations.

Parameters
indexThe index of the item to unlink.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::Unlink().

◆ UnlinkKey() [1/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::UnlinkKey ( const KeyType &  key)
inline

Unlink all items matching a given key.

Unlinked items remain in the Index, but are ignored by any search operations.

Parameters
keyThe key of the item(s) to unlink.
Returns
The number of items that were unlinked.

Referenced by Murl::IndexBase< KeyType, ObjectArray< KeyType >, HashFunc >::UnlinkKey(), and Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::UnlinkKey().

◆ UnlinkKey() [2/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::UnlinkKey ( const KeyType &  key,
UInt32  hash 
)
inline

Unlink all items matching a given key, using a precalculated hash value.

Unlinked items remain in the Index, but are ignored by any search operations.

Parameters
keyThe key of the item(s) to unlink.
hashThe precalculated hash value.
Returns
The number of items that were unlinked.

◆ IsUnlinked()

template<class KeyType, class ArrayType, class HashFunc>
Bool Murl::IndexBase< KeyType, ArrayType, HashFunc >::IsUnlinked ( SInt32  index) const
inline

Check if the item at a given index is unlinked.

Parameters
indexThe index of the item to check.
Returns
true if the specified item is unlinked.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::IsUnlinked().

◆ GetUnlinked()

template<class KeyType, class ArrayType, class HashFunc>
SInt32Array Murl::IndexBase< KeyType, ArrayType, HashFunc >::GetUnlinked ( ) const
inline

Get an array of indices of all unlinked items.

Returns
The array of indices.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::Sweep().

◆ Set() [1/2]

template<class KeyType, class ArrayType, class HashFunc>
KeyType& Murl::IndexBase< KeyType, ArrayType, HashFunc >::Set ( SInt32  index,
const KeyType &  key,
UInt32  hash 
)
inline

Replace the item at a specified index using a precomputed hash.

Parameters
indexThe index to set.
keyThe value to set.
hashThe precomputed hash.
Returns
A reference to the set item.

Referenced by Murl::IndexBase< KeyType, ObjectArray< KeyType >, HashFunc >::Set(), and Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::SetKey().

◆ Set() [2/2]

template<class KeyType, class ArrayType, class HashFunc>
KeyType& Murl::IndexBase< KeyType, ArrayType, HashFunc >::Set ( SInt32  index,
const KeyType &  key 
)
inline

Replace the item at a specified index.

Parameters
indexThe index to set.
keyThe value to set.
Returns
A reference to the set item.

◆ Add() [1/2]

◆ Add() [2/2]

template<class KeyType, class ArrayType, class HashFunc>
KeyType& Murl::IndexBase< KeyType, ArrayType, HashFunc >::Add ( const KeyType &  key)
inline

Add an item.

Parameters
keyThe item to add.
Returns
A reference to the added item.

◆ Put() [1/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::Put ( const KeyType &  key,
UInt32  hash 
)
inline

◆ Put() [2/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::Put ( const KeyType &  key)
inline

Add an item or replace an unlinked item if present.

Parameters
keyThe item to add.
Returns
The index of the item.

◆ FindAdd() [1/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::FindAdd ( const KeyType &  key,
UInt32  hash 
)
inline

Find the first occurrence of a given item in the index, or add an item if the item was not found, using a precomputed hash value.

Parameters
keyThe item to search for and add.
hashThe precomputed hash.
Returns
The index of the item.

Referenced by Murl::IndexBase< KeyType, ObjectArray< KeyType >, HashFunc >::FindAdd().

◆ FindAdd() [2/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::FindAdd ( const KeyType &  key)
inline

Find the first occurrence of a given item in the index, or add an item if the item was not found.

Parameters
keyThe item to search for and add.
Returns
The index of the item.

◆ FindPut() [1/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::FindPut ( const KeyType &  key,
UInt32  hash 
)
inline

Find the first occurrence of a given item or add the item if the item was not found, using a precomputed hash value.

Hereby replacing an unlinked element if possible.

Parameters
keyThe item to search for and add.
hashThe precomputed hash.
Returns
The index of the item.

Referenced by Murl::IndexBase< KeyType, ObjectArray< KeyType >, HashFunc >::FindPut().

◆ FindPut() [2/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::FindPut ( const KeyType &  key)
inline

Find the first occurrence of a given item or put the item if the item was not found.

Hereby replacing an unlinked element if possible.

Parameters
keyThe item to search for and add.
Returns
The index of the item.

◆ Find() [1/2]

◆ Find() [2/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::Find ( const KeyType &  key) const
inline

Find the first occurrence of a given item.

Parameters
keyThe item to search for.
Returns
The index of the item, or -1 if not found.

◆ FindNext()

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::FindNext ( SInt32  index) const
inline

Find the next occurrence of an item that is specified by a given index.

Parameters
indexThe index of the item containing the key to search for.
Returns
The index of the next item, or -1 if not found.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::FindNext(), and Murl::IndexBase< KeyType, ObjectArray< KeyType >, HashFunc >::RemoveKey().

◆ FindPrev()

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::FindPrev ( SInt32  index) const
inline

Find the previous occurrence of an item that is specified by a given index.

Parameters
indexThe index of the item containing the key to search for.
Returns
The index of the previous item, or -1 if not found.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::FindPrev().

◆ FindLast() [1/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::FindLast ( const KeyType &  key,
UInt32  hash 
) const
inline

Find the last occurrence of a given item, using a precomputed hash value.

Parameters
keyThe item to search for.
hashThe precomputed hash value.
Returns
The index of the item, or -1 if not found.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::FindLast(), and Murl::IndexBase< KeyType, ObjectArray< KeyType >, HashFunc >::FindLast().

◆ FindLast() [2/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::FindLast ( const KeyType &  key) const
inline

Find the last occurrence of a given item.

Parameters
keyThe item to search for.
Returns
The index of the item, or -1 if not found.

◆ Insert() [1/2]

template<class KeyType, class ArrayType, class HashFunc>
KeyType& Murl::IndexBase< KeyType, ArrayType, HashFunc >::Insert ( SInt32  index,
const KeyType &  key,
UInt32  hash 
)
inline

Insert an item at a given position, using a precomputed hash value.

Parameters
indexThe index where to insert the item.
keyThe item to insert.
hashThe precomputed hash value.
Returns
A reference to the inserted item.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::Insert().

◆ Insert() [2/2]

template<class KeyType, class ArrayType, class HashFunc>
KeyType& Murl::IndexBase< KeyType, ArrayType, HashFunc >::Insert ( SInt32  index,
const KeyType &  key 
)
inline

Insert an item at a given position.

Parameters
indexThe index where to insert the item.
keyThe item to insert.
Returns
A reference to the inserted item.

◆ Remove() [1/4]

◆ Remove() [2/4]

template<class KeyType, class ArrayType, class HashFunc>
void Murl::IndexBase< KeyType, ArrayType, HashFunc >::Remove ( SInt32  index,
SInt32  count 
)
inline

Remove a number of items at a given starting position.

Parameters
indexThe index from where to start removing the items.
countThe number of subsequent items to remove.

◆ Remove() [3/4]

template<class KeyType, class ArrayType, class HashFunc>
void Murl::IndexBase< KeyType, ArrayType, HashFunc >::Remove ( const SInt32 sortedIndices,
SInt32  count 
)
inline

Remove a number of items at given positions.

Parameters
sortedIndicesA pointer to sorted indices where to remove the items.
countThe number of items to remove, i.e. the number of indices.

◆ Remove() [4/4]

template<class KeyType, class ArrayType, class HashFunc>
void Murl::IndexBase< KeyType, ArrayType, HashFunc >::Remove ( const SInt32Array sortedIndices)
inline

Remove a number of items at given positions.

Parameters
sortedIndicesA sorted array of indices where to remove the items.

◆ RemoveKey() [1/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::RemoveKey ( const KeyType &  key,
UInt32  hash 
)
inline

Remove all items that match a given item, using a precomputed hash value.

Parameters
keyThe item to remove.
hashThe precomputed hash value.
Returns
The number of items that were removed.

Referenced by Murl::IndexBase< KeyType, ObjectArray< KeyType >, HashFunc >::RemoveKey().

◆ RemoveKey() [2/2]

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::RemoveKey ( const KeyType &  key)
inline

Remove all items that match a given item.

Parameters
keyThe item to remove.
Returns
The number of items that were removed.

◆ Bottom()

template<class KeyType, class ArrayType, class HashFunc>
const KeyType& Murl::IndexBase< KeyType, ArrayType, HashFunc >::Bottom ( ) const
inline

Get a reference to the first item.

Returns
A reference to the first item.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::BottomKey().

◆ Top()

template<class KeyType, class ArrayType, class HashFunc>
const KeyType& Murl::IndexBase< KeyType, ArrayType, HashFunc >::Top ( ) const
inline

Get a reference to the last item.

Returns
A reference to the last item.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::TopKey().

◆ IsIndexValid()

template<class KeyType, class ArrayType, class HashFunc>
Bool Murl::IndexBase< KeyType, ArrayType, HashFunc >::IsIndexValid ( SInt32  index) const
inline

Check if a given index is a valid index.

Parameters
indexThe index to check.
Returns
true if index >= 0 and index < GetCount().

◆ operator[]()

template<class KeyType, class ArrayType, class HashFunc>
const KeyType& Murl::IndexBase< KeyType, ArrayType, HashFunc >::operator[] ( SInt32  index) const
inline

Get a const reference to the item at a given index.

If the index is out of range, the behaviour is undefined.

Parameters
indexThe index of the item to retrieve.
Returns
A const reference to the requested item.

◆ Get()

template<class KeyType, class ArrayType, class HashFunc>
const KeyType& Murl::IndexBase< KeyType, ArrayType, HashFunc >::Get ( SInt32  index) const
inline

Get a const reference to the item at a given index.

If the index is out of range, the behaviour is undefined.

Parameters
indexThe index of the item to retrieve.
Returns
A const reference to the requested item.

◆ GetAlloc()

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::GetAlloc ( ) const
inline

Get the number of actually allocated items.

Returns
The number of allocated items.

◆ GetCount()

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::GetCount ( ) const
inline

Get the number of items.

Returns
The number of items.

◆ IsEmpty()

template<class KeyType, class ArrayType, class HashFunc>
Bool Murl::IndexBase< KeyType, ArrayType, HashFunc >::IsEmpty ( ) const
inline

Check if the Index is empty.

Returns
true if the Index is empty, false otherwise.

◆ GetKeys()

template<class KeyType, class ArrayType, class HashFunc>
const ArrayType& Murl::IndexBase< KeyType, ArrayType, HashFunc >::GetKeys ( ) const
inline

Get a const reference to the array of items.

Returns
A const reference to the underlying item storage array.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::GetKeys().

◆ Swap()

template<class KeyType, class ArrayType, class HashFunc>
void Murl::IndexBase< KeyType, ArrayType, HashFunc >::Swap ( IndexBase< KeyType, ArrayType, HashFunc > &  other)
inline

Exchange the content of the index object with a given second one.

Parameters
otherThe second index object.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::Swap().

◆ Begin()

template<class KeyType, class ArrayType, class HashFunc>
ConstIterator Murl::IndexBase< KeyType, ArrayType, HashFunc >::Begin ( ) const
inline

Get the const iterator to the first item.

Returns
The const iterator to the first item.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::KeyBegin().

◆ End()

template<class KeyType, class ArrayType, class HashFunc>
ConstIterator Murl::IndexBase< KeyType, ArrayType, HashFunc >::End ( ) const
inline

Get the const iterator next to the last item.

Returns
The const iterator next to the last item.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::KeyEnd().

◆ GetIter()

template<class KeyType, class ArrayType, class HashFunc>
ConstIterator Murl::IndexBase< KeyType, ArrayType, HashFunc >::GetIter ( SInt32  index) const
inline

Get the const iterator of a specified index.

Parameters
indexThe index for the iterator.
Returns
The const iterator or null if the index is out of range.

Referenced by Murl::MapBase< Murl::String, SystemFontDescriptor *, Array< SystemFontDescriptor * >, StdHash< Murl::String > >::KeyGetIter().

◆ GetIterIndex()

template<class KeyType, class ArrayType, class HashFunc>
SInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::GetIterIndex ( ConstIterator  iterator) const
inline

Get the item index by iterator.

(!) Adding or removing items will invalidate iterators.

Parameters
iteratorThe iterator of the item.
Returns
The index of the item, or -1 if the iterator is invalid.

◆ CalculateHash()

template<class KeyType, class ArrayType, class HashFunc>
UInt32 Murl::IndexBase< KeyType, ArrayType, HashFunc >::CalculateHash ( const KeyType &  key) const
inline

◆ IsEqual()

template<class KeyType, class ArrayType, class HashFunc>
Bool Murl::IndexBase< KeyType, ArrayType, HashFunc >::IsEqual ( const IndexBase< KeyType, ArrayType, HashFunc > &  other) const
inline

Compare the index to another one.

Parameters
otherThe index to compare.
Returns
true if all keys have identical contents.

Referenced by Murl::IndexBase< KeyType, ObjectArray< KeyType >, HashFunc >::operator!=(), and Murl::IndexBase< KeyType, ObjectArray< KeyType >, HashFunc >::operator==().

◆ operator==()

template<class KeyType, class ArrayType, class HashFunc>
bool Murl::IndexBase< KeyType, ArrayType, HashFunc >::operator== ( const IndexBase< KeyType, ArrayType, HashFunc > &  rhs) const
inline

The "equal to" comparison operator, calls IsEqual().

Parameters
rhsThe right hand side index to compare.
Returns
true if all keys have identical contents.

◆ operator!=()

template<class KeyType, class ArrayType, class HashFunc>
bool Murl::IndexBase< KeyType, ArrayType, HashFunc >::operator!= ( const IndexBase< KeyType, ArrayType, HashFunc > &  rhs) const
inline

The "not equal to" comparison operator, calls IsEqual().

Parameters
rhsThe right hand side index to compare.
Returns
true if the indices differ.

The documentation for this class was generated from the following file:
  • murl_index_base.h


Copyright © 2011-2018 Spraylight GmbH.