Simple Application Framework  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Protected Types
Saf::Collection::TreeSet< ValType, CompType > Class Template Reference

Ordered set container. More...

#include <TreeSet.h>

Inheritance diagram for Saf::Collection::TreeSet< ValType, CompType >:
Saf::Algo::Struct::RedBlackTree< ValType, ValType, Algo::Identity< ValType >, CompType >

List of all members.

Public Types

typedef BaseType::ConstIterator ConstIterator
typedef BaseType::Iterator Iterator

Public Member Functions

 TreeSet ()
 Default constructor.
 TreeSet (const MyType &m)
 Copy constructor.
MyTypeoperator= (const MyType &m)
 Assignment operator.
MyTypeSwap (MyType &m)
 Swap the content of two tree sets.

Protected Types

typedef
Algo::Struct::RedBlackTree
< ValType, ValType,
Algo::Identity< ValType >
, CompType > 
BaseType
typedef TreeSet< ValType,
CompType > 
MyType

Detailed Description

template<class ValType, class CompType = Algo::Predicate::Less<ValType>>
class Saf::Collection::TreeSet< ValType, CompType >

Ordered set container.

The container stores a collection of values where each value can appear only once in the set. Internally, the data are stored in a sorted order in a red/black tree enabling insert, erase and look-up of the values in guaranteed logarithmic time.

Iterator category: Bidirectional.

Template Parameters:
ValTypeData type of the elements of the set.
CompTypeA binary comparison predicate inducing a strict weak ordering on ValType values.
See also:
Algo::Struct::RedBlackTree, Collection::HashSet.

Member Typedef Documentation

template<class ValType , class CompType = Algo::Predicate::Less<ValType>>
typedef Algo::Struct::RedBlackTree<ValType,ValType,Algo::Identity<ValType>,CompType> Saf::Collection::TreeSet< ValType, CompType >::BaseType [protected]
template<class ValType , class CompType = Algo::Predicate::Less<ValType>>
typedef BaseType::ConstIterator Saf::Collection::TreeSet< ValType, CompType >::ConstIterator
template<class ValType , class CompType = Algo::Predicate::Less<ValType>>
typedef BaseType::Iterator Saf::Collection::TreeSet< ValType, CompType >::Iterator
template<class ValType , class CompType = Algo::Predicate::Less<ValType>>
typedef TreeSet<ValType,CompType> Saf::Collection::TreeSet< ValType, CompType >::MyType [protected]

Constructor & Destructor Documentation

template<class ValType , class CompType = Algo::Predicate::Less<ValType>>
Saf::Collection::TreeSet< ValType, CompType >::TreeSet ( ) [inline]

Default constructor.

template<class ValType , class CompType = Algo::Predicate::Less<ValType>>
Saf::Collection::TreeSet< ValType, CompType >::TreeSet ( const MyType m) [inline]

Copy constructor.


Member Function Documentation

template<class ValType , class CompType = Algo::Predicate::Less<ValType>>
MyType& Saf::Collection::TreeSet< ValType, CompType >::operator= ( const MyType m) [inline]

Assignment operator.

template<class ValType , class CompType = Algo::Predicate::Less<ValType>>
MyType& Saf::Collection::TreeSet< ValType, CompType >::Swap ( MyType m) [inline]

Swap the content of two tree sets.

Properties:

  • Worst-case time complexity: $ \mathcal{O}(1) $.

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