|
Isis 3.0 Developer's Reference (API) |
Home |
00001 #ifndef BufferManager_h 00002 #define BufferManager_h 00003 00026 #include "Constants.h" 00027 #include "PixelType.h" 00028 #include "Buffer.h" 00029 00030 namespace Isis { 00067 class BufferManager : public Isis::Buffer { 00068 00069 public: 00070 // Constructors and Destructors 00071 BufferManager(); 00072 BufferManager(int maxsamps, int maxlines, int maxbands, 00073 int bufsamps, int buflines, int bufbands, 00074 Isis::PixelType type, bool reverse = false); 00075 BufferManager(const BufferManager &other); 00076 00078 ~BufferManager() {}; 00079 00080 // Traversal Methods 00081 00088 bool operator++(int) { 00089 return (next()); 00090 } 00091 00092 00093 BufferManager &operator+=(int i) { 00094 setpos(p_currentMap + i); 00095 return *this; 00096 } 00097 00103 bool begin() { 00104 return (setpos(0)); 00105 } 00106 00113 bool next() { 00114 return (setpos(p_currentMap + 1)); 00115 } 00116 00122 bool end() const { 00123 return (p_currentMap >= p_nmaps); 00124 } 00125 00126 bool setpos(BigInt map); 00127 00128 void swap(BufferManager &other); 00129 00130 BufferManager &operator=(const BufferManager &rhs); 00131 00132 protected: 00133 00134 // Methods visable to deriving classes 00135 00141 int MaxSamples() const { 00142 return (p_maxSamps); 00143 } 00144 00150 int MaxLines() const { 00151 return (p_maxLines); 00152 } 00153 00159 int MaxBands() const { 00160 return (p_maxBands); 00161 } 00162 00169 BigInt MaxMaps() const { 00170 return (p_nmaps); 00171 } 00172 00173 void SetIncrements(const int sinc, const int linc, const int binc); 00174 void SetOffsets(const int soff, const int loff, const int boff); 00175 00176 private: 00177 int p_maxSamps; 00178 int p_maxLines; 00179 int p_maxBands; 00180 00181 int p_sinc; 00182 int p_linc; 00183 int p_binc; 00184 00185 int p_soff; 00186 int p_loff; 00187 int p_boff; 00188 00189 int p_currentSample; 00190 int p_currentLine; 00191 int p_currentBand; 00192 00193 BigInt p_nmaps; 00194 BigInt p_currentMap; 00195 00201 bool p_reverse; 00202 }; 00203 }; 00204 00205 #endif 00206