30#ifndef _STLP_INTERNAL_DBG_TREE_H
31#define _STLP_INTERNAL_DBG_TREE_H
33#ifndef _STLP_DBG_ITERATOR_H
37#ifndef _STLP_INTERNAL_FUNCTION_BASE_H
41#ifndef _STLP_INTERNAL_ALLOC_H
49template <
class _Key,
class _Compare>
56#if !defined (_STLP_USE_CONTAINERS_EXTENSION)
57 bool operator () (
const _Key& __lhs,
const _Key& __rhs)
const {
59 template <
class _Kp1,
class _Kp2>
60 bool operator () (
const _Kp1& __lhs,
const _Kp2& __rhs)
const {
73#define _STLP_NON_DBG_TREE _STLP_PRIV _STLP_NON_DBG_NAME(Rb_tree) <_Key, _STLP_PRIV _DbgCompare<_Key, _Compare>, _Value, _KeyOfValue, _Traits, _Alloc>
75#if defined (_STLP_DEBUG_USE_DISTINCT_VALUE_TYPE_HELPERS)
77template <
class _Key,
class _Compare,
78 class _Value,
class _KeyOfValue,
class _Traits,
class _Alloc >
82template <
class _Key,
class _Compare,
83 class _Value,
class _KeyOfValue,
class _Traits,
class _Alloc >
90template <
class _Key,
class _Compare,
91 class _Value,
class _KeyOfValue,
class _Traits,
122 : _M_non_dbg_impl(), _M_iter_list(&_M_non_dbg_impl) {}
124 : _M_non_dbg_impl(__comp), _M_iter_list(&_M_non_dbg_impl) {}
126 : _M_non_dbg_impl(__comp, __a), _M_iter_list(&_M_non_dbg_impl) {}
128 : _M_non_dbg_impl(__x._M_non_dbg_impl), _M_iter_list(&_M_non_dbg_impl) {}
130#if !defined (_STLP_NO_MOVE_SEMANTIC)
133 _M_iter_list(&_M_non_dbg_impl) {
134# if defined (_STLP_NO_EXTENSIONS) || (_STLP_DEBUG_LEVEL == _STLP_STANDARD_DBG_LEVEL)
135 src.get()._M_iter_list._Invalidate_all();
137 src.get()._M_iter_list._Set_owner(_M_iter_list);
147 _Invalidate_iterators(
begin(),
end());
154 _Compare
key_comp()
const {
return _M_non_dbg_impl.key_comp().non_dbg_key_comp(); }
162 const_reverse_iterator
rbegin()
const {
return const_reverse_iterator(
end()); }
164 const_reverse_iterator
rend()
const {
return const_reverse_iterator(
begin()); }
166 bool empty()
const {
return _M_non_dbg_impl.empty(); }
179 {
return iterator(&_M_iter_list, _M_non_dbg_impl.find(__k)); }
182 {
return const_iterator(&_M_iter_list, _M_non_dbg_impl.find(__k)); }
186 {
return iterator(&_M_iter_list, _M_non_dbg_impl.lower_bound(__x)); }
189 {
return const_iterator(&_M_iter_list, _M_non_dbg_impl.lower_bound(__x)); }
193 {
return iterator(&_M_iter_list, _M_non_dbg_impl.upper_bound(__x)); }
196 {
return const_iterator(&_M_iter_list, _M_non_dbg_impl.upper_bound(__x)); }
201 iterator(&_M_iter_list, _M_non_dbg_impl.upper_bound(__x)));
211 _STLP_STD::pair<_Base_iterator, _Base_iterator> __p;
212 __p = _M_non_dbg_impl.equal_range_unique(__x);
217 _STLP_STD::pair<_Base_const_iterator, _Base_const_iterator> __p;
218 __p = _M_non_dbg_impl.equal_range_unique(__x);
224 _STLP_STD::pair<_Base_iterator, bool> __res = _M_non_dbg_impl.insert_unique(__x);
228 {
return iterator(&_M_iter_list, _M_non_dbg_impl.insert_equal(__x)); }
232 return iterator(&_M_iter_list, _M_non_dbg_impl.insert_unique(__pos._M_iterator, __x));
236 return iterator(&_M_iter_list, _M_non_dbg_impl.insert_equal(__pos._M_iterator, __x));
239#if defined (_STLP_MEMBER_TEMPLATES)
240 template<
class _InputIterator>
241 void insert_equal(_InputIterator __first, _InputIterator
__last) {
245 template<
class _InputIterator>
246 void insert_unique(_InputIterator __first, _InputIterator
__last) {
253 _M_non_dbg_impl.insert_unique(__first._M_iterator,
__last._M_iterator);
257 _M_non_dbg_impl.insert_unique(__first,
__last);
261 _M_non_dbg_impl.insert_equal(__first._M_iterator,
__last._M_iterator);
265 _M_non_dbg_impl.insert_equal(__first,
__last);
272 _Invalidate_iterator(__pos);
273 _M_non_dbg_impl.erase(__pos._M_iterator);
279 _M_non_dbg_impl.erase(__p.
first._M_iterator, __p.
second._M_iterator);
284 if (__i != _M_non_dbg_impl.end()) {
285 _Invalidate_iterator(
iterator(&_M_iter_list, __i));
286 _M_non_dbg_impl.erase(__i);
294 _Invalidate_iterators(__first,
__last);
295 _M_non_dbg_impl.erase(__first._M_iterator,
__last._M_iterator);
298 while (__first !=
__last) erase(*__first++);
303 _Invalidate_iterators(
begin(),
end());
304 _M_non_dbg_impl.clear();
311#undef _STLP_NON_DBG_TREE
#define bidirectional_iterator_tag
_STLP_INLINE_LOOP _InputIter __last
_STLP_MOVE_TO_STD_NAMESPACE pair< _ForwardIter, _ForwardIter > equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
#define _STLP_DEBUG_CHECK(expr)
_STLP_MOVE_TO_PRIV_NAMESPACE const _InputIterator const input_iterator_tag &_InputIterator __it(__first)
void get(int argc, const char *argv[])
bool operator()(const _Key &__lhs, const _Key &__rhs) const
_DbgCompare(const _Compare &__cmp)
_Compare non_dbg_key_comp() const
_DbgCompare(const _DbgCompare &__cmp)
allocator_type get_allocator() const
_Rb_tree< _Key, _Compare, _Value, _KeyOfValue, _Traits, _Alloc > _Self
_STLP_TEMPLATE_FOR_CONT_EXT const_iterator lower_bound(const _KT &__x) const
_STLP_TEMPLATE_FOR_CONT_EXT iterator lower_bound(const _KT &__x)
_Rb_tree(const _Compare &__comp)
_Rb_tree(__move_source< _Self > src)
_Traits::_ConstTraits _ConstIteTraits
_Traits::_NonConstTraits _NonConstTraits
_STLP_TEMPLATE_FOR_CONT_EXT pair< const_iterator, const_iterator > equal_range(const _KT &__x) const
const_reverse_iterator rbegin() const
_Compare key_comp() const
allocator_type get_allocator() const
_STLP_TEMPLATE_FOR_CONT_EXT const_iterator upper_bound(const _KT &__x) const
_STLP_TEMPLATE_FOR_CONT_EXT pair< iterator, iterator > equal_range(const _KT &__x)
const_iterator begin() const
_STLP_TEMPLATE_FOR_CONT_EXT iterator find(const _KT &__k)
_Traits::_NonConstTraits _NonConstIteTraits
pair< iterator, bool > insert_unique(const value_type &__x)
const_reverse_iterator rend() const
void erase(const key_type *__first, const key_type *__last)
void erase(iterator __first, iterator __last)
void insert_equal(const_iterator __first, const_iterator __last)
_STLP_TEMPLATE_FOR_CONT_EXT size_type count(const _KT &__x) const
_STLP_TEMPLATE_FOR_CONT_EXT const_iterator find(const _KT &__k) const
_STLP_TEMPLATE_FOR_CONT_EXT pair< iterator, iterator > equal_range_unique(const _KT &__x)
reverse_iterator rbegin()
void _Invalidate_iterators(const iterator &__first, const iterator &__last)
_STLP_TEMPLATE_FOR_CONT_EXT iterator upper_bound(const _KT &__x)
_Traits::_ConstTraits _ConstTraits
iterator insert_equal(iterator __pos, const value_type &__x)
_STLP_TEMPLATE_FOR_CONT_EXT pair< const_iterator, const_iterator > equal_range_unique(const _KT &__x) const
_Base::allocator_type allocator_type
iterator insert_unique(iterator __pos, const value_type &__x)
_STLP_PRIV __owned_list _M_iter_list
void insert_unique(const_iterator __first, const_iterator __last)
iterator insert_equal(const value_type &__x)
size_type erase_unique(const key_type &__x)
size_type erase(const key_type &__x)
_Rb_tree(const _Self &__x)
void insert_equal(const value_type *__first, const value_type *__last)
_Self & operator=(const _Self &__x)
_Rb_tree(const _Compare &__comp, const allocator_type &__a)
_Base::iterator _Base_iterator
void insert_unique(const value_type *__first, const value_type *__last)
_Base::const_iterator _Base_const_iterator
size_type max_size() const
const_iterator end() const
void erase(iterator __pos)
_Iterator _Non_Dbg_iter(_Iterator __it)
bool _Dereferenceable(const _Iterator &__it)
#define _STLP_NON_DBG_TREE
#define _STLP_TEMPLATE_FOR_CONT_EXT
#define _STLP_MOVE_TO_STD_NAMESPACE
#define _STLP_DECLARE_BIDIRECTIONAL_REVERSE_ITERATORS
#define __IMPORT_CONTAINER_TYPEDEFS(_Super)
#define _STLP_DFL_TMPL_PARAM(classname, defval)
#define _STLP_KEY_TYPE_FOR_CONT_EXT(type)
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE
#define _STLP_MOVE_TO_PRIV_NAMESPACE