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

#include </home/casse/Dev/elm/src/concepts.h>

+ Inheritance diagram for Set< T >:

Public Member Functions

void insert (const T &item)
 
bool subsetOf (const Set &coll)
 
bool operator>= (const Set &coll)
 
bool operator<= (const Set &coll)
 
bool operator> (const Set &coll)
 
bool operator< (const Collection &coll)
 
bool operator<= (const T &item)
 
void join (const Set< T > &set)
 
void meet (const Set< T > &set)
 
void diff (const Set< T > &set)
 
Set< T > operator+= (const Set< T > set)
 
Set< T > operator|= (const Set< T > set)
 
Set< T > operator-= (const Set< T > set)
 
Set< T > operator&= (const Set< T > set)
 
Set< T > operator*= (const Set< T > set)
 
Set< T > operator+ (const Set &set)
 
Set< T > operator| (const Set &set)
 
Set< T > operator* (const Set &set)
 
Set< T > operator& (const Set &set)
 
Set< T > operator- (const Set &set)
 
- Public Member Functions inherited from MutableCollection< T >
MutableIter< T > begin ()
 
MutableIter< T > end ()
 
void clear (void)
 
void add (const T &item)
 
void addAll (const Collection< T > &items)
 
void remove (const T &item)
 
void removeAll (const Collection< T > &items)
 
void remove (const Iterator< T > &iter)
 
MutableCollection< T > & operator+= (const T &item)
 
MutableCollection< T > & operator-= (const T &item)
 
void copy (const Collection< T > &items)
 
MutableCollectionoperator= (const Collection< T > &c)
 
- Public Member Functions inherited from Collection< T >
int count (void)
 
bool contains (const T &item)
 
template<template< class _ > class C>
bool containsAll (const C< T > &collection)
 
bool isEmpty (void)
 
 operator bool (void)
 
Iter begin (void) const
 
Iter end (void) const
 
bool equals (const Collection &coll)
 
bool operator== (const Collection &coll)
 
bool operator!= (const Collection &coll)
 

Additional Inherited Members

- Public Types inherited from Collection< T >
typedef T t
 
typedef Collection< T > self_t
 
- Static Public Attributes inherited from Collection< T >
static const Collection null
 
static const Collection< T > null
 

Detailed Description

template<class T>
class elm::concept::Set< T >

This concept provides methods to handle a set of objects Usually, sets provides efficient way to look for, insert or remove items and contains only one version of each item.

Additionally, this concept must support an external operation "is in":

bool operator<=(const T& val, const Set<T>& set);

That just call the contains() function.

Implemented by:
Parameters
TType of stored items.

Member Function Documentation

◆ diff()

void diff ( const Set< T > &  set)

Perform the difference of the current set and the given one.

Parameters
setSet to make difference with.

◆ insert()

void insert ( const T &  item)

Insert an item in the set avoiding item duplication.

Note
If the set does not support duplicate, add() is may be implemented as an insert.

◆ join()

void join ( const Set< T > &  set)

Perform the join of the current set and the given one.

Parameters
setSet to join with.

◆ meet()

void meet ( const Set< T > &  set)

Perform the meet of the current set and the given one.

Parameters
setSet to meet with.

◆ operator&()

Set<T> operator& ( const Set< T > &  set)

Build a new set meeting the current set and the given one.

Parameters
setMet set.

◆ operator&=()

Set<T> operator&= ( const Set< T >  set)

Shortcut to meet().

◆ operator*()

Set<T> operator* ( const Set< T > &  set)

Build a new set meeting the current set and the given one.

Parameters
setMet set.

◆ operator*=()

Set<T> operator*= ( const Set< T >  set)

Shortcut to meet().

◆ operator+()

Set<T> operator+ ( const Set< T > &  set)

Build a new set joining the current set and the given one.

Parameters
setJoined set.

◆ operator+=()

Set<T> operator+= ( const Set< T >  set)

Shortcut to join().

◆ operator-()

Set<T> operator- ( const Set< T > &  set)

Build a new set making the difference between the current set and the given one.

Parameters
setDifference set.

◆ operator-=()

Set<T> operator-= ( const Set< T >  set)

Shortcut to diff().

◆ operator<()

bool operator< ( const Collection coll)

Same as contains() with reversed arguments and not equals().

◆ operator<=() [1/2]

bool operator<= ( const Set< T > &  coll)

Same as reversed argument contains().

◆ operator<=() [2/2]

bool operator<= ( const T &  item)

Same as contains.

◆ operator>()

bool operator> ( const Set< T > &  coll)

Same as contains() and not equals().

◆ operator>=()

bool operator>= ( const Set< T > &  coll)

Same as contains().

◆ operator|()

Set<T> operator| ( const Set< T > &  set)

Build a new set joining the current set and the given one.

Parameters
setJoined set.

◆ operator|=()

Set<T> operator|= ( const Set< T >  set)

Shortcut to join().

◆ subsetOf()

bool subsetOf ( const Set< T > &  coll)

Test if the current collection is a subet of the given one.

Parameters
collCollection to test.
Returns
True if the current collection is a subet of coll, false else.

The documentation for this class was generated from the following file:
elm::concept::Set::operator<=
bool operator<=(const Set &coll)