2#ifndef INTARNA_INDEXRANGELIST_H_
3#define INTARNA_INDEXRANGELIST_H_
9#include <boost/regex.hpp>
24 typedef std::list< IndexRange >
List;
32 static const boost::regex
regex;
85 bool covers(
const size_t index )
const;
95 bool covers(
const size_t from,
const size_t to )
const;
244 shift(
const int indexShift,
const size_t indexMax )
const;
258 reverse(
const size_t seqLength )
const;
322: allowOverlap(allowOverlap_)
324, listIsComplete(false)
332 ,
const bool allowOverlap_
334 ,
const bool isComplete )
335: allowOverlap(allowOverlap_)
337, listIsComplete(isComplete)
346: allowOverlap(toCopy.allowOverlap)
348, listIsComplete(toCopy.listIsComplete)
382covers(
const size_t from,
const size_t to )
const
392reverse(
const size_t seqLength )
const
405 throw std::runtime_error(
"IndexRangeList::erase() : cannot erase from complete list");
407 return list.erase( i );
480 out <<(i==l.
begin()?
"":
",") <<*i;
Definition IndexRangeList.h:20
iterator begin()
Definition IndexRangeList.h:413
void setComplete(const bool isComplete)
Definition IndexRangeList.h:363
bool listIsComplete
whether or not the list is complete, i.e. cannot be extended
Definition IndexRangeList.h:310
iterator insert(const IndexRange &range)
List list
the list of indices
Definition IndexRangeList.h:307
void fromString(const std::string &stringEncoding, const RnaSequence *seq=NULL)
iterator end()
Definition IndexRangeList.h:418
IndexRangeList(const bool allowOverlap=false)
Definition IndexRangeList.h:321
const IndexRange & get(const size_t idx) const
List::const_iterator const_iterator
Definition IndexRangeList.h:37
List::const_reverse_iterator const_reverse_iterator
Definition IndexRangeList.h:39
IndexRangeList & reverseInplace(const size_t seqLength)
bool covers(const size_t index) const
IndexRange & get(const size_t idx)
static const std::string regexString
regular expression string (without start/end matching)
Definition IndexRangeList.h:29
reverse_iterator rbegin()
Definition IndexRangeList.h:433
IndexRangeList reverse(const size_t seqLength) const
Definition IndexRangeList.h:392
iterator erase(iterator i)
Definition IndexRangeList.h:403
IndexRangeList shift(const int indexShift, const size_t indexMax) const
bool allowOverlap
whether or not overlapping ranges are allowed
Definition IndexRangeList.h:304
List::iterator iterator
Definition IndexRangeList.h:36
void push_back(const IndexRange &range)
void clear()
Definition IndexRangeList.h:468
List::reverse_iterator reverse_iterator
Definition IndexRangeList.h:38
virtual ~IndexRangeList()
Definition IndexRangeList.h:355
bool overlaps(const IndexRange &range) const
bool empty() const
Definition IndexRangeList.h:453
bool isComplete() const
Definition IndexRangeList.h:372
bool isAllowingOverlap() const
Definition IndexRangeList.h:458
bool covers(const IndexRange &range) const
reverse_iterator rend()
Definition IndexRangeList.h:438
const bool operator==(const IndexRangeList &r) const
Definition IndexRangeList.h:265
size_t size() const
Definition IndexRangeList.h:463
std::list< IndexRange > List
List of ranges.
Definition IndexRangeList.h:24
friend std::ostream & operator<<(std::ostream &out, const IndexRangeList &l)
Definition IndexRangeList.h:476
const bool operator!=(const IndexRangeList &r) const
Definition IndexRangeList.h:274
static const boost::regex regex
regular expression that matches valid IndexRangeList string encodings
Definition IndexRangeList.h:32
Definition IndexRange.h:20
Definition RnaSequence.h:29
Definition Accessibility.h:13
std::ostream & operator<<(std::ostream &out, const AccessibilityConstraint &c)
Definition AccessibilityConstraint.h:481