26#include <l4/cxx/std_alloc>
27#include <l4/cxx/std_ops>
35template<
typename KEY_TYPE>
38 typedef KEY_TYPE Key_type;
39 template<
typename NODE>
40 static Key_type
const &key_of(NODE
const *n)
41 {
return n->item.first; }
53template<
typename KEY_TYPE,
typename DATA_TYPE,
54 template<
typename A>
class COMPARE =
Lt_functor,
58 COMPARE<KEY_TYPE>, ALLOC,
59 Bits::Avl_map_get_key<KEY_TYPE> >
113 template<
typename... Args>
115 {
return Base_type::emplace(cxx::forward<Args>(args)...); }
138 return const_cast<Data_type&
>(n->second);
AVL tree based associative container.
KEY_TYPE Key_type
Type of the key values.
Avl_map(Node_allocator const &alloc=Node_allocator())
Create an empty AVL-tree based map.
COMPARE< KEY_TYPE > Key_compare
Type of the comparison functor.
Base_type::Node Node
Return type for find.
Base_type::Node_allocator Node_allocator
Type of the allocator.
cxx::Pair< Iterator, int > insert(Key_type const &key, Data_type const &data)
Insert a <key, data> pair into the map.
DATA_TYPE Data_type
Type of the data values.
Data_type const & operator[](Key_type const &key) const
Get the data for the given key.
A smart pointer to a tree item.
Internal: AVL set with internally managed nodes.
Avl_set_iter< _Node, Item_type, Fwd > Iterator
Forward iterator for the set.
Node find_node(Key_type const &item) const
Lookup a node equal to item.
Avl_set_iter< _Node, Item_type, Rev > Rev_iterator
Backward iterator for the set.
ALLOC< _Node > Node_allocator
Type for the node allocator.
Avl_set_iter< _Node, Const_item_type, Rev > Const_rev_iterator
Constant backward iterator for the set.
cxx::Pair< Iterator, int > insert(Item_type const &item)
Insert an item into the set.
Avl_set_iter< _Node, Const_item_type, Fwd > Const_iterator
Constant forward iterator for the set.
Standard allocator based on operator new () .
Generic comparator class that defaults to the less-than operator.