Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Class template interval_base_map

Boost , Chapter 1. Boost.Icl , Header <boost/icl/interval_base_map.hpp>

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class template interval_base_map

boost::icl::interval_base_map — Implements a map as a map of intervals (base class)

Synopsis

// In header: <boost/icl/interval_base_map.hpp>
template<typename SubType, 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_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, DomainT, Compare), 
         ICL_ALLOC Alloc = std::allocator> 
class interval_base_map {
public:
  // types
  typedef interval_base_map< SubType, DomainT, CodomainT, Traits, Compare, Combine, Section, Interval, Alloc >             type;                          
  typedef SubType                                                                                                          sub_type;                        // The designated derived or sub_type of this base class. 
  typedef type                                                                                                             overloadable_type;               // Auxilliary type for overloadresolution. 
  typedef Traits                                                                                                           traits;                          // Traits of an itl map. 
  typedef icl::map< DomainT, CodomainT, Traits, Compare, Combine, Section, Alloc >                                         atomized_type;                   // The atomized type representing the corresponding container of elements. 
  typedef DomainT                                                                                                          domain_type;                     // Domain type (type of the keys) of the map. 
  typedef boost::call_traits< DomainT >::param_type                                                                        domain_param;                  
  typedef CodomainT                                                                                                        codomain_type;                   // Domain type (type of the keys) of the map. 
  typedef mapping_pair< domain_type, codomain_type >                                                                       domain_mapping_type;             // Auxiliary type to help the compiler resolve ambiguities when using std::make_pair. 
  typedef domain_mapping_type                                                                                              element_type;                    // Conceptual is a map a set of elements of type element_type. 
  typedef std::pair< interval_type, CodomainT >                                                                            interval_mapping_type;           // Auxiliary type for overload resolution. 
  typedef std::pair< interval_type, CodomainT >                                                                            segment_type;                    // Type of an interval containers segment, that is spanned by an interval. 
  typedef difference_type_of< domain_type >::type                                                                          difference_type;                 // The difference type of an interval which is sometimes different form the domain_type. 
  typedef size_type_of< domain_type >::type                                                                                size_type;                       // The size type of an interval which is mostly std::size_t. 
  typedef inverse< codomain_combine >::type                                                                                inverse_codomain_combine;        // Inverse Combine functor for codomain value aggregation. 
  typedef mpl::if_< has_set_semantics< codomain_type >, ICL_SECTION_CODOMAIN(Section, CodomainT), codomain_combine >::type codomain_intersect;              // Intersection functor for codomain values. 
  typedef inverse< codomain_intersect >::type                                                                              inverse_codomain_intersect;      // Inverse Combine functor for codomain value intersection. 
  typedef exclusive_less_than< interval_type >                                                                             interval_compare;                // Comparison functor for intervals which are keys as well. 
  typedef exclusive_less_than< interval_type >                                                                             key_compare;                     // Comparison functor for keys. 
  typedef Alloc< std::pair< const interval_type, codomain_type > >                                                         allocator_type;                  // The allocator type of the set. 
  typedef ICL_IMPL_SPACE::map< interval_type, codomain_type, key_compare, allocator_type >                                 ImplMapT;                        // Container type for the implementation. 
  typedef ImplMapT::key_type                                                                                               key_type;                        // key type of the implementing container 
  typedef ImplMapT::value_type                                                                                             value_type;                      // value type of the implementing container 
  typedef ImplMapT::value_type::second_type                                                                                data_type;                       // data type of the implementing container 
  typedef ImplMapT::pointer                                                                                                pointer;                         // pointer type 
  typedef ImplMapT::const_pointer                                                                                          const_pointer;                   // const pointer type 
  typedef ImplMapT::reference                                                                                              reference;                       // reference type 
  typedef ImplMapT::const_reference                                                                                        const_reference;                 // const reference type 
  typedef ImplMapT::iterator                                                                                               iterator;                        // iterator for iteration over intervals 
  typedef ImplMapT::const_iterator                                                                                         const_iterator;                  // const_iterator for iteration over intervals 
  typedef ImplMapT::reverse_iterator                                                                                       reverse_iterator;                // iterator for reverse iteration over intervals 
  typedef ImplMapT::const_reverse_iterator                                                                                 const_reverse_iterator;          // const_iterator for iteration over intervals 
  typedef boost::icl::element_iterator< iterator >                                                                         element_iterator;                // element iterator: Depreciated, see documentation. 
  typedef boost::icl::element_iterator< const_iterator >                                                                   element_const_iterator;          // const element iterator: Depreciated, see documentation. 
  typedef boost::icl::element_iterator< reverse_iterator >                                                                 element_reverse_iterator;        // element reverse iterator: Depreciated, see documentation. 
  typedef boost::icl::element_iterator< const_reverse_iterator >                                                           element_const_reverse_iterator;  // element const reverse iterator: Depreciated, see documentation. 
  typedef on_absorbtion< type, codomain_combine, Traits::absorbs_identities >::type                                        on_codomain_absorbtion;        
  // member classes/structs/unions
  template<typename Type, bool has_set_semantics> 
  struct on_codomain_model {
  };
  template<typename Type> 
  struct on_codomain_model<Type, false> {
    // types
    typedef Type::interval_type    interval_type;   
    typedef Type::codomain_type    codomain_type;   
    typedef Type::segment_type     segment_type;    
    typedef Type::codomain_combine codomain_combine;
    // public static functions
    static void add(Type &, interval_type &, const codomain_type &, 
                    const codomain_type &);
  };
  template<typename Type> 
  struct on_codomain_model<Type, true> {
    // types
    typedef Type::interval_type              interval_type;             
    typedef Type::codomain_type              codomain_type;             
    typedef Type::segment_type               segment_type;              
    typedef Type::codomain_combine           codomain_combine;          
    typedef Type::inverse_codomain_intersect inverse_codomain_intersect;
    // public static functions
    static void add(Type &, interval_type &, const codomain_type &, 
                    const codomain_type &);
  };
  template<typename Type, bool is_total> 
  struct on_definedness {
  };
  template<typename Type> 
  struct on_definedness<Type, false> {
    // public static functions
    static void add_intersection(Type &, const Type &, const segment_type &);
  };
  template<typename Type> 
  struct on_definedness<Type, true> {
    // public static functions
    static void add_intersection(Type &, const Type &, const segment_type &);
  };
  template<typename Type, bool is_total_invertible> 
  struct on_invertible {
  };
  template<typename Type> 
  struct on_invertible<Type, false> {
    // types
    typedef Type::segment_type             segment_type;            
    typedef Type::inverse_codomain_combine inverse_codomain_combine;
    // public static functions
    static void subtract(Type &, const segment_type &);
  };
  template<typename Type> 
  struct on_invertible<Type, true> {
    // types
    typedef Type::segment_type             segment_type;            
    typedef Type::inverse_codomain_combine inverse_codomain_combine;
    // public static functions
    static void subtract(Type &, const segment_type &);
  };
  template<typename Type, bool is_total, bool absorbs_identities> 
  struct on_total_absorbable {
  };
  template<typename Type, bool absorbs_identities> 
  struct on_total_absorbable<Type, false, absorbs_identities> {
    // types
    typedef Type::segment_type               segment_type;              
    typedef Type::codomain_type              codomain_type;             
    typedef Type::interval_type              interval_type;             
    typedef Type::value_type                 value_type;                
    typedef Type::const_iterator             const_iterator;            
    typedef Type::set_type                   set_type;                  
    typedef Type::inverse_codomain_intersect inverse_codomain_intersect;
    // public static functions
    static void flip(Type &, const segment_type &);
  };
  template<typename Type> 
  struct on_total_absorbable<Type, true, false> {
    // types
    typedef Type::segment_type  segment_type; 
    typedef Type::codomain_type codomain_type;
    // public static functions
    static void flip(Type &, const segment_type &);
  };
  template<typename Type> 
  struct on_total_absorbable<Type, true, true> {
    // public static functions
    static void flip(Type &, const typename Type::segment_type &);
  };
  // construct/copy/destruct
  interval_base_map();
  interval_base_map(const interval_base_map &);
  interval_base_map(interval_base_map &&);
  interval_base_map & operator=(interval_base_map);
  // public member functions
  typedef ICL_INTERVAL_TYPE(Interval, DomainT, Compare);
  typedef ICL_COMPARE_DOMAIN(Compare, DomainT);
  typedef ICL_COMPARE_DOMAIN(Compare, segment_type);
  typedef ICL_COMBINE_CODOMAIN(Combine, CodomainT);
   BOOST_STATIC_CONSTANT(bool, 
                         is_total_invertible = (Traits::is_total &&has_inverse< codomain_type >::value));
   BOOST_STATIC_CONSTANT(int, fineness = 0);
  void swap(interval_base_map &);
  void clear();
  bool empty() const;
  size_type size() const;
  std::size_t iterative_size() const;
  const_iterator find(const domain_type &) const;
  const_iterator find(const interval_type &) const;
  codomain_type operator()(const domain_type &) const;
  SubType & add(const element_type &);
  SubType & add(const segment_type &);
  iterator add(iterator, const segment_type &);
  SubType & subtract(const element_type &);
  SubType & subtract(const segment_type &);
  SubType & insert(const element_type &);
  SubType & insert(const segment_type &);
  iterator insert(iterator, const segment_type &);
  SubType & set(const element_type &);
  SubType & set(const segment_type &);
  SubType & erase(const element_type &);
  SubType & erase(const segment_type &);
  SubType & erase(const domain_type &);
  SubType & erase(const interval_type &);
  void erase(iterator);
  void erase(iterator, iterator);
  void add_intersection(SubType &, const segment_type &) const;
  SubType & flip(const element_type &);
  SubType & flip(const segment_type &);
  iterator lower_bound(const key_type &);
  iterator upper_bound(const key_type &);
  const_iterator lower_bound(const key_type &) const;
  const_iterator upper_bound(const key_type &) const;
  std::pair< iterator, iterator > equal_range(const key_type &);
  std::pair< const_iterator, const_iterator > 
  equal_range(const key_type &) const;
  iterator begin();
  iterator end();
  const_iterator begin() const;
  const_iterator end() const;
  reverse_iterator rbegin();
  reverse_iterator rend();
  const_reverse_iterator rbegin() const;
  const_reverse_iterator rend() const;
  template<typename Combiner> 
    interval_base_map< SubType, DomainT, CodomainT, Traits, Compare, Combine, Section, Interval, Alloc >::iterator 
    _add(const segment_type &);
  template<typename Combiner> 
    interval_base_map< SubType, DomainT, CodomainT, Traits, Compare, Combine, Section, Interval, Alloc >::iterator 
    _add(iterator, const segment_type &);
  // private member functions
  template<typename Combiner> iterator _add(const segment_type &);
  template<typename Combiner> iterator _add(iterator, const segment_type &);
  template<typename Combiner> void _subtract(const segment_type &);
  iterator _insert(const segment_type &);
  iterator _insert(iterator, const segment_type &);
  template<typename Combiner> 
    void add_segment(const interval_type &, const CodomainT &, iterator &);
  template<typename Combiner> 
    void add_main(interval_type &, const CodomainT &, iterator &, 
                  const iterator &);
  template<typename Combiner> 
    void add_rear(const interval_type &, const CodomainT &, iterator &);
  void add_front(const interval_type &, iterator &);
  void subtract_front(const interval_type &, iterator &);
  template<typename Combiner> 
    void subtract_main(const CodomainT &, iterator &, const iterator &);
  template<typename Combiner> 
    void subtract_rear(interval_type &, const CodomainT &, iterator &);
  void insert_main(const interval_type &, const CodomainT &, iterator &, 
                   const iterator &);
  void erase_rest(interval_type &, const CodomainT &, iterator &, 
                  const iterator &);
  template<typename FragmentT> 
    void total_add_intersection(SubType &, const FragmentT &) const;
  void partial_add_intersection(SubType &, const segment_type &) const;
  void partial_add_intersection(SubType &, const element_type &) const;
  // protected member functions
  template<typename Combiner> 
    iterator gap_insert(iterator, const interval_type &, 
                        const codomain_type &);
  template<typename Combiner> 
    std::pair< iterator, bool > 
    add_at(const iterator &, const interval_type &, const codomain_type &);
  std::pair< iterator, bool > 
  insert_at(const iterator &, const interval_type &, const codomain_type &);
  sub_type * that();
  const sub_type * that() const;
};

Description

interval_base_map public construct/copy/destruct

  1. <
    interval_base_map();
    >

    Конструктор по умолчанию для пустого объекта

  2. <
    interval_base_map(constinterval_base_map&src);
    >

    Копирование конструктора

  3. <
    interval_base_map(interval_base_map&&src);
    >

    Переместить конструктор

  4. <
    interval_base_map&operator=(interval_base_mapsrc);
    >

    Переместить оператора назначения

interval_base_map public member functions

  1. <
    typedefICL_INTERVAL_TYPE(Interval,DomainT,Compare);
    >Тип интервала карты.
  2. <
    typedefICL_COMPARE_DOMAIN(Compare,DomainT);
    >Сравнение функтора для значений домена.
  3. <
    typedefICL_COMPARE_DOMAIN(Compare,segment_type);
    >
  4. <
    typedefICL_COMBINE_CODOMAIN(Combine,CodomainT);
    >Объединить функтор для агрегации значений кодомена.
  5. <
    BOOST_STATIC_CONSTANT(bool,
                          is_total_invertible=(Traits::is_total&&has_inverse<codomain_type>::value));
    >
  6. <
    BOOST_STATIC_CONSTANT(int,fineness=0);
    >
  7. <
    voidswap(interval_base_map&object);
    >

    изменить содержание контейнеров

  8. <
    voidclear();
    >

    Очистить карту

  9. <
    boolempty()const;
    >

    Карта пуста?

  10. <
    size_typesize()const;
    >

    Размер интервальной карты — это ее кардинальность

  11. <
    std::size_titerative_size()const;
    >

    Размер итерации над этим контейнером

  12. <
    const_iteratorfind(constdomain_type&key_value)const;
    >

    Найдите пару значений интервала, которая содержит<key>

  13. <
    const_iteratorfind(constinterval_type&key_interval)const;
    >

    Найдите первую пару значений интервала, которая сталкивается с интервалом<key_interval>

  14. <
    codomain_typeoperator()(constdomain_type&key_value)const;
    >

    Полная функция выбора.

  15. <
    SubType&add(constelement_type&key_value_pair);
    >

    Добавление пары ключевых значений к карте

  16. <
    SubType&add(constsegment_type&interval_value_pair);
    >

    Добавление пары интервальных значений к карте.

  17. <
    iteratoradd(iteratorprior_,constsegment_type&interval_value_pair);
    >

    Добавление пары значений интервала<interval_value_pair>к карте. Итератор<prior_>является намеком на положение<interval_value_pair>может быть вставлен после.

  18. <
    SubType&subtract(constelement_type&key_value_pair);
    >

    Вычитание пары ключевых значений с карты

  19. <
    SubType&subtract(constsegment_type&interval_value_pair);
    >

    Вычитание пары интервальных значений с карты.

  20. <
    SubType&insert(constelement_type&key_value_pair);
    >

    Включение<key_value_pair>в карту.

  21. <
    SubType&insert(constsegment_type&interval_value_pair);
    >

    Включение<interval_value_pair>в карту.

  22. <
    iteratorinsert(iteratorprior,constsegment_type&interval_value_pair);
    >

    Включение<interval_value_pair>в карту. Итератор<prior_>служит подсказкой для вставки после элемента<prior>точки на.

  23. <
    SubType&set(constelement_type&key_value_pair);
    >

    С<key_value_pair = (k,v)>заданным значением<v>для ключа<k>

  24. <
    SubType&set(constsegment_type&interval_value_pair);
    >

    С<interval_value_pair = (I,v)>заданным значением<v>для всех ключей в интервале<I>на карте.

  25. <
    SubType&erase(constelement_type&key_value_pair);
    >

    Стереть<key_value_pair>с карты.

  26. <
    SubType&erase(constsegment_type&interval_value_pair);
    >

    Стереть<interval_value_pair>с карты.

  27. <
    SubType&erase(constdomain_type&key);
    >

    Удалить ключевую пару для<key>.

  28. <
    SubType&erase(constinterval_type&inter_val);
    >

    Стирайте все пары значений в пределах интервала<inter_val>с карты.

  29. <
    voiderase(iteratorposition);
    >

    Стирайте все пары значений в пределах интервала, на который указывает итератор<position>.

  30. <
    voiderase(iteratorfirst,iteratorpast);
    >

    Стирайте все пары значений для ряда итераторов<[first,past)>

    .
  31. <
    voidadd_intersection(SubType&section,
                         constsegment_type&interval_value_pair)const;
    >

    К<section>добавлено пересечение<interval_value_pair>и<*this>карты

    .
  32. <
    SubType&flip(constelement_type&key_value_pair);
    >

    Если<*this>карта содержит<key_value_pair>, она стирается, в противном случае она добавляется.

  33. <
    SubType&flip(constsegment_type&interval_value_pair);
    >

    Если<*this>карта содержит<interval_value_pair>, она стирается, в противном случае она добавляется.

  34. <
    iteratorlower_bound(constkey_type&interval);
    >
  35. <
    iteratorupper_bound(constkey_type&interval);
    >
  36. <
    const_iteratorlower_bound(constkey_type&interval)const;
    >
  37. <
    const_iteratorupper_bound(constkey_type&interval)const;
    >
  38. <
    std::pair<iterator,iterator>equal_range(constkey_type&interval);
    >
  39. <
    std::pair<const_iterator,const_iterator>
    equal_range(constkey_type&interval)const;
    >
  40. <
    iteratorbegin();
    >
  41. <
    iteratorend();
    >
  42. <
    const_iteratorbegin()const;
    >
  43. <
    const_iteratorend()const;
    >
  44. <
    reverse_iteratorrbegin();
    >
  45. <
    reverse_iteratorrend();
    >
  46. <
    const_reverse_iteratorrbegin()const;
    >
  47. <
    const_reverse_iteratorrend()const;
    >
  48. <
    template<typenameCombiner>
     interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>::iterator
     _add(constsegment_type&addend);
    >
  49. <
    template<typenameCombiner>
     interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>::iterator
     _add(iteratorprior_,constsegment_type&addend);
    >

interval_base_map private member functions

  1. <
    template<typenameCombiner>
     iterator_add(constsegment_type&interval_value_pair);
    >
  2. <
    template<typenameCombiner>
     iterator_add(iteratorprior_,constsegment_type&interval_value_pair);
    >
  3. <
    template<typenameCombiner>
     void_subtract(constsegment_type&interval_value_pair);
    >
  4. <
    iterator_insert(constsegment_type&interval_value_pair);
    >
  5. <
    iterator_insert(iteratorprior_,constsegment_type&interval_value_pair);
    >
  6. <
    template<typenameCombiner>
     voidadd_segment(constinterval_type&inter_val,constCodomainT&co_val,
                      iterator&it_);
    >
  7. <
    template<typenameCombiner>
     voidadd_main(interval_type&inter_val,constCodomainT&co_val,
                   iterator&it_,constiterator&last_);
    >
  8. <
    template<typenameCombiner>
     voidadd_rear(constinterval_type&inter_val,constCodomainT&co_val,
                   iterator&it_);
    >
  9. <
    voidadd_front(constinterval_type&inter_val,iterator&first_);
    >
  10. <
    voidsubtract_front(constinterval_type&inter_val,iterator&first_);
    >
  11. <
    template<typenameCombiner>
     voidsubtract_main(constCodomainT&co_val,iterator&it_,
                        constiterator&last_);
    >
  12. <
    template<typenameCombiner>
     voidsubtract_rear(interval_type&inter_val,constCodomainT&co_val,
                        iterator&it_);
    >
  13. <
    voidinsert_main(constinterval_type&,constCodomainT&,iterator&,
                    constiterator&);
    >
  14. <
    voiderase_rest(interval_type&,constCodomainT&,iterator&,
                   constiterator&);
    >
  15. <
    template<typenameFragmentT>
     voidtotal_add_intersection(SubType&section,constFragmentT&fragment)const;
    >
  16. <
    voidpartial_add_intersection(SubType&section,constsegment_type&operand)const;
    >
  17. <
    voidpartial_add_intersection(SubType&section,constelement_type&operand)const;
    >

interval_base_map protected member functions

  1. <
    template<typenameCombiner>
     iteratorgap_insert(iteratorprior_,constinterval_type&inter_val,
                         constcodomain_type&co_val);
    >
  2. <
    template<typenameCombiner>
     std::pair<iterator,bool>
     add_at(constiterator&prior_,constinterval_type&inter_val,
            constcodomain_type&co_val);
    >
  3. <
    std::pair<iterator,bool>
    insert_at(constiterator&prior_,constinterval_type&inter_val,
             constcodomain_type&co_val);
    >
  4. <
    sub_type*that();
    >
  5. <
    constsub_type*that()const;
    >

PrevUpHomeNext

Статья Class template interval_base_map раздела Chapter 1. Boost.Icl Header <boost/icl/interval_base_map.hpp> может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Header <boost/icl/interval_base_map.hpp> ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-19 19:47:48/0.011656999588013/0