mc2lib
Public Types | Public Member Functions | Protected Attributes | List of all members
mc2lib::sets::Set< Ts > Class Template Reference

Abstracts over container library's set implementation. More...

#include <sets.hpp>

Public Types

typedef Ts::Element Element
 
typedef Ts::SetContainer Container
 

Public Member Functions

 Set ()
 
 Set (Container s)
 
const Containerget () const
 
bool operator== (const Set &rhs) const
 
bool operator!= (const Set &rhs) const
 
const ElementInsert (const Element &e, bool assert_unique=false)
 
const ElementInsert (Element &&e, bool assert_unique=false)
 
bool Erase (const Element &e, bool assert_exists=false)
 
template<class FilterFunc >
Set Filter (FilterFunc filterFunc) const
 
void Clear ()
 
bool Contains (const Element &e) const
 
Setoperator|= (const Set &rhs)
 
Setoperator|= (Set &&rhs)
 
Setoperator-= (const Set &rhs)
 
Setoperator &= (const Set &rhs)
 
std::size_t size () const
 
bool empty () const
 
bool SubsetEq (const Set &s) const
 
bool Subset (const Set &s) const
 

Protected Attributes

Container set_
 

Detailed Description

template<class Ts>
class mc2lib::sets::Set< Ts >

Abstracts over container library's set implementation.

Provides additional functions and operators not provided in the standard library.

Member Typedef Documentation

§ Container

template<class Ts>
typedef Ts::SetContainer mc2lib::sets::Set< Ts >::Container

§ Element

template<class Ts>
typedef Ts::Element mc2lib::sets::Set< Ts >::Element

Constructor & Destructor Documentation

§ Set() [1/2]

template<class Ts>
mc2lib::sets::Set< Ts >::Set ( )
inline

§ Set() [2/2]

template<class Ts>
mc2lib::sets::Set< Ts >::Set ( Container  s)
inlineexplicit

Member Function Documentation

§ Clear()

template<class Ts>
void mc2lib::sets::Set< Ts >::Clear ( )
inline

§ Contains()

template<class Ts>
bool mc2lib::sets::Set< Ts >::Contains ( const Element e) const
inline

§ empty()

template<class Ts>
bool mc2lib::sets::Set< Ts >::empty ( ) const
inline

§ Erase()

template<class Ts>
bool mc2lib::sets::Set< Ts >::Erase ( const Element e,
bool  assert_exists = false 
)
inline

Erase element.

Parameters
eElement to be erased.
assert_existsAssert that element exists.

§ Filter()

template<class Ts>
template<class FilterFunc >
Set mc2lib::sets::Set< Ts >::Filter ( FilterFunc  filterFunc) const
inline

§ get()

template<class Ts>
const Container& mc2lib::sets::Set< Ts >::get ( ) const
inline

Provide access to underlying container.

Returns
Reference to underlying container.

§ Insert() [1/2]

template<class Ts>
const Element& mc2lib::sets::Set< Ts >::Insert ( const Element e,
bool  assert_unique = false 
)
inline

Insert element.

Parameters
eElement to be inserted.
assert_uniqueAssert that element does not exist in container.
Returns
Reference to inserted Element.

§ Insert() [2/2]

template<class Ts>
const Element& mc2lib::sets::Set< Ts >::Insert ( Element &&  e,
bool  assert_unique = false 
)
inline

Insert element.

Parameters
eElement to be inserted.
assert_uniqueAssert that element does not exist in container.
Returns
Reference to inserted Element.

§ operator &=()

template<class Ts>
Set& mc2lib::sets::Set< Ts >::operator&= ( const Set< Ts > &  rhs)
inline

Set intersection

§ operator!=()

template<class Ts>
bool mc2lib::sets::Set< Ts >::operator!= ( const Set< Ts > &  rhs) const
inline

§ operator-=()

template<class Ts>
Set& mc2lib::sets::Set< Ts >::operator-= ( const Set< Ts > &  rhs)
inline

Set difference.

§ operator==()

template<class Ts>
bool mc2lib::sets::Set< Ts >::operator== ( const Set< Ts > &  rhs) const
inline

§ operator|=() [1/2]

template<class Ts>
Set& mc2lib::sets::Set< Ts >::operator|= ( const Set< Ts > &  rhs)
inline

Set union.

§ operator|=() [2/2]

template<class Ts>
Set& mc2lib::sets::Set< Ts >::operator|= ( Set< Ts > &&  rhs)
inline

§ size()

template<class Ts>
std::size_t mc2lib::sets::Set< Ts >::size ( ) const
inline

§ Subset()

template<class Ts>
bool mc2lib::sets::Set< Ts >::Subset ( const Set< Ts > &  s) const
inline

§ SubsetEq()

template<class Ts>
bool mc2lib::sets::Set< Ts >::SubsetEq ( const Set< Ts > &  s) const
inline

Member Data Documentation

§ set_

template<class Ts>
Container mc2lib::sets::Set< Ts >::set_
protected

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