Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template interval_set

boost::itl::interval_set — Implements a set as a set of intervals - merging adjoining intervals.

Synopsis

template<typename DomainT , 
         ITL_COMPARE Compare = ITL_COMPARE_INSTANCE(std::less, DomainT), 
         template< class, ITL_COMPARE >class Interval = itl::interval, 
         ITL_ALLOC Alloc = std::allocator> 
class interval_set : public boost::itl::interval_base_set< boost::itl::interval_set< DomainT, Compare, Interval, Alloc >, DomainT, Compare, Interval, Alloc >
{
public:
  // types
  typedef interval_base_set< itl::interval_set< DomainT, Compare, Interval, Alloc >, DomainT, Compare, Interval, Alloc > base_type;              // The base_type of this class. 
  typedef interval_set< DomainT, Compare, Interval, Alloc >                                                              type;                 
  typedef type                                                                                                           overloadable_type;      // Auxilliary type for overloadresolution. 
  typedef type                                                                                                           joint_type;           
  typedef DomainT                                                                                                        domain_type;            // The domain type of the set. 
  typedef DomainT                                                                                                        codomain_type;          // The codomaintype is the same as domain_type. 
  typedef DomainT                                                                                                        element_type;           // The element type of the set. 
  typedef Interval< DomainT, Compare >                                                                                   interval_type;          // The interval type of the set. 
  typedef interval_type                                                                                                  segment_type;           // The segment type of the set. 
  typedef exclusive_less< interval_type >                                                                                interval_compare;       // Comparison functor for intervals. 
  typedef exclusive_less< interval_type >                                                                                key_compare;            // Comparison functor for keys. 
  typedef Alloc< interval_type >                                                                                         allocator_type;         // The allocator type of the set. 
  typedef Alloc< DomainT >                                                                                               domain_allocator_type;  // allocator type of the corresponding element set 
  typedef itl::set< DomainT, Compare, Alloc >                                                                            atomized_type;          // The corresponding atomized type representing this interval container of elements. 
  typedef itl::set< interval_type, ITL_EXCLUSIVE_LESS(interval_type), Alloc >                                            ImplSetT;               // Container type for the implementation. 
  typedef ImplSetT::key_type                                                                                             key_type;               // key type of the implementing container 
  typedef ImplSetT::data_type                                                                                            data_type;              // data type of the implementing container 
  typedef ImplSetT::value_type                                                                                           value_type;             // value type of the implementing container 
  typedef ImplSetT::iterator                                                                                             iterator;               // iterator for iteration over intervals 
  typedef ImplSetT::const_iterator                                                                                       const_iterator;         // const_iterator for iteration over intervals 

  // construct/copy/destruct
  interval_set();
  interval_set(const interval_set &);
  template<class SubType > 
    interval_set(const interval_base_set< SubType, DomainT, Compare, Interval, Alloc > &);
  interval_set(const domain_type &);
  interval_set(const interval_type &);
  template<class SubType > 
    interval_set& 
    operator=(const interval_base_set< SubType, DomainT, Compare, Interval, Alloc > &);

  // public member functions
  typedef ITL_COMPARE_DOMAIN(Compare, DomainT) ;
  template<class SubType > 
    void assign(const interval_base_set< SubType, DomainT, Compare, Interval, Alloc > &) ;

  // private member functions
  bool contains_(const interval_type &) const;
  void add_(const value_type &) ;
  iterator add_(iterator, const value_type &) ;
  void subtract_(const value_type &) ;
  iterator handle_neighbours(iterator) ;
  iterator join_on_left(iterator &, const iterator &) ;
};

Description

interval_set public construct/copy/destruct

  1. interval_set();
  2. interval_set(const interval_set & src);
  3. template<class SubType > 
      interval_set(const interval_base_set< SubType, DomainT, Compare, Interval, Alloc > & src);
  4. interval_set(const domain_type & value);
  5. interval_set(const interval_type & itv);
  6. template<class SubType > 
      interval_set& 
      operator=(const interval_base_set< SubType, DomainT, Compare, Interval, Alloc > & src);

interval_set public member functions

  1. typedef ITL_COMPARE_DOMAIN(Compare, DomainT) ;
  2. template<class SubType > 
      void assign(const interval_base_set< SubType, DomainT, Compare, Interval, Alloc > & src) ;

interval_set private member functions

  1. bool contains_(const interval_type & sub) const;
    sub
  2. void add_(const value_type & addend) ;
    addend
  3. iterator add_(iterator prior_, const value_type & addend) ;
  4. void subtract_(const value_type & minuend) ;
    minuend
  5. iterator handle_neighbours(iterator it_) ;
  6. iterator join_on_left(iterator & left_, const iterator & right_) ;

PrevUpHomeNext