Isis 3.0
Home
BufferManager.h
Go to the documentation of this file.
1 #ifndef BufferManager_h
2 #define BufferManager_h
3 
26 #include "Constants.h"
27 #include "PixelType.h"
28 #include "Buffer.h"
29 
30 namespace Isis {
67  class BufferManager : public Isis::Buffer {
68 
69  public:
70  // Constructors and Destructors
71  BufferManager();
72  BufferManager(int maxsamps, int maxlines, int maxbands,
73  int bufsamps, int buflines, int bufbands,
74  Isis::PixelType type, bool reverse = false);
75  BufferManager(const BufferManager &other);
76 
79 
80  // Traversal Methods
81 
88  bool operator++(int) {
89  return (next());
90  }
91 
92 
94  setpos(p_currentMap + i);
95  return *this;
96  }
97 
103  bool begin() {
104  return (setpos(0));
105  }
106 
113  bool next() {
114  return (setpos(p_currentMap + 1));
115  }
116 
122  bool end() const {
123  return (p_currentMap >= p_nmaps);
124  }
125 
126  bool setpos(BigInt map);
127 
128  void swap(BufferManager &other);
129 
131 
132  protected:
133 
134  // Methods visable to deriving classes
135 
141  int MaxSamples() const {
142  return (p_maxSamps);
143  }
144 
150  int MaxLines() const {
151  return (p_maxLines);
152  }
153 
159  int MaxBands() const {
160  return (p_maxBands);
161  }
162 
169  BigInt MaxMaps() const {
170  return (p_nmaps);
171  }
172 
173  void SetIncrements(const int sinc, const int linc, const int binc);
174  void SetOffsets(const int soff, const int loff, const int boff);
175 
176  private:
177  int p_maxSamps;
178  int p_maxLines;
179  int p_maxBands;
180 
181  int p_sinc;
182  int p_linc;
183  int p_binc;
184 
185  int p_soff;
186  int p_loff;
187  int p_boff;
188 
189  int p_currentSample;
190  int p_currentLine;
191  int p_currentBand;
192 
193  BigInt p_nmaps;
194  BigInt p_currentMap;
195 
201  bool p_reverse;
202  };
203 };
204 
205 #endif
206 
Buffer for reading and writing cube data.
Definition: Buffer.h:68
long long int BigInt
Definition: Constants.h:63
void SetOffsets(const int soff, const int loff, const int boff)
Sets the offset of the buffer.
Definition: BufferManager.cpp:176
BufferManager & operator+=(int i)
Definition: BufferManager.h:93
bool end() const
Returns true if the shape buffer has accessed the end of the cube.
Definition: BufferManager.h:122
int MaxSamples() const
Returns the number of samples in the cube.
Definition: BufferManager.h:141
~BufferManager()
Destroys the BufferManager object.
Definition: BufferManager.h:78
PixelType
Enumerations for Isis Pixel Types.
Definition: PixelType.h:43
void swap(BufferManager &other)
Definition: BufferManager.cpp:85
bool begin()
Moves the shape buffer to the first position.
Definition: BufferManager.h:103
int MaxLines() const
Returns the number of lines in the cube.
Definition: BufferManager.h:150
BigInt MaxMaps() const
Returns the maximum number of positions the shape buffer needs to cover the entire image (see setpos ...
Definition: BufferManager.h:169
Manages a Buffer over a cube.
Definition: BufferManager.h:67
bool next()
Moves the shape buffer to the next position.
Definition: BufferManager.h:113
BufferManager()
Definition: BufferManager.cpp:34
BufferManager & operator=(const BufferManager &rhs)
Definition: BufferManager.cpp:104
int MaxBands() const
Returns the number of bands in the cube.
Definition: BufferManager.h:159
bool setpos(BigInt map)
Sets the position of the shape in the cube.
Definition: BufferManager.cpp:216
bool operator++(int)
Moves the shape buffer to the next position.
Definition: BufferManager.h:88
void SetIncrements(const int sinc, const int linc, const int binc)
Sets how the shape is incremented through the cube.
Definition: BufferManager.cpp:137