|
UMPIRE
Umpire: resource management and provision
|
A fast replacement for std::map<void*,Value> for a generic Value. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/umpire/checkouts/develop/src/umpire/util/MemoryMap.hpp>

Classes | |
| class | Iterator_ |
Public Types | |
| using | Key = void * |
| using | Value = V |
| using | KeyValuePair = std::pair< Key, Value * > |
| using | Iterator = Iterator_< false > |
| using | ConstIterator = Iterator_< true > |
Public Member Functions | |
| MemoryMap () | |
| ~MemoryMap () | |
| MemoryMap (const MemoryMap &)=delete | |
| std::pair< Iterator, bool > | insert (Key ptr, const Value &val) noexcept |
| Insert Value at ptr in the map if ptr does not exist. Uses copy constructor on Value once. More... | |
| template<typename P > | |
| std::pair< Iterator, bool > | insert (P &&pair) noexcept |
| Insert a key-value pair if pair.first does not exist as a key. Must have first and second fields. Calls the first version. More... | |
| template<typename... Args> | |
| std::pair< Iterator, bool > | insert (Key ptr, Args &&... args) noexcept |
| Emplaces a new value at ptr in the map, forwarding args to the placement new constructor. More... | |
| Iterator | findOrBefore (Key ptr) noexcept |
| Find a value at ptr. More... | |
| ConstIterator | findOrBefore (Key ptr) const noexcept |
| Iterator | find (Key ptr) noexcept |
| Find a value at ptr. More... | |
| ConstIterator | find (Key ptr) const noexcept |
| ConstIterator | begin () const |
| Iterator to first value or end() if empty. More... | |
| Iterator | begin () |
| ConstIterator | end () const |
| Iterator to one-past-last value. More... | |
| Iterator | end () |
| void | erase (Key ptr) |
| Remove an entry from the map. More... | |
| void | erase (Iterator iter) |
| void | erase (ConstIterator oter) |
| void | removeLast () |
| Remove/deallocate the last found entry. More... | |
| void | clear () noexcept |
| Clear all entris from the map. More... | |
| std::size_t | size () const noexcept |
| Return number of entries in the map. More... | |
| std::size_t | judyMemoryUsage () const noexcept |
| std::size_t | poolMemoryUsage () const noexcept |
| template<typename... Args> | |
| std::pair< typename MemoryMap< V >::Iterator, bool > | doInsert (Key ptr, Args &&... args) noexcept |
| template<typename P > | |
| std::pair< typename MemoryMap< V >::Iterator, bool > | insert (P &&pair) noexcept |
| template<typename... Args> | |
| std::pair< typename MemoryMap< V >::Iterator, bool > | insert (Key ptr, Args &&... args) noexcept |
Friends | |
| template<bool Const> | |
| class | Iterator_ |
A fast replacement for std::map<void*,Value> for a generic Value.
This uses FixedMallocPool and Judy arrays and provides forward const and non-const iterators.
| using umpire::util::MemoryMap< V >::Key = void* |
| using umpire::util::MemoryMap< V >::Value = V |
| using umpire::util::MemoryMap< V >::KeyValuePair = std::pair<Key, Value*> |
| using umpire::util::MemoryMap< V >::Iterator = Iterator_<false> |
| using umpire::util::MemoryMap< V >::ConstIterator = Iterator_<true> |
| umpire::util::MemoryMap< V >::MemoryMap |
| umpire::util::MemoryMap< V >::~MemoryMap |
|
delete |
|
noexcept |
Insert Value at ptr in the map if ptr does not exist. Uses copy constructor on Value once.
References umpire::util::message::Debug, and UMPIRE_LOG.
Referenced by umpire::resource::FileMemoryResource::allocate(), umpire::resource::NullMemoryResource::allocate(), and umpire::util::AllocationMap::insert().
|
noexcept |
Insert a key-value pair if pair.first does not exist as a key. Must have first and second fields. Calls the first version.
|
noexcept |
Emplaces a new value at ptr in the map, forwarding args to the placement new constructor.
|
noexcept |
Find a value at ptr.
|
noexcept |
|
noexcept |
Find a value at ptr.
Referenced by umpire::resource::FileMemoryResource::deallocate(), umpire::resource::NullMemoryResource::deallocate(), and umpire::util::AllocationMap::remove().
|
noexcept |
| MemoryMap< V >::ConstIterator umpire::util::MemoryMap< V >::begin |
Iterator to first value or end() if empty.
| MemoryMap< V >::Iterator umpire::util::MemoryMap< V >::begin |
| MemoryMap< V >::ConstIterator umpire::util::MemoryMap< V >::end |
Iterator to one-past-last value.
| MemoryMap< V >::Iterator umpire::util::MemoryMap< V >::end |
| void umpire::util::MemoryMap< V >::erase | ( | Key | ptr | ) |
Remove an entry from the map.
References umpire::util::message::Debug, and UMPIRE_LOG.
Referenced by umpire::resource::FileMemoryResource::deallocate(), and umpire::resource::NullMemoryResource::deallocate().
| void umpire::util::MemoryMap< V >::erase | ( | Iterator | iter | ) |
| void umpire::util::MemoryMap< V >::erase | ( | ConstIterator | oter | ) |
| void umpire::util::MemoryMap< V >::removeLast |
Remove/deallocate the last found entry.
WARNING: Use this with caution, only directly after using a method above. erase(Key) is safer, but requires an additional lookup.
References umpire::util::message::Debug, UMPIRE_ASSERT, and UMPIRE_LOG.
Referenced by umpire::util::AllocationMap::remove().
|
noexcept |
Clear all entris from the map.
Referenced by umpire::util::AllocationMap::clear().
|
noexcept |
Return number of entries in the map.
|
noexcept |
Referenced by umpire::util::AllocationMap::internalMemoryUsage().
|
noexcept |
Referenced by umpire::util::AllocationMap::internalMemoryUsage().
|
noexcept |
References UMPIRE_ASSERT.
|
noexcept |
|
noexcept |
References umpire::util::message::Debug, and UMPIRE_LOG.