CARMA C++
RegRange.h
Go to the documentation of this file.
1 #ifndef SZA_UTIL_REGRANGE_H
2 #define SZA_UTIL_REGRANGE_H
3 
12 
13 #include "carma/szaarrayutils/szaregs.h"
14 
15 #include <iostream>
16 
17 namespace sza {
18  namespace util {
19 
24  class RegRange {
25  public:
26 
30  RegRange(unsigned iByteStart, unsigned iByteStop,
31  bool archivedOnly=false, ArrayMap* arrayMap=0);
32 
36  virtual ~RegRange();
37 
42  const RegRange& operator++();
43 
49  void increment();
50 
54  void reset();
55 
59  bool isEnd();
60 
64  friend std::ostream& operator<<(std::ostream& os, RegRange& range);
65 
69  ArrRegMap* currentArrRegMap();
70 
74  RegMapBlock* currentBlock();
75 
79  unsigned currentEl();
80 
84  unsigned currentByteOffset();
85 
90  int currentSlot();
91 
92  private:
93 
94  ArrayMap* arrayMap_; // The SZA array map
95  ArrayMapBase arrayMapBase_;// The SZA array map
96 
97  bool archivedOnly_; // True if this frame should
98  // contain only archived registers
99 
100  unsigned iByteStart_; // The starting byte into the arraymap
101  unsigned iByteStop_; // The ending byte into the arraymap
102  unsigned iByteCurrent_;// The index of the current byte
103  unsigned iSlotCurrent_;// The index of the current slot
104 
105  // Iterators for looping through the arraymap
106 
107  std::vector<ArrRegMap*>::iterator iregmap_;
108  std::vector<RegMapBoard*>::iterator iboard_;
109  std::vector<RegMapBlock*>::iterator iblock_;
110  int iEl_;
111 
115  void checkValidity();
116 
120  bool currentRegisterIsValid();
121 
122  }; // End class RegRange
123 
124  } // End namespace util
125 } // End namespace sza
126 
127 
128 
129 #endif // End #ifndef SZA_UTIL_REGRANGE_H
bool isEnd()
Return true if we are at the end of our range.
A class for managing ranges of byte indices corresponding to registers in a register map...
Definition: RegRange.h:24
ArrRegMap * currentArrRegMap()
Get a pointer to the current register map.
const RegRange & operator++()
Prefix increment operator.
RegRange(unsigned iByteStart, unsigned iByteStop, bool archivedOnly=false, ArrayMap *arrayMap=0)
Constructor.
friend std::ostream & operator<<(std::ostream &os, RegRange &range)
Allows cout &lt;&lt; RegRange.
void reset()
Reset all iterators.
int currentSlot()
Get the current slot in the register map.
Tagged: Wed Oct 6 11:04:54 PDT 2004.
unsigned currentByteOffset()
Get the current byte offset.
unsigned currentEl()
Get the current element.
RegMapBlock * currentBlock()
Get a pointer to the current block.
void increment()
Increments to the next register element, regardless of whether or not it belongs to the version of th...
virtual ~RegRange()
Destructor.