ARB
PRD_Range.hxx
Go to the documentation of this file.
1 #ifndef PRD_RANGE_HXX
2 #define PRD_RANGE_HXX
3 
4 #ifndef PRD_GLOBALS_HXX
5 #include "PRD_Globals.hxx"
6 #endif
7 
8 class Range {
9 private:
10  PRD_Sequence_Pos minimum;
11  PRD_Sequence_Pos maximum;
12 
13 public:
14  Range (const PRD_Sequence_Pos value1_, const PRD_Sequence_Pos value2_);
15  Range ();
16  ~Range () {};
17 
18  PRD_Sequence_Pos min() const { return minimum; }
19  PRD_Sequence_Pos max() const { return maximum; }
20  PRD_Sequence_Pos range() { return maximum - minimum; }
21  void min(PRD_Sequence_Pos new_min_) { minimum = new_min_; }
22  void max(PRD_Sequence_Pos new_max_) { maximum = new_max_; }
23  bool includes (PRD_Sequence_Pos value_); // check if given value is in range
24  bool includes (PRD_Sequence_Pos min_, PRD_Sequence_Pos max_); // check if given range overlaps self
25  void print (const char *prefix_, const char *suffix_); // print range
26 };
27 
28 #else
29 #error PRD_Range.hxx included twice
30 #endif // PRD_RANGE_HXX
Range()
Definition: PRD_Range.cxx:14
PRD_Sequence_Pos range()
Definition: PRD_Range.hxx:20
~Range()
Definition: PRD_Range.hxx:16
void min(PRD_Sequence_Pos new_min_)
Definition: PRD_Range.hxx:21
void print(const char *prefix_, const char *suffix_)
Definition: PRD_Range.cxx:41
void max(PRD_Sequence_Pos new_max_)
Definition: PRD_Range.hxx:22
bool includes(PRD_Sequence_Pos value_)
Definition: PRD_Range.cxx:23
PRD_Sequence_Pos max() const
Definition: PRD_Range.hxx:19
PRD_Sequence_Pos min() const
Definition: PRD_Range.hxx:18
long int PRD_Sequence_Pos
Definition: PRD_Globals.hxx:21