ACF $AcfVersion:0$
TIMap.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QSet>
7
8// ACF includes
9#include <istd/IPolymorphic.h>
10
11
12namespace istd
13{
14
15
19template <typename Key, typename Value>
20class TIMap: virtual public IPolymorphic
21{
22public:
23 typedef Key KeyType;
24 typedef Value ValueType;
25 typedef QSet<KeyType> Keys;
26
30 virtual int GetElementsCount() const = 0;
31
36 virtual ValueType& operator[](const KeyType& key) = 0;
37
42 virtual const ValueType& operator[](const KeyType& key) const = 0;
43
47 virtual int FindIndex(const KeyType& key) const = 0;
48
53 virtual const ValueType* FindElement(const KeyType& key) const = 0;
54
59 virtual void GetKeys(Keys& result, bool doAppend = false) const = 0;
60
64 virtual const KeyType& GetKeyAt(int index) const = 0;
65
69 virtual const ValueType& GetValueAt(int index) const = 0;
70};
71
72
73};
74
75
76
77
Base interface for all used interfaces and implementations.
Generic interface for a key/value mapping.
Definition TIMap.h:21
QSet< KeyType > Keys
Definition TIMap.h:25
virtual void GetKeys(Keys &result, bool doAppend=false) const =0
Get list of keys stored in this map.
virtual int GetElementsCount() const =0
Get number of elements.
virtual int FindIndex(const KeyType &key) const =0
Find index index of specified key.
Value ValueType
Definition TIMap.h:24
virtual const ValueType & GetValueAt(int index) const =0
Get mapped value at specified index.
virtual const ValueType & operator[](const KeyType &key) const =0
Element access operator.
virtual ValueType & operator[](const KeyType &key)=0
Element access operator.
virtual const KeyType & GetKeyAt(int index) const =0
Get key value at specified index.
Key KeyType
Definition TIMap.h:23
virtual const ValueType * FindElement(const KeyType &key) const =0
Find value element associated with specified key.
Standard library.
Definition IComponent.h:17