Isis 3 Developer Reference
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 {
68  class BufferManager : public Isis::Buffer {
69 
70  public:
71  // Constructors and Destructors
72  BufferManager();
73  BufferManager(int maxsamps, int maxlines, int maxbands,
74  int bufsamps, int buflines, int bufbands,
75  Isis::PixelType type, bool reverse = false);
76  BufferManager(const BufferManager &other);
77 
80 
81  // Traversal Methods
82 
89  bool operator++(int) {
90  return (next());
91  }
92 
93 
103  setpos(p_currentMap + i);
104  return *this;
105  }
106 
112  bool begin() {
113  return (setpos(0));
114  }
115 
122  bool next() {
123  return (setpos(p_currentMap + 1));
124  }
125 
131  bool end() const {
132  return (p_currentMap >= p_nmaps);
133  }
134 
135  bool setpos(BigInt map);
136 
137  void swap(BufferManager &other);
138 
140 
141  protected:
142 
143  // Methods visable to deriving classes
144 
150  int MaxSamples() const {
151  return (p_maxSamps);
152  }
153 
159  int MaxLines() const {
160  return (p_maxLines);
161  }
162 
168  int MaxBands() const {
169  return (p_maxBands);
170  }
171 
178  BigInt MaxMaps() const {
179  return (p_nmaps);
180  }
181 
182  void SetIncrements(const int sinc, const int linc, const int binc);
183  void SetOffsets(const int soff, const int loff, const int boff);
184 
185  private:
186  int p_maxSamps;
187  int p_maxLines;
188  int p_maxBands;
189 
190  int p_sinc;
191  int p_linc;
192  int p_binc;
193 
194  int p_soff;
195  int p_loff;
196  int p_boff;
197 
198  int p_currentSample;
199  int p_currentLine;
200  int p_currentBand;
201 
202  BigInt p_nmaps;
203  BigInt p_currentMap;
204 
210  bool p_reverse;
211  };
212 };
213 
214 #endif
215 
Buffer for reading and writing cube data.
Definition: Buffer.h:69
BigInt MaxMaps() const
Returns the maximum number of positions the shape buffer needs to cover the entire image (see setpos ...
Definition: BufferManager.h:178
long long int BigInt
Big int.
Definition: Constants.h:65
void SetOffsets(const int soff, const int loff, const int boff)
Sets the offset of the buffer.
Definition: BufferManager.cpp:195
BufferManager & operator+=(int i)
Moves the shape buffer by a certain amount.
Definition: BufferManager.h:102
int MaxSamples() const
Returns the number of samples in the cube.
Definition: BufferManager.h:150
int MaxBands() const
Returns the number of bands in the cube.
Definition: BufferManager.h:168
~BufferManager()
Destroys the BufferManager object.
Definition: BufferManager.h:79
int MaxLines() const
Returns the number of lines in the cube.
Definition: BufferManager.h:159
PixelType
Enumerations for Isis Pixel Types.
Definition: PixelType.h:43
void swap(BufferManager &other)
Swaps the values of this BufferManager with that of another.
Definition: BufferManager.cpp:97
bool begin()
Moves the shape buffer to the first position.
Definition: BufferManager.h:112
Manages a Buffer over a cube.
Definition: BufferManager.h:68
bool next()
Moves the shape buffer to the next position.
Definition: BufferManager.h:122
BufferManager()
Definition: BufferManager.cpp:34
bool end() const
Returns true if the shape buffer has accessed the end of the cube.
Definition: BufferManager.h:131
BufferManager & operator=(const BufferManager &rhs)
Creates a new BufferManager with the same values as another.
Definition: BufferManager.cpp:123
bool setpos(BigInt map)
Sets the position of the shape in the cube.
Definition: BufferManager.cpp:235
bool operator++(int)
Moves the shape buffer to the next position.
Definition: BufferManager.h:89
void SetIncrements(const int sinc, const int linc, const int binc)
Sets how the shape is incremented through the cube.
Definition: BufferManager.cpp:156
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31