HiRISE
 PDS_JP2

Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes

PDS_Data_Block Class Reference

A PDS_Data_Block describes a binary data block in a PDS label. More...

#include <PDS_Data_Block.hh>

Inheritance diagram for PDS_Data_Block:
Inheritance graph
[legend]
Collaboration diagram for PDS_Data_Block:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PDS_Data_Block ()
 Constructs an empty PDS_Data_Block.
 PDS_Data_Block (const idaeim::PVL::Aggregate &parameters, std::ios::off_type file_offset)
 Constructs a PDS_Data_Block from its PDS label parameters and source file data location.
 PDS_Data_Block (const idaeim::PVL::Aggregate &parameters, const std::string &filename)
 Constructs a PDS_Data_Block from its PDS label parameters and detached source file.
std::ios::off_type location ()
 Get the offset location of the binary data block in the source file.
unsigned long long size ()
 Get the size of the data block.

Static Public Attributes

static const char *const ID = "UA::HiRISE::PDS_Data_Block (1.12 2013/03/18 04:59:11)"
 Class identification.
static const char * BLOCK_WIDTH_PARAMETER_NAME = "ROW_BYTES"
 Name of the parameter specifying the binary block row width in bytes.
static const char * BLOCK_HEIGHT_PARAMETER_NAME = "ROWS"
 Name of the parameter specifying the binary block height in rows.

Protected Member Functions

virtual unsigned long long data_block_size ()
 Calculate the size of the binary data block.

Protected Attributes

std::ios::off_type Location
 Offset location of the data block in the source file.
unsigned long long Size
 Size of the data block in bytes.

Detailed Description

A PDS_Data_Block describes a binary data block in a PDS label.

A PDS_Data_Block is the PDS_Data parameters that describes a binary data block along with the location and size of the binary data in the source file. A binary data block is located in a PDS label by a data block record pointer parameter. A record pointer parameter has a name that begins with the PDS_Data::RECORD_POINTER_PARAMETER_MARKER character. The value of a pointer parameter is the record number (offset + 1) where the binary data is located in the file. A Parameter Aggregate with the same name, but without the record pointer marker, contains the parameters that desrcribe the data block.

Author:
Bradford Castalia, Drew Davidson and Ben Pearson, UA/HiROC
Version:
1.9
See also:
PDS_Data

Constructor & Destructor Documentation

Constructs an empty PDS_Data_Block.

PDS_Data_Block ( const idaeim::PVL::Aggregate parameters,
std::ios::off_type  file_offset 
)

Constructs a PDS_Data_Block from its PDS label parameters and source file data location.

N.B.: The Parameter Aggregate describing the data block is copied.

Parameters:
parametersParameter Aggregate describing the data block
file_offsetData block offset location in the source file.

References Parameter::name().

PDS_Data_Block ( const idaeim::PVL::Aggregate parameters,
const std::string &  filename 
)

Constructs a PDS_Data_Block from its PDS label parameters and detached source file.

N.B.: The Parameter Aggregate describing the data block is copied.

Parameters:
parametersParameter Aggregate describing the data block
file_offsetData block offset location in the source file.

References Parameter::name().


Member Function Documentation

std::ios::off_type location (  ) [inline]

Get the offset location of the binary data block in the source file.

Returns:
The file offset location of the binary data block.

References PDS_Data_Block::Location.

Referenced by main().

unsigned long long size (  ) [inline]

Get the size of the data block.

Returns:
The size of the data block, in bytes.

References PDS_Data_Block::Size.

Referenced by main().

unsigned long long data_block_size (  ) [protected, virtual]

Calculate the size of the binary data block.

The value of the BLOCK_WIDTH_PARAMETER_NAME parameter is multiplied by the value of the BLOCK_HEIGHT_PARAMETER_NAME parameter. If either of these parameters are not found in the data block description the result will be zero.

N.B.: This method may be overriden by subclasses that need to specialize how the data block size is determined.

Returns:
The size (bytes) of the binary data block in the source file.

Reimplemented in Image_Data_Block.

References PDS_Data_Block::BLOCK_HEIGHT_PARAMETER_NAME, PDS_Data_Block::BLOCK_WIDTH_PARAMETER_NAME, PDS_Data::find_parameter(), and Parameter::value().


Member Data Documentation

const char *const ID = "UA::HiRISE::PDS_Data_Block (1.12 2013/03/18 04:59:11)" [static]

Class identification.

Reimplemented from PDS_Data.

Reimplemented in Image_Data_Block.

const char * BLOCK_WIDTH_PARAMETER_NAME = "ROW_BYTES" [static]

Name of the parameter specifying the binary block row width in bytes.

Referenced by PDS_Data_Block::data_block_size().

const char * BLOCK_HEIGHT_PARAMETER_NAME = "ROWS" [static]

Name of the parameter specifying the binary block height in rows.

Referenced by PDS_Data_Block::data_block_size().

std::ios::off_type Location [protected]

Offset location of the data block in the source file.

Referenced by PDS_Data_Block::location().

unsigned long long Size [protected]

Size of the data block in bytes.

Referenced by PDS_Data_Block::size().


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