26 #include <l4/cxx/std_alloc> 27 #include <l4/cxx/std_ops> 35 template<
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; }
53 template<
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> >
91 Avl_map(Node_allocator
const &alloc = Node_allocator())
118 Data_type
const &operator [] (Key_type
const &key)
const 119 {
return this->find_node(key)->second; }
130 Data_type &operator [] (Key_type
const &key)
132 Node n = this->find_node(key);
134 return const_cast<Data_type&
>(n->second);
136 return insert(key, Data_type()).first->second;
cxx::Pair< Iterator, int > insert(Key_type const &key, Data_type const &data)
Insert a <key, data> pair into the map.
Avl_set_iter< _Node, Item_type, Fwd > Iterator
Forward iterator for the set.
Base_type::Node Node
Return type for find.
ALLOC< _Node > Node_allocator
Type for the node allocator.
COMPARE< KEY_TYPE > Key_compare
Type of the comparison functor.
A smart pointer to a tree item.
AVL tree based associative container.
Avl_set_iter< _Node, Item_type, Rev > Rev_iterator
Backward iterator for the set.
Internal: AVL set with internally managed nodes.
Avl_map(Node_allocator const &alloc=Node_allocator())
Create an empty AVL-tree based map.
Avl_set_iter< _Node, Const_item_type, Rev > Const_rev_iterator
Constant backward iterator for the set.
Generic comparator class that defaults to the less-than operator.
KEY_TYPE Key_type
Type of the key values.
Base_type::Node_allocator Node_allocator
Type of the allocator.
DATA_TYPE Data_type
Type of the data values.
Avl_set_iter< _Node, Const_item_type, Fwd > Const_iterator
Constant forward iterator for the set.
Standard allocator based on operator new () .