STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
_Tree_comp_alloc< _Traits > Class Template Reference
Inheritance diagram for _Tree_comp_alloc< _Traits >:
_Tree< _Traits >

Public Types

enum  _Redbl { _Red, _Black }
 
typedef _Tree_comp_alloc< _Traits > _Myt
 
typedef _Traits::allocator_type allocator_type
 
typedef _Traits::key_compare key_compare
 
typedef _Tree_base_types< typename _Traits::value_type, allocator_type_Alloc_types
 
typedef _Alloc_types::_Alloc _Alloc
 
typedef _Alloc_types::_Alnod_type _Alty
 
typedef _Alloc_types::_Node _Node
 
typedef _Alloc_types::_Nodeptr _Nodeptr
 
typedef _Alloc_types::_Val_types _Val_types
 
typedef _Nodeptr_Nodepref
 
typedef _Val_types::value_type value_type
 
typedef _Val_types::size_type size_type
 
typedef _Val_types::difference_type difference_type
 
typedef _Val_types::pointer pointer
 
typedef _Val_types::const_pointer const_pointer
 
typedef _Val_types::reference reference
 
typedef _Val_types::const_reference const_reference
 
typedef _Tree_const_iterator< _Tree_val< _Val_types > > const_iterator
 
typedef _Tree_iterator< _Tree_val< _Val_types > > iterator
 

Public Member Functions

 _Tree_comp_alloc (const key_compare &_Parg)
 
template<class _Any_alloc , class = enable_if_t<!is_same<decay_t<_Any_alloc>, _Myt>::value>>
 _Tree_comp_alloc (const key_compare &_Parg, _Any_alloc &&_Al)
 
void _Construct ()
 
 ~_Tree_comp_alloc () _NOEXCEPT
 
void _Alloc_proxy ()
 
void _Free_proxy ()
 
void _Copy_alloc (const _Alty &_Al)
 
void _Move_alloc (_Alty &_Al)
 
void _Orphan_all ()
 
void _Swap_all (_Myt &_Right)
 
_Nodeptr _Buyheadnode ()
 
void _Freeheadnode (_Nodeptr _Pnode)
 
_Nodeptr _Buynode0 ()
 
void _Freenode0 (_Nodeptr _Pnode)
 
template<class... _Valty>
_Nodeptr _Buynode (_Valty &&..._Val)
 
key_compare_Getcomp () _NOEXCEPT
 
const key_compare_Getcomp () const _NOEXCEPT
 
_Alty_Getal () _NOEXCEPT
 
const _Alty_Getal () const _NOEXCEPT
 
_Tree_val< _Val_types > & _Get_data () _NOEXCEPT
 
const _Tree_val< _Val_types > & _Get_data () const _NOEXCEPT
 
_Nodeptr_Myhead () _NOEXCEPT
 
const _Nodeptr_Myhead () const _NOEXCEPT
 
size_type_Mysize () _NOEXCEPT
 
const size_type_Mysize () const _NOEXCEPT
 

Static Public Member Functions

static char_Color (_Nodeptr _Pnode)
 
static char_Isnil (_Nodeptr _Pnode)
 
static _Nodepref _Left (_Nodeptr _Pnode)
 
static _Nodepref _Parent (_Nodeptr _Pnode)
 
static _Nodepref _Right (_Nodeptr _Pnode)
 
static reference _Myval (_Nodeptr _Pnode)
 
static _Nodeptr _Max (_Nodeptr _Pnode)
 
static _Nodeptr _Min (_Nodeptr _Pnode)
 

Private Attributes

_Compressed_pair< key_compare, _Compressed_pair< _Alty, _Tree_val< _Val_types > > > _Mypair
 

Member Typedef Documentation

template<class _Traits>
typedef _Alloc_types::_Alloc _Tree_comp_alloc< _Traits >::_Alloc
template<class _Traits>
typedef _Tree_base_types<typename _Traits::value_type, allocator_type> _Tree_comp_alloc< _Traits >::_Alloc_types
template<class _Traits>
typedef _Alloc_types::_Alnod_type _Tree_comp_alloc< _Traits >::_Alty
template<class _Traits>
typedef _Tree_comp_alloc<_Traits> _Tree_comp_alloc< _Traits >::_Myt
template<class _Traits>
typedef _Alloc_types::_Node _Tree_comp_alloc< _Traits >::_Node
template<class _Traits>
typedef _Nodeptr& _Tree_comp_alloc< _Traits >::_Nodepref
template<class _Traits>
typedef _Alloc_types::_Nodeptr _Tree_comp_alloc< _Traits >::_Nodeptr
template<class _Traits>
typedef _Alloc_types::_Val_types _Tree_comp_alloc< _Traits >::_Val_types
template<class _Traits>
typedef _Traits::allocator_type _Tree_comp_alloc< _Traits >::allocator_type
template<class _Traits>
typedef _Tree_const_iterator<_Tree_val<_Val_types> > _Tree_comp_alloc< _Traits >::const_iterator
template<class _Traits>
typedef _Val_types::const_pointer _Tree_comp_alloc< _Traits >::const_pointer
template<class _Traits>
typedef _Val_types::const_reference _Tree_comp_alloc< _Traits >::const_reference
template<class _Traits>
typedef _Val_types::difference_type _Tree_comp_alloc< _Traits >::difference_type
template<class _Traits>
typedef _Tree_iterator<_Tree_val<_Val_types> > _Tree_comp_alloc< _Traits >::iterator
template<class _Traits>
typedef _Traits::key_compare _Tree_comp_alloc< _Traits >::key_compare
template<class _Traits>
typedef _Val_types::pointer _Tree_comp_alloc< _Traits >::pointer
template<class _Traits>
typedef _Val_types::reference _Tree_comp_alloc< _Traits >::reference
template<class _Traits>
typedef _Val_types::size_type _Tree_comp_alloc< _Traits >::size_type
template<class _Traits>
typedef _Val_types::value_type _Tree_comp_alloc< _Traits >::value_type

Member Enumeration Documentation

template<class _Traits>
enum _Tree_comp_alloc::_Redbl
Enumerator
_Red 
_Black 
650  { // colors for link to parent
651  _Red, _Black
652  };
Definition: xtree:651
Definition: xtree:651

Constructor & Destructor Documentation

template<class _Traits>
_Tree_comp_alloc< _Traits >::_Tree_comp_alloc ( const key_compare _Parg)
inline
697  { // construct from comparator
698  _Construct();
699  }
_Compressed_pair< key_compare, _Compressed_pair< _Alty, _Tree_val< _Val_types > > > _Mypair
Definition: xtree:965
Definition: xutility:278
void _Construct()
Definition: xtree:712
Definition: xutility:282
template<class _Traits>
template<class _Any_alloc , class = enable_if_t<!is_same<decay_t<_Any_alloc>, _Myt>::value>>
_Tree_comp_alloc< _Traits >::_Tree_comp_alloc ( const key_compare _Parg,
_Any_alloc &&  _Al 
)
inline
706  _STD forward<_Any_alloc>(_Al))
707  { // construct from comparator, allocator
708  _Construct();
709  }
_Compressed_pair< key_compare, _Compressed_pair< _Alty, _Tree_val< _Val_types > > > _Mypair
Definition: xtree:965
void _Construct()
Definition: xtree:712
Definition: xutility:282
template<class _Traits>
_Tree_comp_alloc< _Traits >::~_Tree_comp_alloc ( )
inline
718  { // destroy head node
720  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
void _Freeheadnode(_Nodeptr _Pnode)
Definition: xtree:852

Member Function Documentation

template<class _Traits>
void _Tree_comp_alloc< _Traits >::_Alloc_proxy ( )
inline
723  { // do nothing
724  }
template<class _Traits>
_Nodeptr _Tree_comp_alloc< _Traits >::_Buyheadnode ( )
inline
832  { // get head node using current allocator
833  _Nodeptr _Pnode = _Getal().allocate(1);
834 
835  _TRY_BEGIN
836  _Getal().construct(
837  _STD addressof(_Left(_Pnode)), _Pnode);
838  _Getal().construct(
839  _STD addressof(_Parent(_Pnode)), _Pnode);
840  _Getal().construct(
841  _STD addressof(_Right(_Pnode)), _Pnode);
842  _CATCH_ALL
843  _Getal().deallocate(_Pnode, 1);
844  _RERAISE;
845  _CATCH_END
846 
847  _Color(_Pnode) = _Black;
848  _Isnil(_Pnode) = true;
849  return (_Pnode);
850  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
_Alloc_types::_Nodeptr _Nodeptr
Definition: xtree:633
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
static _Nodepref _Parent(_Nodeptr _Pnode)
Definition: xtree:669
Definition: xtree:651
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
static char & _Color(_Nodeptr _Pnode)
Definition: xtree:654
#define _CATCH_ALL
Definition: xstddef:28
#define _RERAISE
Definition: xstddef:32
template<class _Traits>
template<class... _Valty>
_Nodeptr _Tree_comp_alloc< _Traits >::_Buynode ( _Valty &&...  _Val)
inline
895  { // allocate a node with defaults and set links and value
896  _Nodeptr _Pnode = _Buynode0();
897 
898  this->_Color(_Pnode) = _Red;
899  this->_Isnil(_Pnode) = false;
900 
901  _TRY_BEGIN
902  this->_Getal().construct(
903  _STD addressof(_Myval(_Pnode)),
904  _STD forward<_Valty>(_Val)...);
905  _CATCH_ALL
906  _Freenode0(_Pnode);
907  _RERAISE;
908  _CATCH_END
909 
910  return (_Pnode);
911  }
void _Freenode0(_Nodeptr _Pnode)
Definition: xtree:882
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Alloc_types::_Nodeptr _Nodeptr
Definition: xtree:633
#define _TRY_BEGIN
Definition: xstddef:26
Definition: xtree:651
#define _CATCH_END
Definition: xstddef:29
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
_Nodeptr _Buynode0()
Definition: xtree:863
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
static char & _Color(_Nodeptr _Pnode)
Definition: xtree:654
#define _CATCH_ALL
Definition: xstddef:28
static reference _Myval(_Nodeptr _Pnode)
Definition: xtree:679
#define _RERAISE
Definition: xstddef:32
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
_Nodeptr _Tree_comp_alloc< _Traits >::_Buynode0 ( )
inline
864  { // allocate a non-value node
865  _Nodeptr _Pnode = _Getal().allocate(1);
866 
867  _TRY_BEGIN
868  _Getal().construct(
869  _STD addressof(_Left(_Pnode)), _Myhead());
870  _Getal().construct(
871  _STD addressof(_Parent(_Pnode)), _Myhead());
872  _Getal().construct(
873  _STD addressof(_Right(_Pnode)), _Myhead());
874  _CATCH_ALL
875  _Getal().deallocate(_Pnode, 1);
876  _RERAISE;
877  _CATCH_END
878 
879  return (_Pnode);
880  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
_Alloc_types::_Nodeptr _Nodeptr
Definition: xtree:633
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
static _Nodepref _Parent(_Nodeptr _Pnode)
Definition: xtree:669
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
#define _CATCH_ALL
Definition: xstddef:28
#define _RERAISE
Definition: xstddef:32
template<class _Traits>
static char& _Tree_comp_alloc< _Traits >::_Color ( _Nodeptr  _Pnode)
inlinestatic
655  { // return reference to color in node
656  return (_Tree_val<_Val_types>::_Color(_Pnode));
657  }
Definition: xtree:539
template<class _Traits>
void _Tree_comp_alloc< _Traits >::_Construct ( )
inline
713  { // construct head node
714  _Myhead() = _Buyheadnode();
715  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
_Nodeptr _Buyheadnode()
Definition: xtree:831
template<class _Traits>
void _Tree_comp_alloc< _Traits >::_Copy_alloc ( const _Alty _Al)
inline
784  { // replace old allocator
785  const bool _Reload = _Alty::propagate_on_container_copy_assignment::value && _Getal() != _Al;
786 
787  if (_Reload)
788  {
789  _Free_proxy();
791  }
792 
793  _Pocca(_Getal(), _Al);
794 
795  if (_Reload)
796  {
797  _Myhead() = _Buyheadnode();
798  _Alloc_proxy();
799  }
800  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
void _Alloc_proxy()
Definition: xtree:722
void _Free_proxy()
Definition: xtree:726
_Nodeptr _Buyheadnode()
Definition: xtree:831
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
void _Pocca(_Alty &_Left, const _Alty &_Right, true_type) _NOEXCEPT
Definition: xmemory0:1131
void _Freeheadnode(_Nodeptr _Pnode)
Definition: xtree:852
template<class _Traits>
void _Tree_comp_alloc< _Traits >::_Free_proxy ( )
inline
727  { // do nothing
728  }
template<class _Traits>
void _Tree_comp_alloc< _Traits >::_Freeheadnode ( _Nodeptr  _Pnode)
inline
853  { // free head node using current allocator
854  _Getal().destroy(
855  _STD addressof(_Left(_Pnode)));
856  _Getal().destroy(
857  _STD addressof(_Parent(_Pnode)));
858  _Getal().destroy(
859  _STD addressof(_Right(_Pnode)));
860  _Getal().deallocate(_Pnode, 1);
861  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
static _Nodepref _Parent(_Nodeptr _Pnode)
Definition: xtree:669
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
template<class _Traits>
void _Tree_comp_alloc< _Traits >::_Freenode0 ( _Nodeptr  _Pnode)
inline
883  { // free non-value node using current allocator
884  _Getal().destroy(
885  _STD addressof(_Left(_Pnode)));
886  _Getal().destroy(
887  _STD addressof(_Parent(_Pnode)));
888  _Getal().destroy(
889  _STD addressof(_Right(_Pnode)));
890  _Getal().deallocate(_Pnode, 1);
891  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
static _Nodepref _Parent(_Nodeptr _Pnode)
Definition: xtree:669
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
template<class _Traits>
_Tree_val<_Val_types>& _Tree_comp_alloc< _Traits >::_Get_data ( )
inline
934  { // return reference to _Tree_val
935  return (_Mypair._Get_second()._Get_second());
936  }
_Compressed_pair< key_compare, _Compressed_pair< _Alty, _Tree_val< _Val_types > > > _Mypair
Definition: xtree:965
template<class _Traits>
const _Tree_val<_Val_types>& _Tree_comp_alloc< _Traits >::_Get_data ( ) const
inline
939  { // return const reference to _Tree_val
940  return (_Mypair._Get_second()._Get_second());
941  }
_Compressed_pair< key_compare, _Compressed_pair< _Alty, _Tree_val< _Val_types > > > _Mypair
Definition: xtree:965
template<class _Traits>
_Alty& _Tree_comp_alloc< _Traits >::_Getal ( )
inline
924  { // return reference to allocator
925  return (_Mypair._Get_second()._Get_first());
926  }
_Compressed_pair< key_compare, _Compressed_pair< _Alty, _Tree_val< _Val_types > > > _Mypair
Definition: xtree:965
template<class _Traits>
const _Alty& _Tree_comp_alloc< _Traits >::_Getal ( ) const
inline
929  { // return const reference to allocator
930  return (_Mypair._Get_second()._Get_first());
931  }
_Compressed_pair< key_compare, _Compressed_pair< _Alty, _Tree_val< _Val_types > > > _Mypair
Definition: xtree:965
template<class _Traits>
key_compare& _Tree_comp_alloc< _Traits >::_Getcomp ( )
inline
914  { // return reference to ordering predicate
915  return (_Mypair._Get_first());
916  }
_Compressed_pair< key_compare, _Compressed_pair< _Alty, _Tree_val< _Val_types > > > _Mypair
Definition: xtree:965
template<class _Traits>
const key_compare& _Tree_comp_alloc< _Traits >::_Getcomp ( ) const
inline
919  { // return const reference to ordering predicate
920  return (_Mypair._Get_first());
921  }
_Compressed_pair< key_compare, _Compressed_pair< _Alty, _Tree_val< _Val_types > > > _Mypair
Definition: xtree:965
template<class _Traits>
static char& _Tree_comp_alloc< _Traits >::_Isnil ( _Nodeptr  _Pnode)
inlinestatic
660  { // return reference to nil flag in node
661  return (_Tree_val<_Val_types>::_Isnil(_Pnode));
662  }
Definition: xtree:539
template<class _Traits>
static _Nodepref _Tree_comp_alloc< _Traits >::_Left ( _Nodeptr  _Pnode)
inlinestatic
665  { // return reference to left pointer in node
666  return (_Tree_val<_Val_types>::_Left(_Pnode));
667  }
Definition: xtree:539
template<class _Traits>
static _Nodeptr _Tree_comp_alloc< _Traits >::_Max ( _Nodeptr  _Pnode)
inlinestatic
685  { // return rightmost node in subtree at _Pnode
686  return (_Tree_val<_Val_types>::_Max(_Pnode));
687  }
Definition: xtree:539
template<class _Traits>
static _Nodeptr _Tree_comp_alloc< _Traits >::_Min ( _Nodeptr  _Pnode)
inlinestatic
690  { // return leftmost node in subtree at _Pnode
691  return (_Tree_val<_Val_types>::_Min(_Pnode));
692  }
Definition: xtree:539
template<class _Traits>
void _Tree_comp_alloc< _Traits >::_Move_alloc ( _Alty _Al)
inline
803  { // replace old allocator
804  const bool _Reload = _Alty::propagate_on_container_move_assignment::value && _Getal() != _Al;
805 
806  if (_Reload)
807  {
808  _Free_proxy();
810  }
811 
812  _Pocma(_Getal(), _Al);
813 
814  if (_Reload)
815  {
816  _Myhead() = _Buyheadnode();
817  _Alloc_proxy();
818  }
819  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
void _Alloc_proxy()
Definition: xtree:722
void _Free_proxy()
Definition: xtree:726
void _Pocma(_Alty &_Left, _Alty &_Right, true_type) _NOEXCEPT
Definition: xmemory0:1150
_Nodeptr _Buyheadnode()
Definition: xtree:831
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
void _Freeheadnode(_Nodeptr _Pnode)
Definition: xtree:852
template<class _Traits>
_Nodeptr& _Tree_comp_alloc< _Traits >::_Myhead ( )
inline
944  { // return reference to _Myhead
945  return (_Get_data()._Myhead);
946  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
const _Nodeptr& _Tree_comp_alloc< _Traits >::_Myhead ( ) const
inline
949  { // return const reference to _Myhead
950  return (_Get_data()._Myhead);
951  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
size_type& _Tree_comp_alloc< _Traits >::_Mysize ( )
inline
954  { // return reference to _Mysize
955  return (_Get_data()._Mysize);
956  }
size_type & _Mysize() _NOEXCEPT
Definition: xtree:953
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
const size_type& _Tree_comp_alloc< _Traits >::_Mysize ( ) const
inline
959  { // return const reference to _Mysize
960  return (_Get_data()._Mysize);
961  }
size_type & _Mysize() _NOEXCEPT
Definition: xtree:953
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
static reference _Tree_comp_alloc< _Traits >::_Myval ( _Nodeptr  _Pnode)
inlinestatic
680  { // return reference to value in node
681  return (_Tree_val<_Val_types>::_Myval(_Pnode));
682  }
Definition: xtree:539
template<class _Traits>
void _Tree_comp_alloc< _Traits >::_Orphan_all ( )
inline
822  { // orphan all iterators
823  _Get_data()._Orphan_all();
824  }
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
static _Nodepref _Tree_comp_alloc< _Traits >::_Parent ( _Nodeptr  _Pnode)
inlinestatic
670  { // return reference to parent pointer in node
671  return (_Tree_val<_Val_types>::_Parent(_Pnode));
672  }
Definition: xtree:539
template<class _Traits>
static _Nodepref _Tree_comp_alloc< _Traits >::_Right ( _Nodeptr  _Pnode)
inlinestatic
675  { // return reference to right pointer in node
676  return (_Tree_val<_Val_types>::_Right(_Pnode));
677  }
Definition: xtree:539
template<class _Traits>
void _Tree_comp_alloc< _Traits >::_Swap_all ( _Myt _Right)
inline
827  { // swap all iterators
828  _Get_data()._Swap_all(_Right._Get_data());
829  }
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933

Member Data Documentation

template<class _Traits>
_Compressed_pair<key_compare, _Compressed_pair<_Alty, _Tree_val<_Val_types> > > _Tree_comp_alloc< _Traits >::_Mypair
private

The documentation for this class was generated from the following file: