Lunchbox  1.8.0
Classes | Public Member Functions | List of all members
lunchbox::UnorderedIntervalSet< T > Class Template Reference

A container to store intervals of elements efficently. More...

#include <unorderedIntervalSet.h>

+ Collaboration diagram for lunchbox::UnorderedIntervalSet< T >:

Classes

struct  EdgeCompare

Public Member Functions

 UnorderedIntervalSet ()
 Construct a new interval set.
void insert (const T &element)
 Insert a new element.
void insert (const T &startElement, const T &endElement)
 Insert a new closed interval of elements.
void insert (const UnorderedIntervalSet &rhs)
 Insert another interval set into this.
void erase (const T &element)
 Remove the given element.
void erase (const T &startElement, const T &endElement)
 Remove all element inside the given closed interval.
void clear ()
 Remove all stored elements.
void swap (UnorderedIntervalSet &rhs)
 Swap this container with another one.
bool exists (const T &element) const
const_iterator find (const T &element) const
const_iterator begin () const
const_iterator end () const
size_t size () const
bool empty () const

Detailed Description

template<typename T>
class lunchbox::UnorderedIntervalSet< T >

A container to store intervals of elements efficently.

The type can be any class or typename which has the semantics of natural numbers for addition and comparison operations. The intervals are stored in an unordered fashion. Not thread-safe.

Definition at line 35 of file unorderedIntervalSet.h.

Constructor & Destructor Documentation

template<typename T >
lunchbox::UnorderedIntervalSet< T >::UnorderedIntervalSet ( )

Construct a new interval set.

Version
1.7.1

Member Function Documentation

template<typename T >
const_iterator lunchbox::UnorderedIntervalSet< T >::begin ( ) const
Returns
an iterator to the first element.
Version
1.7.1
template<typename T >
void lunchbox::UnorderedIntervalSet< T >::clear ( )

Remove all stored elements.

Version
1.7.1
template<typename T >
bool lunchbox::UnorderedIntervalSet< T >::empty ( ) const
Returns
true if container is empty.
Version
1.7.1
template<typename T >
const_iterator lunchbox::UnorderedIntervalSet< T >::end ( ) const
Returns
an iterator to the end of the interval set.
Version
1.7.1
template<typename T >
void lunchbox::UnorderedIntervalSet< T >::erase ( const T &  element)

Remove the given element.

Version
1.7.1
template<typename T >
void lunchbox::UnorderedIntervalSet< T >::erase ( const T &  startElement,
const T &  endElement 
)

Remove all element inside the given closed interval.

Version
1.7.1
template<typename T >
bool lunchbox::UnorderedIntervalSet< T >::exists ( const T &  element) const
Returns
true if element exists.
Version
1.7.1
template<typename T >
const_iterator lunchbox::UnorderedIntervalSet< T >::find ( const T &  element) const
Returns
an iterator to element if stored, end() otherwise.
Version
1.7.1
template<typename T >
void lunchbox::UnorderedIntervalSet< T >::insert ( const T &  element)

Insert a new element.

Version
1.7.1
template<typename T >
void lunchbox::UnorderedIntervalSet< T >::insert ( const T &  startElement,
const T &  endElement 
)

Insert a new closed interval of elements.

Version
1.7.1
template<typename T >
void lunchbox::UnorderedIntervalSet< T >::insert ( const UnorderedIntervalSet< T > &  rhs)

Insert another interval set into this.

Version
1.7.1
template<typename T >
size_t lunchbox::UnorderedIntervalSet< T >::size ( ) const
Returns
the number of elements in the stored intervals.
Version
1.7.1
template<typename T >
void lunchbox::UnorderedIntervalSet< T >::swap ( UnorderedIntervalSet< T > &  rhs)

Swap this container with another one.

Version
1.7.1

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