Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder > Class Template Reference

The class template sgtree is an intrusive scapegoat tree container, that is used to construct intrusive sg_set and sg_multiset containers. More...

#include <sgtree.hpp>

Inheritance diagram for boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >:

Public Types

typedef ValueTraits value_traits
 
typedef
implementation_defined::pointer 
pointer
 
typedef
implementation_defined::const_pointer 
const_pointer
 
typedef
implementation_defined::value_type 
value_type
 
typedef
implementation_defined::key_type 
key_type
 
typedef
implementation_defined::reference 
reference
 
typedef
implementation_defined::const_reference 
const_reference
 
typedef
implementation_defined::difference_type 
difference_type
 
typedef
implementation_defined::size_type 
size_type
 
typedef
implementation_defined::value_compare 
value_compare
 
typedef
implementation_defined::key_compare 
key_compare
 
typedef
implementation_defined::iterator 
iterator
 
typedef
implementation_defined::const_iterator 
const_iterator
 
typedef
implementation_defined::reverse_iterator 
reverse_iterator
 
typedef
implementation_defined::const_reverse_iterator 
const_reverse_iterator
 
typedef
implementation_defined::node_traits 
node_traits
 
typedef
implementation_defined::node 
node
 
typedef
implementation_defined::node_ptr 
node_ptr
 
typedef
implementation_defined::const_node_ptr 
const_node_ptr
 

Public Member Functions

typedef BOOST_INTRUSIVE_IMPDEF (sgtree_algorithms< node_traits >) node_algorithms
 
typedef BOOST_INTRUSIVE_IMPDEF (typename node_algorithms::insert_commit_data) insert_commit_data
 
 sgtree_impl (const value_compare &cmp=value_compare(), const value_traits &v_traits=value_traits())
 
template<class Iterator >
 sgtree_impl (bool unique, Iterator b, Iterator e, const value_compare &cmp=value_compare(), const value_traits &v_traits=value_traits())
 
 sgtree_impl (BOOST_RV_REF(sgtree_impl) x)
 
sgtree_imploperator= (BOOST_RV_REF(sgtree_impl) x)
 
void swap (sgtree_impl &other)
 
template<class Cloner , class Disposer >
void clone_from (const sgtree_impl &src, Cloner cloner, Disposer disposer)
 
iterator insert_equal (reference value)
 
iterator insert_equal (const_iterator hint, reference value)
 
template<class Iterator >
void insert_equal (Iterator b, Iterator e)
 
std::pair< iterator, bool > insert_unique (reference value)
 
iterator insert_unique (const_iterator hint, reference value)
 
template<class KeyType , class KeyValueCompare >
std::pair< iterator, bool > insert_unique_check (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
 
template<class KeyType , class KeyValueCompare >
std::pair< iterator, bool > insert_unique_check (const_iterator hint, const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
 
iterator insert_unique_commit (reference value, const insert_commit_data &commit_data)
 
template<class Iterator >
void insert_unique (Iterator b, Iterator e)
 
iterator insert_before (const_iterator pos, reference value)
 
void push_back (reference value)
 
void push_front (reference value)
 
iterator erase (const_iterator i)
 
iterator erase (const_iterator b, const_iterator e)
 
size_type erase (const_reference value)
 
template<class KeyType , class KeyValueCompare >
size_type erase (const KeyType &key, KeyValueCompare comp)
 
template<class Disposer >
iterator erase_and_dispose (const_iterator i, Disposer disposer)
 
template<class Disposer >
iterator erase_and_dispose (iterator i, Disposer disposer)
 
template<class Disposer >
iterator erase_and_dispose (const_iterator b, const_iterator e, Disposer disposer)
 
template<class Disposer >
size_type erase_and_dispose (const_reference value, Disposer disposer)
 
template<class KeyType , class KeyValueCompare , class Disposer >
size_type erase_and_dispose (const KeyType &key, KeyValueCompare comp, Disposer disposer)
 
void clear ()
 
template<class Disposer >
void clear_and_dispose (Disposer disposer)
 
float balance_factor () const
 Returns: The balance factor (alpha) used in this tree More...
 
void balance_factor (float new_alpha)
 Requires: new_alpha must be a value between 0.5 and 1.0 More...
 

Static Public Attributes

static const bool constant_time_size = implementation_defined::constant_time_size
 
static const bool floating_point = FloatingPoint
 
static const bool stateful_value_traits = implementation_defined::stateful_value_traits
 

Detailed Description

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
class boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >

The class template sgtree is an intrusive scapegoat tree container, that is used to construct intrusive sg_set and sg_multiset containers.

The no-throw guarantee holds only, if the value_compare object doesn't throw.

The template parameter T is the type to be managed by the container. The user can specify additional options and if no options are provided default options are used.

The container supports the following options: base_hook<>/member_hook<>/value_traits<>, floating_point<>, size_type<> and compare<>.

Member Typedef Documentation

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::const_iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::const_iterator
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::const_node_ptr boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::const_node_ptr
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::const_pointer boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::const_pointer
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::const_reference boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::const_reference
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::const_reverse_iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::const_reverse_iterator
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::difference_type boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::difference_type
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::iterator
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::key_compare boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::key_compare
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::key_type boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::key_type
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::node boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::node
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::node_ptr boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::node_ptr
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::node_traits boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::node_traits
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::pointer boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::pointer
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::reference boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::reference
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::reverse_iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::reverse_iterator
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::size_type boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::size_type
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::value_compare boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::value_compare
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef ValueTraits boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::value_traits
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef implementation_defined::value_type boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::value_type

Constructor & Destructor Documentation

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::sgtree_impl ( const value_compare cmp = value_compare(),
const value_traits v_traits = value_traits() 
)
inlineexplicit

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class Iterator >
boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::sgtree_impl ( bool  unique,
Iterator  b,
Iterator  e,
const value_compare cmp = value_compare(),
const value_traits v_traits = value_traits() 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::sgtree_impl ( BOOST_RV_REF(sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >)  x)
inline

Member Function Documentation

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
float boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::balance_factor ( ) const
inline

Returns: The balance factor (alpha) used in this tree

Throws: Nothing.

Complexity: Constant.

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
void boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::balance_factor ( float  new_alpha)
inline

Requires: new_alpha must be a value between 0.5 and 1.0

Effects: Establishes a new balance factor (alpha) and rebalances the tree if the new balance factor is stricter (less) than the old factor.

Throws: Nothing.

Complexity: Linear to the elements in the subtree.

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::BOOST_INTRUSIVE_IMPDEF ( sgtree_algorithms< node_traits )
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
typedef boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::BOOST_INTRUSIVE_IMPDEF ( typename node_algorithms::insert_commit_data  )
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
void boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::clear ( void  )
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class Disposer >
void boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::clear_and_dispose ( Disposer  disposer)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class Cloner , class Disposer >
void boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::clone_from ( const sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder > &  src,
Cloner  cloner,
Disposer  disposer 
)
inline

Additional notes: it also copies the alpha factor from the source container.

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::erase ( const_iterator  i)
inline
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::erase ( const_iterator  b,
const_iterator  e 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
size_type boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::erase ( const_reference  value)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class KeyType , class KeyValueCompare >
size_type boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::erase ( const KeyType &  key,
KeyValueCompare  comp 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class Disposer >
iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::erase_and_dispose ( const_iterator  i,
Disposer  disposer 
)
inline
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class Disposer >
iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::erase_and_dispose ( iterator  i,
Disposer  disposer 
)
inline
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class Disposer >
iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::erase_and_dispose ( const_iterator  b,
const_iterator  e,
Disposer  disposer 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class Disposer >
size_type boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::erase_and_dispose ( const_reference  value,
Disposer  disposer 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class KeyType , class KeyValueCompare , class Disposer >
size_type boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::erase_and_dispose ( const KeyType &  key,
KeyValueCompare  comp,
Disposer  disposer 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::insert_before ( const_iterator  pos,
reference  value 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::insert_equal ( reference  value)
inline
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::insert_equal ( const_iterator  hint,
reference  value 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class Iterator >
void boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::insert_equal ( Iterator  b,
Iterator  e 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
std::pair<iterator, bool> boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::insert_unique ( reference  value)
inline
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::insert_unique ( const_iterator  hint,
reference  value 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class Iterator >
void boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::insert_unique ( Iterator  b,
Iterator  e 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class KeyType , class KeyValueCompare >
std::pair<iterator, bool> boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::insert_unique_check ( const KeyType &  key,
KeyValueCompare  key_value_comp,
insert_commit_data &  commit_data 
)
inline
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
template<class KeyType , class KeyValueCompare >
std::pair<iterator, bool> boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::insert_unique_check ( const_iterator  hint,
const KeyType &  key,
KeyValueCompare  key_value_comp,
insert_commit_data &  commit_data 
)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
iterator boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::insert_unique_commit ( reference  value,
const insert_commit_data &  commit_data 
)
inline
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
sgtree_impl& boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::operator= ( BOOST_RV_REF(sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >)  x)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
void boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::push_back ( reference  value)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
void boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::push_front ( reference  value)
inline

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
void boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::swap ( sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder > &  other)
inline

Member Data Documentation

template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
const bool boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::constant_time_size = implementation_defined::constant_time_size
static
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
const bool boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::floating_point = FloatingPoint
static
template<class ValueTraits, class VoidOrKeyComp, class SizeType, bool FloatingPoint, typename HeaderHolder>
const bool boost::intrusive::sgtree_impl< ValueTraits, VoidOrKeyComp, SizeType, FloatingPoint, HeaderHolder >::stateful_value_traits = implementation_defined::stateful_value_traits
static

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