Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Set< T, C > Class Template Reference

#include <elm/avl/Set.h>

+ Inheritance diagram for Set< T, C >:

Public Types

typedef T t
 
typedef Set< T, C > self_t
 
typedef GenTree< T, IdAdapter< T >, C > base_t
 
- Public Types inherited from GenTree< T, IdAdapter< T >, elm::Comparator< T > >
typedef T t
 
typedef GenTree< T, IdAdapter< T >, elm::Comparator< T >, DefaultAllocself_t
 
- Public Types inherited from Comparator< T >
typedef T t
 

Public Member Functions

self_toperator+= (const T &x)
 
self_toperator-= (const T &x)
 
self_toperator= (const self_t &s)
 
void insert (const T &x)
 
bool subsetOf (const Set< T, C > &s) const
 
void join (const Set< T, C > &s)
 
void diff (const Set< T, C > &s)
 
void meet (const Set< T, C > &s)
 
self_toperator+= (const Set< T, C > &s)
 
self_toperator|= (const Set< T, C > &s)
 
self_toperator-= (const Set< T, C > &s)
 
self_toperator&= (const Set< T, C > &s)
 
self_toperator*= (const Set< T, C > &s)
 
self_t operator+ (const Set< T, C > &s) const
 
self_t operator| (const Set< T, C > &s) const
 
self_t operator- (const Set< T, C > &s) const
 
self_t operator* (const Set< T, C > &s) const
 
self_t operator& (const Set< T, C > &s) const
 
- Public Member Functions inherited from GenTree< T, IdAdapter< T >, elm::Comparator< T > >
 GenTree (void)
 
 GenTree (const GenTree< T > &tree)
 
 ~GenTree (void)
 
const elm::Comparator< T > & comparator () const
 
elm::Comparator< T > & comparator ()
 
const DefaultAllocallocator () const
 
DefaultAllocallocator ()
 
T * get (const typename IdAdapter< T > ::key_t &key)
 
const T * get (const typename IdAdapter< T > ::key_t &key) const
 
void set (const T &item)
 
void removeByKey (const typename IdAdapter< T > ::key_t &item)
 
int count (void) const
 
bool contains (const typename IdAdapter< T > ::key_t &item) const
 
bool containsAll (const CC &c) const
 
bool isEmpty (void) const
 
 operator bool (void) const
 
Iter begin (void) const
 
Iter end (void) const
 
bool equals (const GenTree< T, IdAdapter< T >, elm::Comparator< T > > &tree) const
 
bool operator== (const GenTree< T, IdAdapter< T >, elm::Comparator< T > > &tree) const
 
bool operator!= (const GenTree< T, IdAdapter< T >, elm::Comparator< T > > &tree) const
 
void clear (void)
 
void add (const T &item)
 
void addAll (const CC &c)
 
void remove (const T &x)
 
void remove (const Iter &iter)
 
void removeAll (const CC &c)
 
self_toperator+= (const T &x)
 
self_toperator-= (const T &x)
 
void copy (const GenTree< T, IdAdapter< T >, elm::Comparator< T > > &tree)
 
GenTree< T, IdAdapter< T >, elm::Comparator< T > > & operator= (const GenTree< T, IdAdapter< T >, elm::Comparator< T > > &tree)
 
- Public Member Functions inherited from AbstractTree
int count (void) const
 
- Public Member Functions inherited from Comparator< T >
int doCompare (const T &v1, const T &v2) const
 
- Public Member Functions inherited from DefaultAllocatorDelegate
t::ptr allocate (t::size size) const
 
void free (t::ptr p) const
 
template<class T >
T * alloc () const
 

Additional Inherited Members

- Static Public Member Functions inherited from Comparator< T >
static int compare (const T &v1, const T &v2)
 
- Protected Types inherited from AbstractTree
enum  dir_t { LEFT = -1, NONE = 0, RIGHT = +1 }
 
typedef signed char balance_t
 
- Protected Member Functions inherited from GenTree< T, IdAdapter< T >, elm::Comparator< T > >
Noderoot (void) const
 
void remove (Stack &s, Node *n)
 
int compare (const typename IdAdapter< T > ::key_t &k1, const typename IdAdapter< T > ::key_t &k2) const
 
Nodelookup (Stack &s, const typename IdAdapter< T > ::key_t &key) const
 
Nodefind (const typename IdAdapter< T > ::key_t &key) const
 
void exchange (Node *n, Node *p)
 
- Protected Member Functions inherited from AbstractTree
 AbstractTree (void)
 
Node ** link (const Stack &s)
 
void exchange (Node *n, Node *m)
 
void insert (Stack &stack, Node *node)
 
void rotateRight (Stack &s)
 
void rotateLeft (Stack &s)
 
void remove (Stack &stack, Node *n)
 
NodeleftMost (Stack &s, Node *n)
 
- Protected Attributes inherited from AbstractTree
Node_root
 
int _cnt
 
- Static Protected Attributes inherited from AbstractTree
static const int MAX_HEIGHT = 32
 

Detailed Description

template<class T, class C = elm::Comparator<T>>
class elm::avl::Set< T, C >

Implements a set collection based on an AVL tree, that is, supporting access and modifications with a O(log n) complexity.

Implemented concepts
Parameters
TType of stored items.
CComparator used to sort the items (must implements the elm::concept::Comparator<T> concept, as a default elm::Comparator<T>).
See also
elm::avl::GenTree

Member Typedef Documentation

◆ base_t

typedef GenTree<T, IdAdapter<T>, C> base_t

◆ self_t

typedef Set<T, C> self_t

◆ t

typedef T t

Member Function Documentation

◆ diff()

void diff ( const Set< T, C > &  s)
inline

◆ insert()

void insert ( const T &  x)
inline

◆ join()

◆ meet()

◆ operator&()

self_t operator& ( const Set< T, C > &  s) const
inline

References Set< T, C >::meet().

◆ operator&=()

self_t& operator&= ( const Set< T, C > &  s)
inline

References Set< T, C >::meet().

◆ operator*()

self_t operator* ( const Set< T, C > &  s) const
inline

References Set< T, C >::meet().

◆ operator*=()

self_t& operator*= ( const Set< T, C > &  s)
inline

References Set< T, C >::meet().

◆ operator+()

self_t operator+ ( const Set< T, C > &  s) const
inline

References Set< T, C >::join().

◆ operator+=() [1/2]

self_t& operator+= ( const Set< T, C > &  s)
inline

References Set< T, C >::join().

◆ operator+=() [2/2]

self_t& operator+= ( const T &  x)
inline

References Set< T, C >::insert().

◆ operator-()

self_t operator- ( const Set< T, C > &  s) const
inline

References Set< T, C >::diff().

◆ operator-=() [1/2]

self_t& operator-= ( const Set< T, C > &  s)
inline

References Set< T, C >::diff().

◆ operator-=() [2/2]

self_t& operator-= ( const T &  x)
inline

◆ operator=()

self_t& operator= ( const self_t s)
inline

◆ operator|()

self_t operator| ( const Set< T, C > &  s) const
inline

References Set< T, C >::join().

◆ operator|=()

self_t& operator|= ( const Set< T, C > &  s)
inline

References Set< T, C >::join().

◆ subsetOf()

bool subsetOf ( const Set< T, C > &  s) const
inline

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