BioDynaMo
v1.05.120-25dc9790
|
Go to the documentation of this file.
15 #ifndef CORE_CONTAINER_FLATMAP_H_
16 #define CORE_CONTAINER_FLATMAP_H_
27 template <
typename TKey,
typename TValue>
31 using Pair = std::pair<TKey, TValue>;
38 if (new_capacity >
size_) {
39 data_.resize(new_capacity);
49 const TValue&
at(
const TKey& key)
const {
52 Concat(
"Key (", key,
") not found in UnorderedFlatmap").c_str());
53 return data_.at(idx).second;
85 for (uint64_t i = 0; i <
size_; i++) {
86 if (
data_[i].first == key) {
99 for (uint64_t i = 0; i <
size_; i++) {
100 if (
data_[i].first == key) {
110 #endif // CORE_CONTAINER_FLATMAP_H_
uint64_t FindIndexConst(const TKey &key) const
UnorderedFlatmap()=default
void reserve(uint64_t new_capacity)
const Pair * ConstIterator
ConstIterator end() const
uint64_t FindIndex(const TKey &key)
const TValue & operator[](const TKey &key) const
ConstIterator find(const TKey &key) const
std::string Concat(const Args &... parts)
Concatenates all arguments into a string. Equivalent to streaming all arguments into a stringstream a...
Iterator find(const TKey &key)
TValue & operator[](const TKey &key)
std::vector< Pair > data_
std::pair< std::size_t, bdm::memory_manager_detail::PoolAllocator * > Pair
const TValue & at(const TKey &key) const
ConstIterator begin() const