Isis Developer Reference
BufferManager.h
Go to the documentation of this file.
1 #ifndef BufferManager_h
2 #define BufferManager_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include "Constants.h"
11 #include "PixelType.h"
12 #include "Buffer.h"
13 
14 namespace Isis {
52  class BufferManager : public Isis::Buffer {
53 
54  public:
55  // Constructors and Destructors
56  BufferManager();
57  BufferManager(int maxsamps, int maxlines, int maxbands,
58  int bufsamps, int buflines, int bufbands,
59  Isis::PixelType type, bool reverse = false);
60  BufferManager(const BufferManager &other);
61 
64 
65  // Traversal Methods
66 
73  bool operator++(int) {
74  return (next());
75  }
76 
77 
87  setpos(p_currentMap + i);
88  return *this;
89  }
90 
96  bool begin() {
97  return (setpos(0));
98  }
99 
106  bool next() {
107  return (setpos(p_currentMap + 1));
108  }
109 
115  bool end() const {
116  return (p_currentMap >= p_nmaps);
117  }
118 
119  bool setpos(BigInt map);
120 
121  void swap(BufferManager &other);
122 
124 
125  protected:
126 
127  // Methods visable to deriving classes
128 
134  int MaxSamples() const {
135  return (p_maxSamps);
136  }
137 
143  int MaxLines() const {
144  return (p_maxLines);
145  }
146 
152  int MaxBands() const {
153  return (p_maxBands);
154  }
155 
162  BigInt MaxMaps() const {
163  return (p_nmaps);
164  }
165 
166  void SetIncrements(const int sinc, const int linc, const int binc);
167  void SetOffsets(const int soff, const int loff, const int boff);
168 
169  private:
170  int p_maxSamps;
171  int p_maxLines;
172  int p_maxBands;
173 
174  int p_sinc;
175  int p_linc;
176  int p_binc;
177 
178  int p_soff;
179  int p_loff;
180  int p_boff;
181 
182  int p_currentSample;
183  int p_currentLine;
184  int p_currentBand;
185 
186  BigInt p_nmaps;
187  BigInt p_currentMap;
188 
194  bool p_reverse;
195  };
196 };
197 
198 #endif
199 
Isis::BufferManager::operator++
bool operator++(int)
Moves the shape buffer to the next position.
Definition: BufferManager.h:73
Isis::BufferManager::operator=
BufferManager & operator=(const BufferManager &rhs)
Creates a new BufferManager with the same values as another.
Definition: BufferManager.cpp:107
Isis::BufferManager::setpos
bool setpos(BigInt map)
Sets the position of the shape in the cube.
Definition: BufferManager.cpp:219
Isis::BufferManager::next
bool next()
Moves the shape buffer to the next position.
Definition: BufferManager.h:106
Isis::BufferManager::SetIncrements
void SetIncrements(const int sinc, const int linc, const int binc)
Sets how the shape is incremented through the cube.
Definition: BufferManager.cpp:140
BufferManager.h
Isis::BufferManager::MaxMaps
BigInt MaxMaps() const
Returns the maximum number of positions the shape buffer needs to cover the entire image (see setpos ...
Definition: BufferManager.h:162
Isis::BufferManager::operator+=
BufferManager & operator+=(int i)
Moves the shape buffer by a certain amount.
Definition: BufferManager.h:86
Isis::BufferManager::begin
bool begin()
Moves the shape buffer to the first position.
Definition: BufferManager.h:96
Isis::BufferManager
Manages a Buffer over a cube.
Definition: BufferManager.h:52
Isis::Buffer
Buffer for reading and writing cube data.
Definition: Buffer.h:53
Isis::BufferManager::end
bool end() const
Returns true if the shape buffer has accessed the end of the cube.
Definition: BufferManager.h:115
Isis::BufferManager::swap
void swap(BufferManager &other)
Swaps the values of this BufferManager with that of another.
Definition: BufferManager.cpp:81
Buffer.h
PixelType.h
Isis::Buffer::SetBasePosition
void SetBasePosition(const int start_sample, const int start_line, const int start_band)
This method is used to set the base position of the shape buffer.
Definition: Buffer.cpp:106
Isis::BufferManager::MaxLines
int MaxLines() const
Returns the number of lines in the cube.
Definition: BufferManager.h:143
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::BigInt
long long int BigInt
Big int.
Definition: Constants.h:49
Isis::BufferManager::~BufferManager
~BufferManager()
Destroys the BufferManager object.
Definition: BufferManager.h:63
Isis::BufferManager::SetOffsets
void SetOffsets(const int soff, const int loff, const int boff)
Sets the offset of the buffer.
Definition: BufferManager.cpp:179
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::BufferManager::MaxSamples
int MaxSamples() const
Returns the number of samples in the cube.
Definition: BufferManager.h:134
Isis::BufferManager::MaxBands
int MaxBands() const
Returns the number of bands in the cube.
Definition: BufferManager.h:152
Isis::PixelType
PixelType
Enumerations for Isis Pixel Types.
Definition: PixelType.h:27
IException.h
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
std
Namespace for the standard library.
Isis::BufferManager::BufferManager
BufferManager()
Definition: BufferManager.cpp:18
Constants.h
IsisDebug.h
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16