My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
RegRange.h
Go to the documentation of this file.
1 #ifndef GCP_UTIL_REGRANGE_H
2 #define GCP_UTIL_REGRANGE_H
3 
11 #include "gcp/util/common/ArrayMapBase.h"
12 
13 #include "gcp/control/code/unix/libunix_src/common/genericregs.h"
14 
15 #include <iostream>
16 
17 namespace gcp {
18  namespace util {
19 
24  class RegRange {
25 
26  private:
27 
31  RegRange(RegRange& range);
32  RegRange(const RegRange& range);
33 
37  void operator=(RegRange& range);
38  void operator=(const RegRange& range);
39 
40  public:
41 
45  RegRange(unsigned iByteStart, unsigned iByteStop,
46  bool archivedOnly=false, ArrayMap* arrayMap=0);
47 
48 
52  virtual ~RegRange();
53 
58  const RegRange& operator++();
59 
65  void increment();
66 
70  void reset();
71 
75  bool isEnd();
76 
80  friend std::ostream& operator<<(std::ostream& os, RegRange& range);
81 
86 
90  RegMapBlock* currentBlock();
91 
95  unsigned currentEl();
96 
100  unsigned currentByteOffset();
101 
106  int currentSlot();
107 
108  private:
109 
110  ArrayMap* arrayMap_; // The GCP array map
111  ArrayMapBase arrayMapBase_;// The GCP array map
112 
113  bool archivedOnly_; // True if this frame should
114  // contain only archived registers
115 
116  unsigned iByteStart_; // The starting byte into the arraymap
117  unsigned iByteStop_; // The ending byte into the arraymap
118  unsigned iByteCurrent_;// The index of the current byte
119  unsigned iSlotCurrent_;// The index of the current slot
120 
121  // Iterators for looping through the arraymap
122 
123  std::vector<ArrRegMap*>::iterator iregmap_;
124  std::vector<RegMapBoard*>::iterator iboard_;
125  std::vector<RegMapBlock*>::iterator iblock_;
126  int iEl_;
127 
131  void checkValidity();
132 
136  bool currentRegisterIsValid();
137 
138  }; // End class RegRange
139 
140  } // End namespace util
141 } // End namespace gcp
142 
143 
144 
145 
146 #endif // End #ifndef GCP_UTIL_REGRANGE_H
virtual ~RegRange()
Definition: RegRange.cc:152
void increment()
Definition: RegRange.cc:185
RegMapBlock * currentBlock()
Definition: RegRange.cc:301
Definition: RegRange.h:24
Definition: arraymap.h:63
void reset()
Definition: RegRange.cc:41
const RegRange & operator++()
Definition: RegRange.cc:170
unsigned currentEl()
Definition: RegRange.cc:310
friend std::ostream & operator<<(std::ostream &os, RegRange &range)
unsigned currentByteOffset()
Definition: RegRange.cc:319
bool isEnd()
Definition: RegRange.cc:162
ArrRegMap * currentArrRegMap()
Definition: RegRange.cc:292
Definition: ArrayMapBase.h:47
int currentSlot()
Definition: RegRange.cc:328
Definition: arraymap.h:177