template<typename Key, typename Value>
class uavcan::Map< Key, Value >
Slow but memory efficient KV container.
KV pairs will be allocated in the node's memory pool.
Please be aware that this container does not perform any speed optimizations to minimize memory footprint, so the complexity of most operations is O(N).
Type requirements: Both key and value must be copyable, assignable and default constructible. Key must implement a comparison operator. Key's default constructor must initialize the object into invalid state. Size of Key + Value + padding must not exceed MemPoolBlockSize.
Definition at line 33 of file map.hpp.
template<typename Key , typename Value >
template<typename Predicate >
const Key * uavcan::Map< Key, Value >::find |
( |
Predicate |
predicate | ) |
const |
Returns first entry where the predicate returns true. Predicate prototype: bool (const Key& key, const Value& value)
Definition at line 302 of file map.hpp.
template<typename Key , typename Value >
Returns a key-value pair located at the specified position from the beginning. Note that any insertion or deletion may greatly disturb internal ordering, so use with care. If index is greater than or equal the number of pairs, null pointer will be returned.
Definition at line 333 of file map.hpp.
template<typename Key , typename Value >
template<typename Predicate >
void uavcan::Map< Key, Value >::removeAllWhere |
( |
Predicate |
predicate | ) |
|
Removes entries where the predicate returns true. Predicate prototype: bool (Key& key, Value& value)
Definition at line 269 of file map.hpp.