12 #ifndef PT_RANGECHECK_HXX
13 #define PT_RANGECHECK_HXX
30 mutable const AbsLoc *curr_match;
33 int start_pos()
const {
return curr_match->
get_abs_pos(); }
34 int min_end_pos()
const {
return start_pos()+probe_len-1; }
36 int calc_max_abs_pos()
const;
37 int max_abs_pos()
const {
39 if (found != cache.end())
return found->second;
41 return cache[curr_match->
get_name()] = calc_max_abs_pos();
44 bool starts_before_start()
const {
return start != -1 && start_pos() < start; }
45 bool ends_behind_end()
const {
47 (min_end_pos() > end ||
48 start > max_abs_pos());
52 Range(
int start_,
int end_,
int probe_len_)
55 probe_len(probe_len_),
61 probe_len(other.probe_len),
62 curr_match(other.curr_match)
69 bool inside = !starts_before_start() && !ends_behind_end();
76 #error PT_rangeCheck.hxx included twice
77 #endif // PT_RANGECHECK_HXX
std::map< int, int > apos_cache
apos_cache::iterator apos_iter
DECLARE_ASSIGNMENT_OPERATOR(Range)
Range(const Range &other)
Range(int start_, int end_, int probe_len_)
bool contains(const AbsLoc &match) const