Claw  1.7.3
Public Types | Public Member Functions | List of all members
claw::math::ordered_set< K, Comp > Class Template Reference

A class to manage sets of ordered items. More...

#include <ordered_set.hpp>

Inheritance diagram for claw::math::ordered_set< K, Comp >:
claw::avl< K, Comp >

Public Types

typedef super::const_iterator const_iterator
 The type of the iterator used to access non modifiable values.
typedef super::value_type value_type
 The type of the values in the set.
typedef super::referent_type referent_type
 The type passed to the template.
typedef super::const_reference const_reference
 The type of a const reference on the values.
- Public Types inherited from claw::avl< K, Comp >
typedef K value_type
 The type of the values in the tree.
typedef K key_type
 The type of the keys in the tree.
typedef K referent_type
 The type passed to the template.
typedef Comp key_less
 The comparator to use to compare the keys.
typedef const K & const_reference
 The type of a const reference on the values.
typedef
impl_type::avl_const_iterator 
const_iterator
 The type of the iterator on the values of the tree.

Public Member Functions

ordered_setoperator*= (const ordered_set &that)
 Intersection.
ordered_setoperator+= (const ordered_set &that)
 Union.
ordered_setoperator-= (const ordered_set &that)
 Difference.
ordered_setoperator/= (const ordered_set &that)
 Symetric difference.
bool operator> (const ordered_set &that) const
 Inclusion.
bool operator>= (const ordered_set &that) const
 Inclusion or equality.
bool operator< (const ordered_set &that) const
 Inclusion.
bool operator<= (const ordered_set &that) const
 Inclusion or equality.
ordered_setintersection (const ordered_set &that)
 Intersection.
ordered_setjoin (const ordered_set &that)
 Union.
ordered_setdifference (const ordered_set &that)
 Difference.
ordered_setsymetric_difference (const ordered_set &that)
 Symetric difference.
bool contains (const ordered_set &that) const
 Inclusion or equality.
bool strictly_contains (const ordered_set &that) const
 Inclusion.
- Public Member Functions inherited from claw::avl< K, Comp >
 avl ()
 AVL constructor.
 avl (const avl< K, Comp > &that)
 AVL copy constructor.
template<typename InputIterator >
 avl (InputIterator first, InputIterator last)
 Constructor from a range.
void insert (const K &key)
 Add a value in a tree.
template<typename InputIterator >
void insert (InputIterator first, InputIterator last)
 Add a range of items in the tree.
void erase (const K &key)
 Delete a value in a tree.
void clear ()
 Clear a tree.
unsigned int size () const
 Get the size of a tree.
bool empty () const
 Tell if a tree is empty or not.
const_iterator begin () const
 Get an iterator on the nodes of the tree.
const_iterator end () const
 Get an iterator after the end of the tree.
const_iterator find (const K &key) const
 Get an iterator on the nodes of the tree from a specified key.
const_iterator find_nearest_greater (const K &key) const
 Get an iterator on the nodes of the tree on the key imediatly after from a specified key.
const_iterator find_nearest_lower (const K &key) const
 Get an iterator on the nodes of the tree on the key imediatly before from a specified key.
const_iterator lower_bound () const
 Get an iterator on the lowest value of the tree.
const_iterator upper_bound () const
 Get an iterator on the gratest value of the tree.
avl< K, Comp > & operator= (const avl< K, Comp > &that)
 Assignment.
bool operator== (const avl< K, Comp > &that) const
 Equality.
bool operator!= (const avl< K, Comp > &that) const
 Disequality.
bool operator< (const avl< K, Comp > &that) const
 Less than operator.
bool operator> (const avl< K, Comp > &that) const
 Greater than operator.
bool operator<= (const avl< K, Comp > &that) const
 Less or equal operator.
bool operator>= (const avl< K, Comp > &that) const
 Greater or equal operator.

Detailed Description

template<class K, class Comp = std::less<K>>
class claw::math::ordered_set< K, Comp >

A class to manage sets of ordered items.

Author
Julien Jorge

Definition at line 44 of file ordered_set.hpp.

Member Function Documentation

template<class K , class Comp >
bool claw::math::ordered_set< K, Comp >::contains ( const ordered_set< K, Comp > &  that) const

Inclusion or equality.

Parameters
thatThe instance that should be contained.
Returns
true if that is included in this.

Definition at line 223 of file ordered_set.tpp.

References claw::avl< K, Comp >::begin(), claw::avl< K, Comp >::end(), and claw::avl< K, Comp >::size().

Referenced by claw::math::ordered_set< K, Comp >::operator<=().

template<class K , class Comp >
claw::math::ordered_set< K, Comp > & claw::math::ordered_set< K, Comp >::difference ( const ordered_set< K, Comp > &  that)

Difference.

Parameters
thatThe instance from which to remove items.

Definition at line 184 of file ordered_set.tpp.

References claw::avl< K, Comp >::end(), and claw::avl< K, Comp >::find().

Referenced by claw::math::ordered_set< K, Comp >::symetric_difference().

template<class K , class Comp >
claw::math::ordered_set< K, Comp > & claw::math::ordered_set< K, Comp >::intersection ( const ordered_set< K, Comp > &  that)

Intersection.

Parameters
thatThe instance to intersect from.

Definition at line 143 of file ordered_set.tpp.

References claw::avl< K, Comp >::end(), and claw::avl< K, Comp >::find().

template<class K , class Comp >
claw::math::ordered_set< K, Comp > & claw::math::ordered_set< K, Comp >::join ( const ordered_set< K, Comp > &  that)

Union.

Parameters
thatThe instance to join with.

Definition at line 167 of file ordered_set.tpp.

References claw::avl< K, Comp >::begin(), and claw::avl< K, Comp >::end().

template<class K , class Comp >
claw::math::ordered_set< K, Comp > & claw::math::ordered_set< K, Comp >::operator*= ( const ordered_set< K, Comp > &  that)

Intersection.

Parameters
thatThe instance to intersect from.

Definition at line 43 of file ordered_set.tpp.

template<class K , class Comp >
claw::math::ordered_set< K, Comp > & claw::math::ordered_set< K, Comp >::operator+= ( const ordered_set< K, Comp > &  that)

Union.

Parameters
thatThe instance to join with.

Definition at line 55 of file ordered_set.tpp.

template<class K , class Comp >
claw::math::ordered_set< K, Comp > & claw::math::ordered_set< K, Comp >::operator-= ( const ordered_set< K, Comp > &  that)

Difference.

Parameters
thatThe instance from which to remove items.

Definition at line 67 of file ordered_set.tpp.

template<class K , class Comp >
claw::math::ordered_set< K, Comp > & claw::math::ordered_set< K, Comp >::operator/= ( const ordered_set< K, Comp > &  that)

Symetric difference.

Parameters
thatThe instance to differ from.

Definition at line 79 of file ordered_set.tpp.

template<class K , class Comp >
bool claw::math::ordered_set< K, Comp >::operator< ( const ordered_set< K, Comp > &  that) const

Inclusion.

Parameters
thatThe instance that should contain.
Returns
true if that is strictly included in this.

Definition at line 118 of file ordered_set.tpp.

References claw::math::ordered_set< K, Comp >::strictly_contains().

template<class K , class Comp >
bool claw::math::ordered_set< K, Comp >::operator<= ( const ordered_set< K, Comp > &  that) const

Inclusion or equality.

Parameters
thatThe instance that should be contained.
Returns
true if that is included in this.

Definition at line 131 of file ordered_set.tpp.

References claw::math::ordered_set< K, Comp >::contains().

template<class K , class Comp >
bool claw::math::ordered_set< K, Comp >::operator> ( const ordered_set< K, Comp > &  that) const

Inclusion.

Parameters
thatThe instance that should be contained.
Returns
true if that is strictly included in this.

Definition at line 92 of file ordered_set.tpp.

template<class K , class Comp >
bool claw::math::ordered_set< K, Comp >::operator>= ( const ordered_set< K, Comp > &  that) const

Inclusion or equality.

Parameters
thatThe instance that should be contained.
Returns
true if that is included in this.

Definition at line 105 of file ordered_set.tpp.

template<class K , class Comp >
bool claw::math::ordered_set< K, Comp >::strictly_contains ( const ordered_set< K, Comp > &  that) const

Inclusion.

Parameters
thatThe instance that should contain.
Returns
true if that is strictly included in this.

Definition at line 252 of file ordered_set.tpp.

References claw::avl< K, Comp >::size().

Referenced by claw::math::ordered_set< K, Comp >::operator<().

template<class K , class Comp >
claw::math::ordered_set< K, Comp > & claw::math::ordered_set< K, Comp >::symetric_difference ( const ordered_set< K, Comp > &  that)

Symetric difference.

Parameters
thatThe instance to differ from.

Definition at line 208 of file ordered_set.tpp.

References claw::math::ordered_set< K, Comp >::difference().


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