Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Interface

Class templates
Required Concepts
Associated Types
Function Synopsis

Section Interface outlines types and functions of the Itl. Synoptical tables allow to review the overall structure of the libraries design and to focus on structural equalities and differences with the corresponding containers of the standard template library.

The next two tables give an overview over set class templates of the itl and compares them to std::set. Included is the interval class template, because an interval is considered to be a set as well.

Table1.5.Set class templates

group

template

instance parameters

interval

interval

<DomainT,Compare>

interval_sets

interval_set

<DomainT,Compare,Interval,Alloc>

separate_interval_set

<DomainT,Compare,Interval,Alloc>

split_interval_set

<DomainT,Compare,Interval,Alloc>

itl::set

itl::set

<DomainT,Compare, Alloc>

std::set

std::set

<_Key, _Compare, _Alloc>


Templates and template parameters, given in the preceding table are described in detail below. Interval_sets represent three class templates interval_set, separate_interval_set and split_interval_set that all have equal template parameters.

Table1.6.Parameters of set class templates

type of elements

order of elements

type of intervals

memory allocation

template parameter

class

template <class>class

template <class, template<class>class> class

template <class>class

interval

DomainT

Compare = std::less

interval_sets

DomainT

Compare = std::less

Interval = itl::interval

Alloc = std::alloc

itl::set

DomainT

Compare = std::less

Alloc = std::alloc

template parameter

class

class

class

class

std::set

_Key

_Compare = std::less<_Key>

Alloc = std::alloc<_Key>


The next two tables give an overview over map class templates of the itl and compares them to std::map.

Table1.7.map class templates

group

template

instance parameters

interval_maps

interval_map

<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>

split_interval_map

<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>

itl::map

itl::map

<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>

std::map

std::map

<_Key, _Data, _Compare, _Alloc>


Templates and template parameters, given in the preceding table are described in detail below. Interval_maps represent two class templates interval_map and split_interval_map that all have equal template parameters.

Table1.8.Parameters of map class templates

elements

mapped values

traits

order of elements

aggregation propagation

intersection propagation

type of intervals

memory allocation

template parameter

class

class

class

template <class>class

template <class>class

template <class>class

template <class, template<class>class> class

template <class>class

interval_maps

DomainT

CodomainT

Traits = neutron_absorber

Compare = std::less

Combine = inplace_plus

Section = itl::inplace_et

Interval = itl::interval

Alloc = std::alloc

itl::map

DomainT

CodomainT

Traits = neutron_absorber

Compare = std::less

Combine = inplace_plus

Section = itl::inplace_et

Alloc = std::alloc

template parameter

class

class

class

class

std::map

_Key

_Data

_Compare = std::less<_Key>

Alloc = std::alloc<_Key>


Using the following placeholders,

D  := class DomainT,
C  := class CodomainT,
T  := class Traits,
Cp := class Compare = std::less<DomainT>,
cp := template<class D>class Compare = std::less,
cb := template<class C>class Combine = itl::inplace_plus,
s  := template<class C>class Section = itl::inplace_et,
i  := template<class D,template<class>class cp>class Interval = itl::interval
Ad := class Alloc = std::allocator<DomainT>
Av := class Alloc = std::allocator<std::pair<DomainT,CodomainT> >
a  := template<class>class Alloc = std::allocator

we arrive at a final synoptical matrix of class templates and their parameters.

interval     <D,       cp,             >
interval_sets<D,       cp,        i, a >
itl::set     <D,       cp,           a >
std::set     <D,       Cp,           Ad>
interval_maps<D, C, T, cp, cb, s, i, a >
itl::map     <D, C, T, cp, cb, s,    a >
std::map     <D, C     Cp,           Av>

The choice of parameters and their positions follow the std::containers as close a possible, so that usage of interval sets and maps does only require minimal additional knowledge.

Additional knowledge is required when instantiating a comparison parameter Compare or an allocation parameter Alloc. In contrast to std::containers these have to be instantiated as templates, like e.g.

interval_set<string, german_compare>      sections; // 2nd parameter is a template
std::set<string, german_compare<string> > words;    // 2nd parameter is a type


PrevUpHomeNext