24#ifndef _INTEGERSET_HPP_
25#define _INTEGERSET_HPP_
50 bool contains(
int n)
const {
return n>=begin && n<=end;}
92 Intervals::const_iterator
it_;
93 Intervals::const_iterator
end_;
121 void parse(
const std::string& intervalList);
132 bool empty()
const {
return intervals_.empty();}
forward iterator providing readonly access to the virtual container
bool operator!=(const Iterator &that) const
const Iterator operator++(int)
Iterator(const IntegerSet &integerSet)
initialized to beginning of the IntegerSet
std::forward_iterator_tag iterator_category
bool operator==(const Iterator &that) const
Intervals::const_iterator it_
Iterator()
default constructed Iterator marks end of any IntegerSet
Intervals::const_iterator end_
a virtual container of integers, accessible via an iterator interface, stored as union of intervals
IntegerSet(int a)
construction with a single integer
void insert(Interval interval)
insert an interval of integers into the virtual container
const_iterator end() const
void insert(int a)
insert a single integer into the virtual container
void insert(int a, int b)
insert an interval of integers into the virtual container
IntegerSet(int a, int b)
construction with a single interval
friend PWIZ_API_DECL std::ostream & operator<<(std::ostream &os, const IntegerSet &integerSet)
IntegerSet()
default construction
bool empty() const
true iff IntegerSet is empty
const_iterator begin() const
size_t size() const
returns the number of integers in the set
bool hasUpperBound(int n) const
true iff n is an upper bound for the IntegerSet
std::list< Interval > Intervals
collection of Interval objects
bool contains(int n) const
true iff n is in the IntegerSet
size_t intervalCount() const
returns the number of intervals in the set
void parse(const std::string &intervalList)
insert intervals by parsing a string representing a whitespace-delimited list of closed intervals: pa...
a single closed interval of integers
bool contains(int n) const
friend PWIZ_API_DECL std::ostream & operator<<(std::ostream &os, const Interval &interval)
friend PWIZ_API_DECL std::istream & operator>>(std::istream &is, Interval &interval)