Isis 3 Programmer Reference
Isis::RawCubeChunk Class Reference

A section of raw data on the disk. More...

#include <RawCubeChunk.h>

Collaboration diagram for Isis::RawCubeChunk:
Collaboration graph

Public Member Functions

 RawCubeChunk (const Area3D &placement, int numBytes)
 This constructor creates a new cube chunk based on the provided placement and data size.
 
 RawCubeChunk (int startSample, int startLine, int startBand, int endSample, int endLine, int endBand, int numBytes)
 This constructor creates a new cube chunk based on the provided coordinates and data size.
 
virtual ~RawCubeChunk ()
 The destructor.
 
bool isDirty () const
 
QByteArray & getRawData () const
 
void setRawData (QByteArray rawData)
 Sets the chunk's raw data.
 
unsigned char getChar (int offset) const
 This method is currently not in use due to a faster way of getting data from the buffer (through the internal pointer).
 
short getShort (int offset) const
 
float getFloat (int offset) const
 
int getStartSample () const
 
int getStartLine () const
 
int getStartBand () const
 
int sampleCount () const
 
int lineCount () const
 
int bandCount () const
 
int getByteCount () const
 
void setData (unsigned char value, int offset)
 Sets the char at the given offset in the raw data buffer of this chunk.
 
void setData (short value, int offset)
 Sets the short at the given offset in the raw data buffer of this chunk.
 
void setData (const float &value, const int &offset)
 Sets the float at the given offset in the raw data buffer of this chunk.
 
void setDirty (bool dirty)
 Sets the chunk's dirty flag, indicating whether or not the chunk's data matches the data that is on disk.
 

Private Member Functions

 RawCubeChunk (const RawCubeChunk &other)
 The copy constructor is disabled.
 
RawCubeChunkoperator= (const RawCubeChunk &other)
 The assignment operator is disabled.
 

Private Attributes

bool m_dirty
 True if the data does not match what is on disk.
 
QByteArray * m_rawBuffer
 This is the raw data to be put on disk.
 
char * m_rawBufferInternalPtr
 This is the internal pointer to the raw buffer for performance.
 
int m_sampleCount
 The number of samples in the cube chunk.
 
int m_lineCount
 The number of lines in the cube chunk.
 
int m_bandCount
 The number of bands in the cube chunk.
 
int m_startSample
 The one-based (inclusive) start sample of the cube chunk.
 
int m_startLine
 The one-based (inclusive) start line of the cube chunk.
 
int m_startBand
 The one-based (inclusive) start band of the cube chunk.
 

Detailed Description

A section of raw data on the disk.

This encapsulates a chunk's data. The data stored in this class is literally what is stored on disk - an unswapped byte array. These should only be used by CubeIoHandler and it's children to manage what is in memory versus what is on disk.

Author
2011-06-15 Steven Lambright and Jai Rideout

Definition at line 27 of file RawCubeChunk.h.

Constructor & Destructor Documentation

◆ RawCubeChunk() [1/3]

Isis::RawCubeChunk::RawCubeChunk ( const Area3D & placement,
int numBytes )

This constructor creates a new cube chunk based on the provided placement and data size.

Parameters
placementthe 3D "cube" that this chunk will cover (inclusive)
numBytesthe number of raw data bytes in the chunk

Definition at line 28 of file RawCubeChunk.cpp.

References m_bandCount, m_dirty, m_lineCount, m_rawBuffer, m_rawBufferInternalPtr, m_sampleCount, m_startBand, m_startLine, and m_startSample.

◆ RawCubeChunk() [2/3]

Isis::RawCubeChunk::RawCubeChunk ( int startSample,
int startLine,
int startBand,
int endSample,
int endLine,
int endBand,
int numBytes )

This constructor creates a new cube chunk based on the provided coordinates and data size.

This constructor is provided in addition to the previous one for performance gain.

Parameters
startSamplethe starting sample of the chunk (inclusive)
startLinethe starting line of the chunk (inclusive)
startBandthe starting band of the chunk (inclusive)
endSamplethe ending sample of the chunk (inclusive)
endLinethe ending line of the chunk (inclusive)
endBandthe ending band of the chunk (inclusive)
numBytesthe number of raw data bytes in the chunk

Definition at line 56 of file RawCubeChunk.cpp.

References m_bandCount, m_dirty, m_lineCount, m_rawBuffer, m_rawBufferInternalPtr, m_sampleCount, m_startBand, m_startLine, and m_startSample.

◆ ~RawCubeChunk()

Isis::RawCubeChunk::~RawCubeChunk ( )
virtual

The destructor.

Definition at line 77 of file RawCubeChunk.cpp.

References m_rawBuffer, and m_rawBufferInternalPtr.

◆ RawCubeChunk() [3/3]

Isis::RawCubeChunk::RawCubeChunk ( const RawCubeChunk & other)
private

The copy constructor is disabled.

Parameters
otherthe other chunk to be copied from

Member Function Documentation

◆ bandCount()

int Isis::RawCubeChunk::bandCount ( ) const
inline
Returns
the number of bands in the cube chunk.

Definition at line 88 of file RawCubeChunk.h.

References m_bandCount.

Referenced by Isis::CubeIoHandler::getNullChunk().

◆ getByteCount()

int Isis::RawCubeChunk::getByteCount ( ) const
Returns
the size (in bytes) of the raw data buffer. If the raw data buffer is null, -1 is returned.

Definition at line 153 of file RawCubeChunk.cpp.

References m_rawBuffer.

◆ getChar()

unsigned char Isis::RawCubeChunk::getChar ( int offset) const

This method is currently not in use due to a faster way of getting data from the buffer (through the internal pointer).

Parameters
offsetthe offset into the raw data buffer
Returns
the char at the position indicated by the given offset.

Definition at line 120 of file RawCubeChunk.cpp.

References m_rawBuffer.

◆ getFloat()

float Isis::RawCubeChunk::getFloat ( int offset) const
Returns
the float at the position indicated by the given offset. The value returned is not byte swapped. This method is currently not in use due to a faster way of getting data from the buffer (through the internal pointer).
Parameters
offsetthe offset into the raw data buffer

Definition at line 144 of file RawCubeChunk.cpp.

References m_rawBuffer.

◆ getRawData()

QByteArray & Isis::RawCubeChunk::getRawData ( ) const
inline
Returns
a reference to the raw data in this cube chunk.

Definition at line 38 of file RawCubeChunk.h.

References m_rawBuffer.

Referenced by Isis::CubeIoHandler::getNullChunk().

◆ getShort()

short Isis::RawCubeChunk::getShort ( int offset) const
Returns
the short at the position indicated by the given offset. The value returned is not byte swapped. This method is currently not in use due to a faster way of getting data from the buffer (through the internal pointer).
Parameters
offsetthe offset into the raw data buffer

Definition at line 132 of file RawCubeChunk.cpp.

References m_rawBuffer.

◆ getStartBand()

int Isis::RawCubeChunk::getStartBand ( ) const
inline
Returns
the first (inclusive) band of the cube chunk.

Definition at line 67 of file RawCubeChunk.h.

References m_startBand.

Referenced by Isis::CubeIoHandler::getNullChunk().

◆ getStartLine()

int Isis::RawCubeChunk::getStartLine ( ) const
inline
Returns
the first (inclusive) line of the cube chunk.

Definition at line 60 of file RawCubeChunk.h.

References m_startLine.

Referenced by Isis::CubeIoHandler::getNullChunk(), and Isis::BoxcarCachingAlgorithm::recommendChunksToFree().

◆ getStartSample()

int Isis::RawCubeChunk::getStartSample ( ) const
inline
Returns
the first (inclusive) sample of the cube chunk.

Definition at line 53 of file RawCubeChunk.h.

References m_startSample.

Referenced by Isis::CubeIoHandler::getNullChunk().

◆ isDirty()

bool Isis::RawCubeChunk::isDirty ( ) const
Returns
true if the data in this chunk does not match what is on disk.

Definition at line 89 of file RawCubeChunk.cpp.

References m_dirty.

◆ lineCount()

int Isis::RawCubeChunk::lineCount ( ) const
inline
Returns
the number of lines in the cube chunk.

Definition at line 81 of file RawCubeChunk.h.

References m_lineCount.

Referenced by Isis::CubeIoHandler::getNullChunk().

◆ operator=()

RawCubeChunk & Isis::RawCubeChunk::operator= ( const RawCubeChunk & other)
private

The assignment operator is disabled.

Parameters
otherthe other chunk to be copied from
Returns
A reference to *this

◆ sampleCount()

int Isis::RawCubeChunk::sampleCount ( ) const
inline
Returns
the number of samples in the cube chunk.

Definition at line 74 of file RawCubeChunk.h.

References m_sampleCount.

Referenced by Isis::CubeIoHandler::getNullChunk().

◆ setData() [1/3]

void Isis::RawCubeChunk::setData ( const float & value,
const int & offset )

Sets the float at the given offset in the raw data buffer of this chunk.

The chunk's dirty flag is set to true.

Parameters
valuethe new float value
offsetthe position to place the new value at

Definition at line 196 of file RawCubeChunk.cpp.

References m_dirty, and m_rawBufferInternalPtr.

◆ setData() [2/3]

void Isis::RawCubeChunk::setData ( short value,
int offset )

Sets the short at the given offset in the raw data buffer of this chunk.

The chunk's dirty flag is set to true.

Parameters
valuethe new short value
offsetthe position to place the new value at

Definition at line 182 of file RawCubeChunk.cpp.

References m_dirty, and m_rawBufferInternalPtr.

◆ setData() [3/3]

void Isis::RawCubeChunk::setData ( unsigned char value,
int offset )

Sets the char at the given offset in the raw data buffer of this chunk.

The chunk's dirty flag is set to true.

Parameters
valuethe new char value
offsetthe position to place the new value at

Definition at line 168 of file RawCubeChunk.cpp.

References m_dirty, and m_rawBufferInternalPtr.

◆ setDirty()

void Isis::RawCubeChunk::setDirty ( bool dirty)

Sets the chunk's dirty flag, indicating whether or not the chunk's data matches the data that is on disk.

Parameters
dirtybool indicating whether the chunk is dirty or not

Definition at line 209 of file RawCubeChunk.cpp.

References m_dirty.

Referenced by Isis::CubeIoHandler::getNullChunk().

◆ setRawData()

void Isis::RawCubeChunk::setRawData ( QByteArray rawData)

Sets the chunk's raw data.

This size of the new raw data must match that of the chunk's current raw data buffer.

Parameters
rawDatathe raw data

Definition at line 100 of file RawCubeChunk.cpp.

References m_dirty, m_rawBuffer, m_rawBufferInternalPtr, and Isis::IException::Programmer.

Referenced by Isis::CubeIoHandler::getNullChunk().

Member Data Documentation

◆ m_bandCount

int Isis::RawCubeChunk::m_bandCount
private

The number of bands in the cube chunk.

Definition at line 129 of file RawCubeChunk.h.

Referenced by bandCount(), RawCubeChunk(), and RawCubeChunk().

◆ m_dirty

bool Isis::RawCubeChunk::m_dirty
private

True if the data does not match what is on disk.

Definition at line 117 of file RawCubeChunk.h.

Referenced by isDirty(), RawCubeChunk(), RawCubeChunk(), setData(), setData(), setData(), setDirty(), and setRawData().

◆ m_lineCount

int Isis::RawCubeChunk::m_lineCount
private

The number of lines in the cube chunk.

Definition at line 127 of file RawCubeChunk.h.

Referenced by lineCount(), RawCubeChunk(), and RawCubeChunk().

◆ m_rawBuffer

QByteArray* Isis::RawCubeChunk::m_rawBuffer
private

This is the raw data to be put on disk.

Definition at line 120 of file RawCubeChunk.h.

Referenced by getByteCount(), getChar(), getFloat(), getRawData(), getShort(), RawCubeChunk(), RawCubeChunk(), setRawData(), and ~RawCubeChunk().

◆ m_rawBufferInternalPtr

char* Isis::RawCubeChunk::m_rawBufferInternalPtr
private

This is the internal pointer to the raw buffer for performance.

Definition at line 122 of file RawCubeChunk.h.

Referenced by RawCubeChunk(), RawCubeChunk(), setData(), setData(), setData(), setRawData(), and ~RawCubeChunk().

◆ m_sampleCount

int Isis::RawCubeChunk::m_sampleCount
private

The number of samples in the cube chunk.

Definition at line 125 of file RawCubeChunk.h.

Referenced by RawCubeChunk(), RawCubeChunk(), and sampleCount().

◆ m_startBand

int Isis::RawCubeChunk::m_startBand
private

The one-based (inclusive) start band of the cube chunk.

Definition at line 136 of file RawCubeChunk.h.

Referenced by getStartBand(), RawCubeChunk(), and RawCubeChunk().

◆ m_startLine

int Isis::RawCubeChunk::m_startLine
private

The one-based (inclusive) start line of the cube chunk.

Definition at line 134 of file RawCubeChunk.h.

Referenced by getStartLine(), RawCubeChunk(), and RawCubeChunk().

◆ m_startSample

int Isis::RawCubeChunk::m_startSample
private

The one-based (inclusive) start sample of the cube chunk.

Definition at line 132 of file RawCubeChunk.h.

Referenced by getStartSample(), RawCubeChunk(), and RawCubeChunk().


The documentation for this class was generated from the following files: