Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function Synopsis

In this section a single matrix is given, that shows all functions with shared names and identical or analogous semantics and their polymorphical overloads across the class templates of the itl. Associated are the corresponding functions of the stl for easy comparison. In order to achieve a concise representation, a series of placeholders are used throughout the function matrix.

The placeholder's purpose is to express the polymorphic usage of the functions. The first column of the function matrix contains the signatures of the functions. Within these signatures T denotes a container type and J and P polymorphic argument and result types.

Within the body of the matrix, sets of boldface placeholders denote the sets of possible instantiations for a polymorphic placeholder P. For instance e i S denotes that for the argument type P, an element e, an interval i or an interval_set S can be instantiated.

If the polymorphism can not be described in this way, only the number of overloaded implementations for the function of that row is shown.

Placeholder

Argument types

Description

T

a container type

P

polymorphical container argument type

J

polymorphical iterator type

V

various types V, that do dot fall in the categories above

1,2,...

number of implementations for this function

A

implementation generated by compilers

e

T::element_type

the element type of interval_sets or itl::sets

i

T::segment_type

the segment type of of interval_sets

s

itl::set

itl's set type

S

interval_sets

one of the interval set types

b

T::element_type

type of interval_map's or itl::map's element value pairs

p

T::segment_type

type of interval_map's interval value pairs

m

itl::map

itl's map type

M

interval_maps

one of the interval map types

Table 1.10. Itl Interfaces

T

interval

interval
sets

interval
maps

itl::set

itl::map

std::set

std::map

Construct, copy, destruct

T::T()

1

1

1

1

1

1

1

T::T(const P&)

A

e i S

b p M

1

1

1

1

T& T::operator=(const P&)

A

S

M

1

1

1

1

void T::swap(T&)

1

1

1

1

1

1

Containedness

interval

interval
sets

interval
maps

itl::set

itl::map

std::set

std::map

void T::clear()

1

1

1

1

1

1

1

bool T::empty()const

1

1

1

1

1

1

1

bool T::contains(const P&)const

e i

e i S

e i S b p M

e s

b m

bool T::contained_in(const P&)const

i

S

M

1

1

Equivalences and Orderings

interval

interval
sets

interval
maps

itl::set

itl::map

std::set

std::map

bool operator == (const T&, const T&)

1

1

1

1

1

1

1

bool operator != (const T&, const T&)

1

1

1

1

1

1

1

bool operator < (const T&, const T&)

1

1

1

1

1

1

1

bool operator > (const T&, const T&)

1

1

1

1

1

1

1

bool operator <= (const T&, const T&)

1

1

1

1

1

1

1

bool operator >= (const T&, const T&)

1

1

1

1

1

1

1

bool is_element_equal(const T&, const P&)

S

M

1

1

bool is_element_less(const T&, const P&)

S

M

1

1

bool is_element_greater(const T&, const P&)

S

M

1

1

bool is_protonic_equal(const T&, const P&)

M

1

Size

interval

interval
sets

interval
maps

itl::set

itl::map

std::set

std::map

size_type T::size()const

1

1

1

1

1

1

1

size_type T::cardinality()const

1

1

1

1

1

difference_type T::length()const

1

1

1

size_t T::iterative_size()const

1

1

1

1

size_t T::interval_count()const

1

1

Range

interval<domain_type> hull(const T&)

1

1

domain_type T::lower()const

1

1

1

domain_type T::upper()const

1

1

1

domain_type T::first()const

1

1

1

domain_type T::last()const

1

1

1

Selection

J T::find(const domain_type&)

1

1

2

2

2

2

codomain_type& operator[] (const domain_type&)

1

1

codomain_type operator() (const domain_type&)const

1

1

Addition

interval

interval
sets

interval
maps

itl::set

itl::map

std::set

std::map

T& T::add(const P&)

e i

b p

e

b

T& T::add(J pos, const P&)

i

p

e

b

T& operator +=(T&, const P&)

e i S

b p M

e s

b m

T operator + (T, const P&)
T operator + (const P&, T)

e i S

b p M

e s

b m

T& operator |=( T&, const P&)

e i S

b p M

e s

b m

T operator | (T, const P&)
T operator | (const P&, T)

e i S

b p M

e s

b m

Subtraction

T& T::subtract(const P&)

e i

b p

e

b

T& operator -=( T&, const P&)

e i S

e i S b p M

e s

b m

T operator - (T, const P&)

e i S

e i S b p M

e s

b m

Insertion

interval

interval
sets

interval
maps

itl::set

itl::map

std::set

std::map

V T::insert(const P&)

e i

b p

e

b

e

b

V T::insert(J pos, const P&)

i

p

e

b

e

b

T& insert(T&, const P&)

e i S

b p M

e s

b m

T& T::set(const P&)

b p

1

Erasure

T& T::erase(const P&)

e i

e i b p

e

b p

e

e

T& erase(T&, const P&)

e i S

e i S b p M

e s

b m

void T::erase(iterator)

1

1

1

1

1

1

void T::erase(iterator,iterator)

1

1

1

1

1

1

Intersection

interval

interval
sets

interval
maps

itl::set

itl::map

std::set

std::map

void T::add_intersection(T&, const P&)const

e i S

e i S b p M

T& operator &=(T&, const P&)

i

e i S

e i S b p M

e s

b m

T operator & (T, const P&)
T operator & (const P&, T)

i

e i S

e i S b p M

e s

b m

bool intersects(const T&, const P&)

i

e i S

e i S b p M

e s

b m

Symmetric difference

T& T::flip(const P&)

e i

b p

e

b

T& operator ^=(T&, const P&)

e i S

b p M

e s

b m

T operator ^ (T, const P&)
T operator ^ (const P&, T)

e i S

b p M

e s

b m

Iterator related

interval

interval
sets

interval
maps

itl::set

itl::map

std::set

std::map

J T::begin()

2

2

2

2

2

2

J T::end()

2

2

2

2

2

2

J T::rbegin()

2

2

2

2

2

2

J T::rend()

2

2

2

2

2

2

J T::lower_bound(const key_type&)

2

2

2

2

2

2

J T::upper_bound(const key_type&)

2

2

2

2

2

2

pair<J,J> T::equal_range(const key_type&)

2

2

2

2

2

2

Streaming, conversion

interval

interval
sets

interval
maps

itl::set

itl::map

std::set

std::map

std::basic_ostream operator << (basic_ostream&, const T&)

1

1

1

1

1

1

1

std::string T::as_string()

1

1

1

1

1


Element iterators for interval containers

Iterators on interval conainers that are refered to so far are segment iterators. They reveal the more implementation specific aspect, that the fundamental aspect abstracts from. Iteration over segments is fast, compared to an iteration over elements, particularly if intervals are large. But if we want to view our interval containers as containers of elements that are usable with std::algoritms, we need to iterate over elements.

Iteration over elements . . .

On the other hand, sometimes iteration over interval containers on the element level might be desired, if you have some interface that works for std::SortedAssociativeContainers of elements and you need to quickly use it with an interval container. Accepting the poorer performance might be less bothersome at times than adjusting your whole interface for segment iteration.

[Caution] Caution

So we advice you to choose element iteration over interval containers judiciously. Do not use element iteration by default or habitual. Always try to achieve results using member functions, global functions or operators (preferably inplace versions) or iteration over segments first.

Table 1.11. Element iterators for interval containers

Element iteration

interval
sets

interval
maps

J T::elements_begin()

2

2

J T::elements_end()

2

2

J T::elements_rbegin()

2

2

J T::elements_rend()

2

2



PrevUpHomeNext