|
Isis 3.0 Object Programmers' Reference |
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 private: 00070 const int p_maxSamps; 00071 const int p_maxLines; 00072 const int p_maxBands; 00073 00074 int p_sinc; 00075 int p_linc; 00076 int p_binc; 00077 00078 int p_soff; 00079 int p_loff; 00080 int p_boff; 00081 00082 int p_currentSample; 00083 int p_currentLine; 00084 int p_currentBand; 00085 00086 BigInt p_nmaps; 00087 BigInt p_currentMap; 00088 00094 bool p_reverse; 00095 00096 public: 00097 // Constructors and Destructors 00098 BufferManager(const int maxsamps, const int maxlines, const int maxbands, 00099 const int bufsamps, const int buflines, const int bufbands, 00100 const Isis::PixelType type, const bool reverse=false); 00101 00103 ~BufferManager() {}; 00104 00105 // Traversal Methods 00106 00113 inline bool operator++(int) { return (next()); } 00114 00120 inline bool begin() { return (setpos(0)); } 00121 00128 inline bool next() { return (setpos(p_currentMap+1)); } 00129 00135 inline bool end() const { return (p_currentMap >= p_nmaps); } 00136 00137 protected: 00138 bool setpos(const BigInt map); 00139 00140 // Methods visable to deriving classes 00141 00147 inline int MaxSamples() const { return (p_maxSamps); } 00148 00154 inline int MaxLines() const { return (p_maxLines); } 00155 00161 inline int MaxBands() const { return (p_maxBands); } 00162 00169 inline BigInt MaxMaps() const { return (p_nmaps); } 00170 00171 void SetIncrements(const int sinc, const int linc, const int binc); 00172 void SetOffsets(const int soff, const int loff, const int boff); 00173 }; 00174 }; 00175 00176 #endif 00177