MapBase0< COLLECTION, KEYTYPE, VALUETYPE, SUPER, HASH > Class Template Reference

#include <collection.h>

Inheritance diagram for MapBase0< COLLECTION, KEYTYPE, VALUETYPE, SUPER, HASH >:

Public Types

using MapType = COLLECTION
 
using Super = BaseCollection< COLLECTION, SUPER >
 
using KeyType = KEYTYPE
 
using ValueType = VALUETYPE
 
- Public Types inherited from BaseCollection< COLLECTION, SUPER >
using IsCollection = std::true_type
 
using IsBaseArray = std::false_type
 

Public Member Functions

template<typename... ARGS>
MAXON_ATTRIBUTE_FORCE_INLINE MapBase0 (ARGS &&... args)
 
MAXON_ATTRIBUTE_FORCE_INLINE Bool Contains (typename ByValueParam< KEYTYPE >::type key) const
 
template<typename PAIR >
MAXON_ATTRIBUTE_FORCE_INLINE SFINAEHelper< Bool, typename PAIR::KeyType >::type Contains (const PAIR &pair) const
 
ResultRef< VALUETYPE > Append (const KEYTYPE &key)
 
template<typename PAIR >
SFINAEHelper< ResultRef< VALUETYPE >, typename PAIR::KeyType >::type Append (const PAIR &pair)
 
template<typename COLLECTION2 >
Result< void > Add (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY)
 
template<typename COLLECTION2 >
Result< void > AppendAll (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY)
 
template<typename COLLECTION2 >
Result< void > AppendAllInverse (COLLECTION2 &&other)
 
template<typename COLLECTION2 >
Bool ContainsAllImpl (COLLECTION2 &&other, OverloadRank0) const
 
template<typename COLLECTION2 >
Result< void > SubtractImpl (COLLECTION2 &&other, OverloadRank0)
 
template<typename COLLECTION2 , typename COMPARE >
Bool IsEqualImpl (const COLLECTION2 &other, COMPARE &&cmp, OverloadRank0) const
 
HashInt GetHashCode () const
 
UniqueHash GetUniqueHashCode () const
 
- Public Member Functions inherited from BaseCollection< COLLECTION, SUPER >
template<typename... ARGS>
MAXON_ATTRIBUTE_FORCE_INLINE BaseCollection (ARGS &&... args)
 
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value, Bool >::type operator== (const COLLECTION2 &other) const
 
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value, Bool >::type operator!= (const COLLECTION2 &other) const
 
template<typename COMPARE = EqualityCompare, typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE std::enable_if< maxon::IsCollection< COLLECTION2 >::value &&!STD_IS_REPLACEMENT(same, typename std::decay< COMPARE >::type, EQUALITY), Bool >::type IsEqual (const COLLECTION2 &other, COMPARE &&cmp=COMPARE()) const
 
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Result< void > AppendAll (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY)
 
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Result< void > CopyFrom (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::FIT_TO_SIZE)
 
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Result< void > Subtract (COLLECTION2 &&other)
 
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Result< void > Intersect (const COLLECTION2 &other)
 
template<typename COLLECTION2 >
Bool Intersects (const COLLECTION2 &other) const
 
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Result< void > CopyFromImpl (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags, OverloadRank0)
 
template<typename COLLECTION2 >
Result< void > AppendAllImpl (COLLECTION2 &&other, COLLECTION_RESIZE_FLAGS resizeFlags, Bool overwrite, OverloadRank0)
 
template<typename COLLECTION2 >
Result< void > IntersectImpl (COLLECTION2 &&other, OverloadRank0)
 
MAXON_ATTRIBUTE_FORCE_INLINE Bool IsEmpty () const
 
MAXON_ATTRIBUTE_FORCE_INLINE Bool IsPopulated () const
 
String ToString (const FormatStatement *formatStatement=nullptr) const
 
template<typename COLLECTION2 >
MAXON_ATTRIBUTE_FORCE_INLINE Bool ContainsAll (COLLECTION2 &&other) const
 
template<typename COLLECTION2 >
Bool ContainsAllImpl (COLLECTION2 &&other, OverloadRank0) const
 

Static Public Member Functions

static const KEYTYPE & GetMapKey (const KEYTYPE &key)
 
template<typename PAIR >
static const KEYTYPE & GetMapKey (const PAIR &pair)
 

Static Public Attributes

static const COLLECTION_KIND KIND
 

Member Typedef Documentation

◆ MapType

using MapType = COLLECTION

◆ Super

using Super = BaseCollection<COLLECTION, SUPER>

◆ KeyType

using KeyType = KEYTYPE

◆ ValueType

using ValueType = VALUETYPE

Constructor & Destructor Documentation

◆ MapBase0()

MAXON_ATTRIBUTE_FORCE_INLINE MapBase0 ( ARGS &&...  args)
explicit

Member Function Documentation

◆ Contains() [1/2]

MAXON_ATTRIBUTE_FORCE_INLINE Bool Contains ( typename ByValueParam< KEYTYPE >::type  key) const

Returns true if key is contained in this map.

Parameters
[in]keyThe key to look for.
Returns
True if this map has an enty whose key equals key, false otherwise.

◆ Contains() [2/2]

MAXON_ATTRIBUTE_FORCE_INLINE SFINAEHelper<Bool, typename PAIR::KeyType>::type Contains ( const PAIR &  pair) const

Returns true if the key of pair is mapped to the value of pair in this map.

Parameters
[in]pairThe key-value-pair to look for.
Returns
True if this map has an enty which matches pair, false otherwise.

◆ GetMapKey() [1/2]

static const KEYTYPE& GetMapKey ( const KEYTYPE &  key)
static

◆ GetMapKey() [2/2]

static const KEYTYPE& GetMapKey ( const PAIR &  pair)
static

◆ Append() [1/2]

ResultRef<VALUETYPE> Append ( const KEYTYPE &  key)

◆ Append() [2/2]

SFINAEHelper<ResultRef<VALUETYPE>, typename PAIR::KeyType>::type Append ( const PAIR &  pair)

◆ Add()

Result<void> Add ( COLLECTION2 &&  other,
COLLECTION_RESIZE_FLAGS  resizeFlags = COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY 
)

Adds all key-value-mappings from other to this map. Existing entries will be kept, even those with a key contained in other. other has to be a data structure supported by AutoIterator (such as a HashMap or one of the array classes), and its values have to have GetKey() and GetValue() functions. If adding doesn't succeed for all entries, the map will be left in a valid, but intermediate state with only some entries from src added.

Parameters
[in]otherSource from which the entries are taken.
[in]resizeFlagsIf ON_GROW_FIT_TO_SIZE is set, the collection will use only as much memory as needed to hold the data.
Returns
True if adding succeeded.

◆ AppendAll()

Result<void> AppendAll ( COLLECTION2 &&  other,
COLLECTION_RESIZE_FLAGS  resizeFlags = COLLECTION_RESIZE_FLAGS::ON_GROW_RESERVE_CAPACITY 
)

Adds all key-value-mappings from other to this map. Existing entries will be overwritten if other has an entry with equal key. other has to be a data structure supported by AutoIterator (such as a HashMap or one of the array classes), and its values have to have GetKey() and GetValue() functions. If adding doesn't succeed for all entries, the map will be left in a valid, but intermediate state with only some entries from src added.

Parameters
[in]otherSource from which the entries are taken.
[in]resizeFlagsIf ON_GROW_FIT_TO_SIZE is set, the collection will use only as much memory as needed to hold the data.
Returns
True if adding succeeded.

◆ AppendAllInverse()

Result<void> AppendAllInverse ( COLLECTION2 &&  other)

Adds the inverse of all key-value-mappings from other to this map, i.e., the values will be used as keys and vice versa. Existing entries will be overwritten if other has values which equal existing keys. other has to be an iterable object where the values have GetKey() and GetValue() functions. If adding doesn't succeed for all entries, the map will be left in a valid, but intermediate state with only some entries from src added.

Parameters
[in]otherSource from which the entries are taken.
Returns
True if adding succeeded.

◆ ContainsAllImpl()

Bool ContainsAllImpl ( COLLECTION2 &&  other,
OverloadRank0   
) const

Returns true if this collection contains all elements from another collection other, i.e., if this collection is a superset of other.

Parameters
[in]otherAnother collection, may be a foreach iterator over which it will be iterated.
Returns
True if this collection contains all elements from other, false otherwise.

◆ SubtractImpl()

Result<void> SubtractImpl ( COLLECTION2 &&  other,
OverloadRank0   
)

◆ IsEqualImpl()

Bool IsEqualImpl ( const COLLECTION2 &  other,
COMPARE &&  cmp,
OverloadRank0   
) const

◆ GetHashCode()

HashInt GetHashCode ( ) const

◆ GetUniqueHashCode()

UniqueHash GetUniqueHashCode ( ) const

Member Data Documentation

◆ KIND

const COLLECTION_KIND KIND
static