source: branches/alilink/PRIMER_DESIGN/PRD_Range.hxx

Last change on this file was 6366, checked in by westram, 15 years ago
  • fixed whitespace (scripted)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 973 bytes
Line 
1#ifndef PRD_RANGE_HXX
2#define PRD_RANGE_HXX
3
4#ifndef   PRD_GLOBALS_HXX
5#include "PRD_Globals.hxx"
6#endif
7
8class Range {
9private:
10    PRD_Sequence_Pos minimum;
11    PRD_Sequence_Pos maximum;
12
13public:
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
Note: See TracBrowser for help on using the repository browser.