Class template map
Class template map
boost::icl::map — Addable, subractable and intersectable maps.
Synopsis
template < typename DomainT, typename CodomainT,
typename Traits = icl::partial_absorber ,
ICL_COMPARE Compare = ICL_COMPARE_INSTANCE ( ICL_COMPARE_DEFAULT , DomainT ) ,
ICL_COMBINE Combine = ICL_COMBINE_INSTANCE ( icl::inplace_plus , CodomainT ) ,
ICL_SECTION Section = ICL_SECTION_INSTANCE ( icl::inter_section , CodomainT ) ,
ICL_ALLOC Alloc = std :: allocator >
class map : private ICL_IMPL_SPACE::map< DomainT, CodomainT, ICL_COMPARE_DOMAIN(Compare, DomainT), Alloc< std::pair< const DomainT, CodomainT > > >
{
public :
typedef Alloc < typename std :: pair < const DomainT , CodomainT > > allocator_type ;
typedef icl::map < DomainT , CodomainT , Traits , Compare , Combine , Section , Alloc > type ;
typedef ICL_IMPL_SPACE :: map < DomainT , CodomainT , ICL_COMPARE_DOMAIN ( Compare , DomainT ) , allocator_type > base_type ;
typedef Traits traits ;
typedef DomainT domain_type ;
typedef boost :: call_traits < DomainT > :: param_type domain_param ;
typedef DomainT key_type ;
typedef CodomainT codomain_type ;
typedef CodomainT mapped_type ;
typedef CodomainT data_type ;
typedef std :: pair < const DomainT , CodomainT > element_type ;
typedef std :: pair < const DomainT , CodomainT > value_type ;
typedef domain_compare key_compare ;
typedef inverse < codomain_combine > :: type inverse_codomain_combine ;
typedef mpl :: if_ < has_set_semantics < codomain_type > , ICL_SECTION_CODOMAIN ( Section , CodomainT ) , codomain_combine > :: type codomain_intersect ;
typedef inverse < codomain_intersect > :: type inverse_codomain_intersect ;
typedef base_type :: value_compare value_compare ;
typedef ICL_IMPL_SPACE :: set < DomainT , domain_compare , Alloc < DomainT > > set_type ;
typedef set_type key_object_type ;
typedef on_absorbtion < type , codomain_combine , Traits :: absorbs_identities > on_identity_absorbtion ;
typedef base_type :: pointer pointer ;
typedef base_type :: const_pointer const_pointer ;
typedef base_type :: reference reference ;
typedef base_type :: const_reference const_reference ;
typedef base_type :: iterator iterator ;
typedef base_type :: const_iterator const_iterator ;
typedef base_type :: size_type size_type ;
typedef base_type :: difference_type difference_type ;
typedef base_type :: reverse_iterator reverse_iterator ;
typedef base_type :: const_reverse_iterator const_reverse_iterator ;
template < typename Type, bool has_set_semantics, bool absorbs_identities>
struct on_codomain_model {
} ;
template < typename Type>
struct on_codomain_model < Type , false , false > {
static void subtract ( Type & , typename Type :: iterator ,
const typename Type :: codomain_type & ) ;
} ;
template < typename Type>
struct on_codomain_model < Type , false , true > {
static void subtract ( Type & , typename Type :: iterator ,
const typename Type :: codomain_type & ) ;
} ;
template < typename Type>
struct on_codomain_model < Type , true , false > {
typedef Type :: inverse_codomain_intersect inverse_codomain_intersect ;
static void subtract ( Type & , typename Type :: iterator ,
const typename Type :: codomain_type & ) ;
} ;
template < typename Type>
struct on_codomain_model < Type , true , true > {
typedef Type :: inverse_codomain_intersect inverse_codomain_intersect ;
static void subtract ( Type & , typename Type :: iterator ,
const typename Type :: codomain_type & ) ;
} ;
template < typename Type, bool is_total>
struct on_definedness {
} ;
template < typename Type>
struct on_definedness < Type , false > {
static void add_intersection ( Type & , const Type & , const element_type & ) ;
} ;
template < typename Type>
struct on_definedness < Type , true > {
static void add_intersection ( Type & , const Type & , const element_type & ) ;
} ;
template < typename Type, bool is_total_invertible>
struct on_invertible {
} ;
template < typename Type>
struct on_invertible < Type , false > {
typedef Type :: element_type element_type ;
typedef Type :: inverse_codomain_combine inverse_codomain_combine ;
static void subtract ( Type & , const element_type & ) ;
} ;
template < typename Type>
struct on_invertible < Type , true > {
typedef Type :: element_type element_type ;
typedef Type :: inverse_codomain_combine inverse_codomain_combine ;
static void subtract ( Type & , const element_type & ) ;
} ;
template < typename Type, bool is_total, bool absorbs_identities>
struct on_total_absorbable {
} ;
template < typename Type>
struct on_total_absorbable < Type , false , false > {
typedef Type :: element_type element_type ;
typedef Type :: codomain_type codomain_type ;
typedef Type :: iterator iterator ;
typedef Type :: inverse_codomain_intersect inverse_codomain_intersect ;
static void flip ( Type & , const element_type & ) ;
} ;
template < typename Type>
struct on_total_absorbable < Type , false , true > {
typedef Type :: element_type element_type ;
typedef Type :: codomain_type codomain_type ;
typedef Type :: iterator iterator ;
typedef Type :: inverse_codomain_intersect inverse_codomain_intersect ;
static void flip ( Type & , const element_type & ) ;
} ;
template < typename Type>
struct on_total_absorbable < Type , true , false > {
typedef Type :: element_type element_type ;
typedef Type :: codomain_type codomain_type ;
static void flip ( Type & , const element_type & ) ;
} ;
template < typename Type>
struct on_total_absorbable < Type , true , true > {
typedef Type :: element_type element_type ;
static void flip ( Type & , const typename Type :: element_type & ) ;
} ;
map ( ) ;
map ( const key_compare & ) ;
template < typename InputIterator> map ( InputIterator , InputIterator ) ;
template < typename InputIterator>
map ( InputIterator , InputIterator , const key_compare & ) ;
map ( const map & ) ;
explicit map ( const element_type & ) ;
map ( map && ) ;
map & operator = ( map ) ;
typedef ICL_COMPARE_DOMAIN ( Compare , DomainT ) ;
typedef ICL_COMBINE_CODOMAIN ( Combine , CodomainT ) ;
typedef ICL_COMPARE_DOMAIN ( Compare , element_type ) ;
BOOST_STATIC_CONSTANT ( bool , _total = ( Traits :: is_total ) ) ;
BOOST_STATIC_CONSTANT ( bool , _absorbs = ( Traits :: absorbs_identities ) ) ;
BOOST_STATIC_CONSTANT ( bool ,
total_invertible = ( mpl :: and_ < is_total < type > , has_inverse < codomain_type > > :: value ) ) ;
BOOST_STATIC_CONSTANT ( bool ,
is_total_invertible = ( Traits :: is_total && has_inverse < codomain_type > :: value ) ) ;
BOOST_STATIC_CONSTANT ( int , fineness = 4 ) ;
void swap ( map & ) ;
template < typename SubObject> bool contains ( const SubObject & ) const ;
bool within ( const map & ) const ;
std :: size_t iterative_size ( ) const ;
codomain_type operator ( ) ( const domain_type & ) const ;
map & add ( const value_type & ) ;
iterator add ( iterator , const value_type & ) ;
map & subtract ( const element_type & ) ;
map & subtract ( const domain_type & ) ;
std :: pair < iterator , bool > insert ( const value_type & ) ;
iterator insert ( iterator , const value_type & ) ;
template < typename Iterator> iterator insert ( Iterator , Iterator ) ;
map & set ( const element_type & ) ;
size_type erase ( const element_type & ) ;
void add_intersection ( map & , const element_type & ) const ;
map & flip ( const element_type & ) ;
template < typename Combiner>
map < DomainT , CodomainT , Traits , Compare , Combine , Section , Alloc > &
_add ( const element_type & ) ;
template < typename Combiner>
map < DomainT , CodomainT , Traits , Compare , Combine , Section , Alloc > :: iterator
_add ( iterator , const value_type & ) ;
template < typename Combiner>
map < DomainT , CodomainT , Traits , Compare , Combine , Section , Alloc > &
_subtract ( const value_type & ) ;
template < typename Combiner> map & _add ( const element_type & ) ;
template < typename Combiner> iterator _add ( iterator , const element_type & ) ;
template < typename Combiner> map & _subtract ( const element_type & ) ;
template < typename FragmentT>
void total_add_intersection ( type & , const FragmentT & ) const ;
void partial_add_intersection ( type & , const element_type & ) const ;
} ;
Description
map
public
construct/copy/destruct
<map ( ) ; >
<map ( const key_compare & comp) ; >
<template < typename InputIterator> map ( InputIterator first, InputIterator past) ; >
<template < typename InputIterator>
map ( InputIterator first, InputIterator past, const key_compare & comp) ; >
<map ( const map & src) ; >
<explicit map ( const element_type & key_value_pair) ; >
<map ( map && src) ; >
<map & operator = ( map src) ; >
map
public member functions
<typedef ICL_COMPARE_DOMAIN ( Compare , DomainT ) ; >
<typedef ICL_COMBINE_CODOMAIN ( Combine , CodomainT ) ; >
<typedef ICL_COMPARE_DOMAIN ( Compare , element_type ) ; >
<BOOST_STATIC_CONSTANT ( bool , _total = ( Traits :: is_total ) ) ; >
<BOOST_STATIC_CONSTANT ( bool , _absorbs = ( Traits :: absorbs_identities ) ) ; >
<BOOST_STATIC_CONSTANT ( bool ,
total_invertible = ( mpl :: and_ < is_total < type > , has_inverse < codomain_type > > :: value ) ) ; >
<BOOST_STATIC_CONSTANT ( bool ,
is_total_invertible = ( Traits :: is_total && has_inverse < codomain_type > :: value ) ) ; >
<BOOST_STATIC_CONSTANT ( int , fineness = 4 ) ; >
<void swap ( map & src) ; >
<template < typename SubObject> bool contains ( const SubObject & sub) const ; >
<bool within ( const map & super) const ; >
<std :: size_t iterative_size ( ) const ; ><iterative_size()
>дает число элементов, которые посещаются после полной итерации. Для интервальных наборов<iterative_size()
>отличается от<size()
>
.
<codomain_type operator ( ) ( const domain_type & key) const ; >Полная функция выбора.
<map & add ( const value_type & value_pair) ; ><add
>вставляет<value_pair
>в карту, если на карте нет ключа. Если<value_pairs's
>ключевое значение существует на карте, его значение данных добавляется к значению данных, уже найденному на карте.
<iterator add ( iterator prior, const value_type & value_pair) ; ><add
>добавить<value_pair
>в карту, используя<prior
>в качестве подсказки для вставки<value_pair
>после того, как положение<prior
>указывает на.
<map & subtract ( const element_type & value_pair) ; >Если ключевое значение<value_pair's
>находится на карте, его значение данных вычитается из значения данных, хранящегося на карте.
<map & subtract ( const domain_type & key) ; >
<std :: pair < iterator , bool > insert ( const value_type & value_pair) ; >
<iterator insert ( iterator prior, const value_type & value_pair) ; >
<template < typename Iterator> iterator insert ( Iterator first, Iterator last) ; >
<map & set ( const element_type & key_value_pair) ; >С<key_value_pair = (k,v)
>заданным значением<v
>для ключа<k
>
<size_type erase ( const element_type & key_value_pair) ; >стереть<key_value_pair
>с карты. Стирается только в том случае, если для данного ключа сохраняется точное значение содержимого<val
>.
<void add_intersection ( map & section, const element_type & key_value_pair) const ; >Пересечение<key_value_pair
>и<*this
>карты добавлено к<section
>
.
<map & flip ( const element_type & operand) ; >
<template < typename Combiner>
map < DomainT , CodomainT , Traits , Compare , Combine , Section , Alloc > &
_add ( const element_type & addend) ; >
<template < typename Combiner>
map < DomainT , CodomainT , Traits , Compare , Combine , Section , Alloc > :: iterator
_add ( iterator prior_, const value_type & addend) ; >
<template < typename Combiner>
map < DomainT , CodomainT , Traits , Compare , Combine , Section , Alloc > &
_subtract ( const value_type & minuend) ; >
map
private member functions
<template < typename Combiner> map & _add ( const element_type & value_pair) ; >
<template < typename Combiner>
iterator _add ( iterator prior, const element_type & value_pair) ; >
<template < typename Combiner> map & _subtract ( const element_type & value_pair) ; >
<template < typename FragmentT>
void total_add_intersection ( type & section, const FragmentT & fragment) const ; >
<void partial_add_intersection ( type & section, const element_type & operand) const ; >
Статья Class template map раздела Chapter 1. Boost.Icl Header <boost/icl/map.hpp> может быть полезна для разработчиков на c++ и boost.
Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.
:: Главная :: Header <boost/icl/map.hpp> ::