00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00030 #ifndef __CLAW_AVL_HPP__
00031 #define __CLAW_AVL_HPP__
00032
00033 #include <claw/avl_base.hpp>
00034
00035 namespace claw
00036 {
00037
00042 template < class K, class Comp = std::less<K> >
00043 class avl
00044 {
00045 private:
00046 typedef avl_base<K, Comp> impl_type;
00047
00048 public:
00049 typedef K value_type;
00050 typedef K key_type;
00051 typedef K referent_type;
00052 typedef Comp key_less;
00053 typedef const K& const_reference;
00054 typedef typename impl_type::avl_const_iterator const_iterator;
00055
00056 public:
00057 avl();
00058 explicit avl( const avl<K, Comp>& that );
00059 template<typename InputIterator>
00060 avl( InputIterator first, InputIterator last );
00061
00062 void insert( const K& key );
00063 template<typename InputIterator>
00064 void insert( InputIterator first, InputIterator last );
00065
00066 void erase( const K& key );
00067 void clear();
00068
00069 unsigned int size() const;
00070 bool empty() const;
00071
00072 const_iterator begin() const;
00073 const_iterator end() const;
00074 const_iterator find( const K& key ) const;
00075 const_iterator find_nearest_greater( const K& key ) const;
00076 const_iterator find_nearest_lower( const K& key ) const;
00077 const_iterator lower_bound() const;
00078 const_iterator upper_bound() const;
00079
00080 avl<K, Comp>& operator=( const avl<K, Comp>& that );
00081 bool operator==( const avl<K, Comp>& that ) const;
00082 bool operator!=( const avl<K, Comp>& that ) const;
00083 bool operator<( const avl<K, Comp>& that ) const;
00084 bool operator>( const avl<K, Comp>& that ) const;
00085 bool operator<=( const avl<K, Comp>& that ) const;
00086 bool operator>=( const avl<K, Comp>& that ) const;
00087
00088 private:
00090 impl_type m_tree;
00091
00092 };
00093 }
00094
00095 #include <claw/impl/avl.tpp>
00096
00097 #endif // __CLAW_AVL_HPP__