|
CeresEngine 0.2.0
A game development framework
|
#include <CeresEngine/Foundation/Container/IndexedMultimap.hpp>
Public Types | |
| using | key_type = typename super::key_type |
| using | mapped_type = typename super::mapped_type |
| using | value_type = typename super::value_type |
| using | size_type = typename super::size_type |
| using | difference_type = typename super::difference_type |
| using | key_compare = typename super::key_compare |
| using | allocator_type = typename super::allocator_type |
| using | reference = typename super::reference |
| using | const_reference = typename super::const_reference |
| using | pointer = typename super::pointer |
| using | const_pointer = typename super::const_pointer |
| using | iterator = typename super::iterator |
| using | const_iterator = typename super::const_iterator |
| using | reverse_iterator = typename super::reverse_iterator |
| using | const_reverse_iterator = typename super::const_reverse_iterator |
Public Member Functions | |
| auto | keys () const |
| Gets a range that iterates over all the keys on the map. | |
| template<typename K = Key> | |
| auto | values (const K &key) const |
Gets a range that iterates over all values of the given key. | |
| template<typename K = Key> | |
| auto | values (const Key &key) |
Gets a range that iterates over all values of the given key. | |
| template<typename K = Key> | |
| mapped_type & | at (const K &key, size_t index) |
Gets the index-th value for the given key. | |
| template<typename K = Key> | |
| const mapped_type & | at (const K &key, size_t index) const |
Gets the index-th value for the given key. | |
| template<typename K = Key> | |
| bool | contains (const K &key, size_t index) const |
Returns true if the container contains an element at index with key equivalent to key, otherwise returns false. | |
| void | reserve (size_type newCapacity) |
| Tries to increase capacity by allocating additional memory. | |
| void | shrink_to_fit () |
| Tries to reduce memory usage by freeing unused memory. | |
| template<typename K = Key> | |
| void | resize (const K &key, size_type newSize, const Value &value=Value()) |
Resizes the container and ensures that there are exactly newSize items on the given key. | |
| template<typename K = Key> | |
| void | clear (const K &key) |
Clears all values of the given key. | |
| size_type | capacity () const |
| Returns the number of elements that the container has currently allocated space for. | |
| template<typename K = Key> | |
| size_type | size (const K &key) const |
Computes the number of elements for the given key. | |
| template<typename K = Key> | |
| iterator | erase (const K &key, size_type index) const |
Erases the element at the given index for the given key. | |
| template<typename K = Key, typename... Args> | |
| mapped_type & | emplace_back (const K &key, Args &&... args) |
Emplaces a new element for key at the end of container. | |
| template<typename K = Key> | |
| mapped_type & | push_back (const K &key, const Value &value) |
Pushes a new element for key at the end of container. | |
| template<typename K = Key> | |
| mapped_type & | push_back (const K &key, Value &&value) |
Pushes a new element for key at the end of container. | |
| template<typename K = Key> | |
| const mapped_type & | operator() (const K &key, size_type index) const |
| template<typename K = Key> | |
| mapped_type & | operator() (const K &key, size_type index) |
Static Public Attributes | |
| static constexpr bool | has_reserve = requires(super & container) { container.reserve(size_type()); } |
Determines if the container has the reserve() method available. | |
| static constexpr bool | has_shrink_to_fit = requires(super & container) { container.shrink_to_fit(); } |
Determines if the container has the shrink_to_fit() method available. | |
| static constexpr bool | has_capacity |
Determines if the container has the capacity() method available. | |
Private Types | |
| using | super = Container |
Private Member Functions | |
| template<typename K = Key> | |
| void | ensureSize (const K &key, size_type desiredSize) |
Ensures that the vector has a size of at least desiredSize on the given key. | |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::allocator_type = typename super::allocator_type |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::const_iterator = typename super::const_iterator |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::const_pointer = typename super::const_pointer |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::const_reference = typename super::const_reference |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::const_reverse_iterator = typename super::const_reverse_iterator |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::difference_type = typename super::difference_type |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::iterator = typename super::iterator |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::key_compare = typename super::key_compare |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::key_type = typename super::key_type |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::mapped_type = typename super::mapped_type |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::pointer = typename super::pointer |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::reference = typename super::reference |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::reverse_iterator = typename super::reverse_iterator |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::size_type = typename super::size_type |
|
private |
| using CeresEngine::BasicIndexedMultimap< Key, Value, Container >::value_type = typename super::value_type |
|
inline |
Gets the index-th value for the given key.
| key | The key to get the specified element at. |
| index | The index of the element to be fetched. |
(key, index).| std::out_of_range | if the container does not have an element with the specified key. |
| std::out_of_range | if !(index < size(key)). |
|
inline |
Gets the index-th value for the given key.
| key | The key to get the specified element at. |
| index | The index of the element to be fetched. |
(key, index).| std::out_of_range | if the container does not have an element with the specified key. |
| std::out_of_range | if !(index < size(key)). |
|
inline |
Returns the number of elements that the container has currently allocated space for.
|
inline |
Clears all values of the given key.
|
inline |
Returns true if the container contains an element at index with key equivalent to key, otherwise returns false.
|
inline |
Emplaces a new element for key at the end of container.
| key | The key to insert the element at. |
| args | The arguments to construct a new value with. |
|
inlineprivate |
Ensures that the vector has a size of at least desiredSize on the given key.
| key | The key to ensure the number of elements on. |
| desiredSize | The number of elements to ensure are present on key. |
|
inline |
Erases the element at the given index for the given key.
| key | The key to remove the element at. |
| index | The index to remove the element at. |
| std::out_of_range | if the container does not have an element with the specified key. |
| std::out_of_range | if !(index < size(key)). |
|
inline |
Gets a range that iterates over all the keys on the map.
Each key will only be iterated once, no matter how many values it has.
|
inline |
|
inline |
|
inline |
Pushes a new element for key at the end of container.
| key | The key to insert the element at. |
| value | The value to be inserted on the container. |
|
inline |
Pushes a new element for key at the end of container.
| key | The key to insert the element at. |
| value | The value to be inserted on the container. |
|
inline |
Tries to increase capacity by allocating additional memory.
If newCapacity > capacity(), the function allocates memory for new storage of capacity equal to the value of newCapacity, moves elements from old storage to new storage, and deallocates memory used by old storage. Otherwise the function does nothing.
This function does not change size of the container.
If the capacity is changed, all iterators and all references to the elements are invalidated. Otherwise, no iterators or references are invalidated.
|
inline |
Resizes the container and ensures that there are exactly newSize items on the given key.
If any new value must be created on the map, they will be initialized by constructing a copy of value.
| key | The key to resize the elements on. |
| newSize | The new size to set on the key. |
| value | The value to initialize any new value with. |
|
inline |
Tries to reduce memory usage by freeing unused memory.
|
inline |
Computes the number of elements for the given key.
|
inline |
Gets a range that iterates over all values of the given key.
|
inline |
Gets a range that iterates over all values of the given key.
|
staticconstexpr |
Determines if the container has the capacity() method available.
|
staticconstexpr |
Determines if the container has the reserve() method available.
|
staticconstexpr |
Determines if the container has the shrink_to_fit() method available.