Home | Libraries | People | FAQ | More |
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.
Table 1.5. Set class templates
group |
template |
instance parameters |
---|---|---|
|
||
|
||
|
|
|
|
|
|
|
||
|
|
|
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.
Table 1.6. Parameters of set class templates
|
type of elements |
order of elements |
type of intervals |
memory allocation |
---|---|---|---|---|
template parameter |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template parameter |
|
|
|
class |
|
|
|
|
|
The next two tables give an overview over map
class templates of the itl and compares them to std::map
.
Table 1.7. map class templates
group |
template |
instance parameters |
---|---|---|
|
||
|
|
|
|
||
|
|
|
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.
Table 1.8. Parameters of map class templates
|
elements |
mapped values |
traits |
order of elements |
aggregation propagation |
intersection propagation |
type of intervals |
memory allocation |
---|---|---|---|---|---|---|---|---|
template parameter |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
template parameter |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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