libgta  1.0.4
Read and Write Generic Tagged Array (GTA) files
gta::header Class Reference

The GTA header. More...

List of all members.

Public Member Functions

Constructor / Destructor & Co.
 header ()
 Constructor.
 header (const header &hdr)
 Copy constructor.
 ~header ()
 Destructor.
const headeroperator= (const header &hdr)
 Assignment operator.
Read and Write a Header
void read_from (custom_io &io)
 Read a header.
void read_from (std::istream &is)
 Read a header.
void read_from (FILE *f)
 Read a header.
void read_from (int fd)
 Read a header.
void write_to (custom_io &io) const
 Write a header.
void write_to (std::ostream &os) const
 Write a header.
void write_to (FILE *f) const
 Write a header.
void write_to (int fd) const
 Write a header.
Access Header Information
const taglistglobal_taglist () const
 Get the global tag list.
taglistglobal_taglist ()
 Get the global tag list.
uintmax_t element_size () const
 Get the element size.
uintmax_t components () const
 Get the number of components.
type component_type (uintmax_t i) const
 Get the component type.
uintmax_t component_size (uintmax_t i) const
 Get the component size.
const taglistcomponent_taglist (uintmax_t i) const
 Get the component tag list.
taglistcomponent_taglist (uintmax_t i)
 Get the component tag list.
uintmax_t dimensions () const
 Get the number of dimensions.
uintmax_t dimension_size (uintmax_t i) const
 Get the size in a dimension.
const taglistdimension_taglist (uintmax_t i) const
 Get the dimension tag list.
taglistdimension_taglist (uintmax_t i)
 Get the dimension tag list.
uintmax_t elements () const
 Get the total number of elements in the array.
uintmax_t data_size () const
 Get the total size of the array.
gta::compression compression () const
 Get the compression.
void set_compression (gta::compression compression)
 Set the compression.
Define an Array
void set_components (uintmax_t n, const type *types, const uintmax_t *sizes=NULL)
 Set the components of an array element.
void set_components (type type, uintmax_t size=0)
 Set the components of an array element (variant for elements with a single component).
void set_components (type type0, type type1, uintmax_t size0=0, uintmax_t size1=0)
 Set the components of an array element (variant for elements with two components).
void set_components (type type0, type type1, type type2, uintmax_t size0=0, uintmax_t size1=0, uintmax_t size2=0)
 Set the components of an array element (variant for elements with three components).
void set_components (type type0, type type1, type type2, type type3, uintmax_t size0=0, uintmax_t size1=0, uintmax_t size2=0, uintmax_t size3=0)
 Set the components of an array element (variant for elements with four components).
void set_dimensions (uintmax_t n, const uintmax_t *sizes)
 Set the dimensions.
void set_dimensions (uintmax_t size)
 Set the dimensions (variant for one-dimensional arrays).
void set_dimensions (uintmax_t size0, uintmax_t size1)
 Set the dimensions (variant for two-dimensional arrays).
void set_dimensions (uintmax_t size0, uintmax_t size1, uintmax_t size2)
 Set the dimensions (variant for three-dimensional arrays).
void set_dimensions (uintmax_t size0, uintmax_t size1, uintmax_t size2, uintmax_t size3)
 Set the dimensions (variant for four-dimensional arrays).
Read and Write Complete Arrays
void read_data (custom_io &io, void *data) const
 Read the complete data.
void read_data (std::istream &is, void *data) const
 Read the complete data.
void read_data (FILE *f, void *data) const
 Read the complete data.
void read_data (int fd, void *data) const
 Read the complete data.
void skip_data (custom_io &io) const
 Skip the complete data.
void skip_data (std::istream &is) const
 Skip the complete data.
void skip_data (FILE *f) const
 Skip the complete data.
void skip_data (int fd) const
 Skip the complete data.
void write_data (custom_io &io, const void *data) const
 Write the complete data.
void write_data (std::ostream &os, const void *data) const
 Write the complete data.
void write_data (FILE *f, const void *data) const
 Write the complete data.
void write_data (int fd, const void *data) const
 Write the complete data.
void copy_data (custom_io &read_io, const header &write_header, custom_io &write_io) const
 Copy the complete data.
void copy_data (std::istream &is, const header &write_header, std::ostream &os) const
 Copy the complete data.
void copy_data (FILE *fi, const header &write_header, FILE *fo) const
 Copy the complete data.
void copy_data (int fdi, const header &write_header, int fdo) const
 Copy the complete data.
In-Memory Data Access
void linear_index_to_indices (uintmax_t index, uintmax_t *indices) const
 Transform a linear index to array indices.
uintmax_t indices_to_linear_index (const uintmax_t *indices) const
 Transform array indices to a linear index.
const void * element (const void *data, const uintmax_t *indices) const
 Get an array element.
void * element (void *data, const uintmax_t *indices) const
 Get an array element.
const void * element (const void *data, uintmax_t index) const
 Get an array element via a linear index.
void * element (void *data, uintmax_t index) const
 Get an array element via a linear index.
const void * element (const void *data, uintmax_t index0, uintmax_t index1) const
 Get an array element (variant for two-dimensional arrays).
void * element (void *data, uintmax_t index0, uintmax_t index1) const
 Get an array element (variant for two-dimensional arrays).
const void * element (const void *data, uintmax_t index0, uintmax_t index1, uintmax_t index2) const
 Get an array element (variant for three-dimensional arrays).
void * element (void *data, uintmax_t index0, uintmax_t index1, uintmax_t index2) const
 Get an array element (variant for three-dimensional arrays).
const void * element (const void *data, uintmax_t index0, uintmax_t index1, uintmax_t index2, uintmax_t index3) const
 Get an array element (variant for four-dimensional arrays).
void * element (void *data, uintmax_t index0, uintmax_t index1, uintmax_t index2, uintmax_t index3) const
 Get an array element (variant for four-dimensional arrays).
const void * component (const void *element, uintmax_t i) const
 Get a component of an array element.
void * component (void *element, uintmax_t i) const
 Get a component of an array element.
Read and Write Array Elements

These functions are intended to be used for filtering a complete array on a per-element basis. They read or write a given number of elements, and it is expected that they are used repeatedly until all elements of an array have been read or written. Theses function work for all GTAs, with or without compression, an the input and output streams do not need to be seekable.

Element-based input/output needs a state object gta::io_state. The same state object must be used until all elements are read or written, or until an error occurs.

void read_elements (io_state &state, custom_io &io, uintmax_t n, void *buf) const
 Read array elements.
void read_elements (io_state &state, std::istream &is, uintmax_t n, void *buf) const
 Read array elements.
void read_elements (io_state &state, FILE *f, uintmax_t n, void *buf) const
 Read array elements.
void read_elements (io_state &state, int fd, uintmax_t n, void *buf) const
 Read array elements.
void write_elements (io_state &state, custom_io &io, uintmax_t n, const void *buf) const
 Write array elements.
void write_elements (io_state &state, std::ostream &os, uintmax_t n, const void *buf) const
 Write array elements.
void write_elements (io_state &state, FILE *f, uintmax_t n, const void *buf) const
 Write array elements.
void write_elements (io_state &state, int fd, uintmax_t n, const void *buf) const
 Write array elements.
Read and Write Array Blocks

These functions can only be used if the data is not compressed (see header::compression()) and the input/output is seekable.
They are suitable for applications that do not want to store the complete array data in memory.
A block is given by the lowest and highest element coordinates in each dimension. For example, for a 2D array from which we want a rectangle of 20x10 elements starting at element (5,3), we would store the values (5,3) in lower_coordinates and (24, 12) in higher_coordinates.

void read_block (custom_io &io, uintmax_t data_offset, const uintmax_t *lower_coordinates, const uintmax_t *higher_coordinates, void *block) const
 Read an array block.
void read_block (std::istream &is, uintmax_t data_offset, const uintmax_t *lower_coordinates, const uintmax_t *higher_coordinates, void *block) const
 Read an array block.
void read_block (FILE *f, uintmax_t data_offset, const uintmax_t *lower_coordinates, const uintmax_t *higher_coordinates, void *block) const
 Read an array block.
void read_block (int fd, uintmax_t data_offset, const uintmax_t *lower_coordinates, const uintmax_t *higher_coordinates, void *block) const
 Read an array block.
void write_block (custom_io &io, uintmax_t data_offset, const uintmax_t *lower_coordinates, const uintmax_t *higher_coordinates, const void *block) const
 Write an array block.
void write_block (std::ostream &os, uintmax_t data_offset, const uintmax_t *lower_coordinates, const uintmax_t *higher_coordinates, const void *block) const
 Write an array block.
void write_block (FILE *f, uintmax_t data_offset, const uintmax_t *lower_coordinates, const uintmax_t *higher_coordinates, const void *block) const
 Write an array block.
void write_block (int fd, uintmax_t data_offset, const uintmax_t *lower_coordinates, const uintmax_t *higher_coordinates, const void *block) const
 Write an array block.

Detailed Description

The GTA header.

Each GTA file is described by its header. It stores information about the array elements and the dimensions, and the various tag lists. Using the header, one can access the data in a GTA file, either by managaing the complete data in memory (if it fits), or by using out-of-core data read/write functions. There are also functions that help the application to implement its own data access scheme, if that is necessary.


Constructor & Destructor Documentation

gta::header::header ( const header hdr) [inline]

Copy constructor.

Parameters:
hdrThe header to copy.

Member Function Documentation

const header& gta::header::operator= ( const header hdr) [inline]

Assignment operator.

Parameters:
hdrThe header to copy.
void gta::header::read_from ( custom_io io) [inline]

Read a header.

Parameters:
ioCustom input object.
void gta::header::read_from ( std::istream &  is) [inline]

Read a header.

Parameters:
isInput stream.
void gta::header::read_from ( FILE *  f) [inline]

Read a header.

Parameters:
fInput C stream.
void gta::header::read_from ( int  fd) [inline]

Read a header.

Parameters:
fdInput file descriptor.
void gta::header::write_to ( custom_io io) const [inline]

Write a header.

Parameters:
ioCustom output object.
void gta::header::write_to ( std::ostream &  os) const [inline]

Write a header.

Parameters:
osOutput stream.
void gta::header::write_to ( FILE *  f) const [inline]

Write a header.

Parameters:
fOutput C stream.
void gta::header::write_to ( int  fd) const [inline]

Write a header.

Parameters:
fdOutput file descriptor.
const taglist& gta::header::global_taglist ( ) const [inline]

Get the global tag list.

Returns:
The global tag list.

Get the global tag list.

Returns:
The global tag list.
uintmax_t gta::header::element_size ( ) const [inline]

Get the element size.

Returns:
The size of an array element.
uintmax_t gta::header::components ( ) const [inline]

Get the number of components.

Returns:
The number of components.
type gta::header::component_type ( uintmax_t  i) const [inline]

Get the component type.

Parameters:
iThe component index.
Returns:
The type of the component.
uintmax_t gta::header::component_size ( uintmax_t  i) const [inline]

Get the component size.

Parameters:
iThe component index.
Returns:
The size of the component.
const taglist& gta::header::component_taglist ( uintmax_t  i) const [inline]

Get the component tag list.

Parameters:
iThe component index.
Returns:
The tag list of the component.
taglist& gta::header::component_taglist ( uintmax_t  i) [inline]

Get the component tag list.

Parameters:
iThe component index.
Returns:
The tag list of the component.
uintmax_t gta::header::dimensions ( ) const [inline]

Get the number of dimensions.

Returns:
The number of dimensions.
uintmax_t gta::header::dimension_size ( uintmax_t  i) const [inline]

Get the size in a dimension.

Parameters:
iThe dimension index.
Returns:
The size in the dimension.
const taglist& gta::header::dimension_taglist ( uintmax_t  i) const [inline]

Get the dimension tag list.

Parameters:
iThe dimension index.
Returns:
The tag list of the dimension.
taglist& gta::header::dimension_taglist ( uintmax_t  i) [inline]

Get the dimension tag list.

Parameters:
iThe dimension index.
Returns:
The tag list of the dimension.
uintmax_t gta::header::elements ( ) const [inline]

Get the total number of elements in the array.

Returns:
The total number of elements in the array.
uintmax_t gta::header::data_size ( ) const [inline]

Get the total size of the array.

Returns:
The size (in bytes) of the complete array.

Get the compression.

Returns:
The compression type.

Gets the compression type for the header and data.
See gta_compression_t for more information on compression types.
Compressed data is always stored in chunks, while uncompressed data is never stored in chunks.

void gta::header::set_compression ( gta::compression  compression) [inline]

Set the compression.

Parameters:
compressionThe compression type.

Sets the compression type for writing the header and data.
See gta_compression_t for more information on compression types.

void gta::header::set_components ( uintmax_t  n,
const type types,
const uintmax_t *  sizes = NULL 
) [inline]

Set the components of an array element.

Parameters:
nThe number of components.
typesThe types of the n components.
sizesNULL, or the sizes of the components that have type gta::blob.

Set the components of the array elements.
The sizes parameter can be NULL if no components have the type gta::blob. Otherwise, it must point to a list that contains the sizes of these components (and only these components). For example, if there are five components, but only two have the type gta::blob, then the sizes list must contain two size values.
All components will initially have an empty tag list.

void gta::header::set_components ( type  type,
uintmax_t  size = 0 
) [inline]

Set the components of an array element (variant for elements with a single component).

Parameters:
typeThe type of the component.
sizeThe size of the component, in case the type is gta::blob.
void gta::header::set_components ( type  type0,
type  type1,
uintmax_t  size0 = 0,
uintmax_t  size1 = 0 
) [inline]

Set the components of an array element (variant for elements with two components).

Parameters:
type0The type of the first component.
type1The type of the second component.
size0The size of the first component, in case its type is gta::blob.
size1The size of the second component, in case its type is gta::blob.
void gta::header::set_components ( type  type0,
type  type1,
type  type2,
uintmax_t  size0 = 0,
uintmax_t  size1 = 0,
uintmax_t  size2 = 0 
) [inline]

Set the components of an array element (variant for elements with three components).

Parameters:
type0The type of the first component.
type1The type of the second component.
type2The type of the third component.
size0The size of the first component, in case its type is gta::blob.
size1The size of the second component, in case its type is gta::blob.
size2The size of the third component, in case its type is gta::blob.
void gta::header::set_components ( type  type0,
type  type1,
type  type2,
type  type3,
uintmax_t  size0 = 0,
uintmax_t  size1 = 0,
uintmax_t  size2 = 0,
uintmax_t  size3 = 0 
) [inline]

Set the components of an array element (variant for elements with four components).

Parameters:
type0The type of the first component.
type1The type of the second component.
type2The type of the third component.
type3The type of the fourth component.
size0The size of the first component, in case its type is gta::blob.
size1The size of the second component, in case its type is gta::blob.
size2The size of the third component, in case its type is gta::blob.
size3The size of the fourth component, in case its type is gta::blob.
void gta::header::set_dimensions ( uintmax_t  n,
const uintmax_t *  sizes 
) [inline]

Set the dimensions.

Parameters:
nThe number of dimensions.
sizesThe array sizes in each of the
dimensions.

Sets the array dimensions.
All dimensions will initially have an empty tag list.

void gta::header::set_dimensions ( uintmax_t  size) [inline]

Set the dimensions (variant for one-dimensional arrays).

Parameters:
sizeThe size in the single dimension.
void gta::header::set_dimensions ( uintmax_t  size0,
uintmax_t  size1 
) [inline]

Set the dimensions (variant for two-dimensional arrays).

Parameters:
size0The size in the first dimension.
size1The size in the second dimension.
void gta::header::set_dimensions ( uintmax_t  size0,
uintmax_t  size1,
uintmax_t  size2 
) [inline]

Set the dimensions (variant for three-dimensional arrays).

Parameters:
size0The size in the first dimension.
size1The size in the second dimension.
size2The size in the third dimension.
void gta::header::set_dimensions ( uintmax_t  size0,
uintmax_t  size1,
uintmax_t  size2,
uintmax_t  size3 
) [inline]

Set the dimensions (variant for four-dimensional arrays).

Parameters:
size0The size in the first dimension.
size1The size in the second dimension.
size2The size in the third dimension.
size3The size in the fourth dimension.
void gta::header::read_data ( custom_io io,
void *  data 
) const [inline]

Read the complete data.

Parameters:
ioCustom input object.
dataData buffer.

Reads the complete data into the given buffer. The buffer must be large enough.

void gta::header::read_data ( std::istream &  is,
void *  data 
) const [inline]

Read the complete data.

Parameters:
isInput stream.
dataData buffer.

Reads the complete data into the given buffer. The buffer must be large enough.

void gta::header::read_data ( FILE *  f,
void *  data 
) const [inline]

Read the complete data.

Parameters:
fInput C stream.
dataData buffer.

Reads the complete data into the given buffer. The buffer must be large enough.

void gta::header::read_data ( int  fd,
void *  data 
) const [inline]

Read the complete data.

Parameters:
fdInput file descriptor.
dataData buffer.

Reads the complete data into the given buffer. The buffer must be large enough.

void gta::header::skip_data ( custom_io io) const [inline]

Skip the complete data.

Parameters:
ioCustom input object.

Skips the complete data, so that the next GTA header can be read.

void gta::header::skip_data ( std::istream &  is) const [inline]

Skip the complete data.

Parameters:
isInput stream.

Skips the complete data, so that the next GTA header can be read.

void gta::header::skip_data ( FILE *  f) const [inline]

Skip the complete data.

Parameters:
fInput C stream.

Skips the complete data, so that the next GTA header can be read.

void gta::header::skip_data ( int  fd) const [inline]

Skip the complete data.

Parameters:
fdInput file descriptor.

Skips the complete data, so that the next GTA header can be read.

void gta::header::write_data ( custom_io io,
const void *  data 
) const [inline]

Write the complete data.

Parameters:
ioCustom output object.
dataData buffer.
void gta::header::write_data ( std::ostream &  os,
const void *  data 
) const [inline]

Write the complete data.

Parameters:
osOutput stream.
dataData buffer.
void gta::header::write_data ( FILE *  f,
const void *  data 
) const [inline]

Write the complete data.

Parameters:
fOutput C stream.
dataData buffer.
void gta::header::write_data ( int  fd,
const void *  data 
) const [inline]

Write the complete data.

Parameters:
fdOutput file descriptor.
dataData buffer.
void gta::header::copy_data ( custom_io read_io,
const header write_header,
custom_io write_io 
) const [inline]

Copy the complete data.

Parameters:
read_ioCustom input object.
write_headerOutput header.
write_ioCustom output object.
void gta::header::copy_data ( std::istream &  is,
const header write_header,
std::ostream &  os 
) const [inline]

Copy the complete data.

Parameters:
isInput stream.
write_headerOutput header.
osOutput stream.
void gta::header::copy_data ( FILE *  fi,
const header write_header,
FILE *  fo 
) const [inline]

Copy the complete data.

Parameters:
fiInput C stream.
write_headerOutput header.
foOutput C stream.
void gta::header::copy_data ( int  fdi,
const header write_header,
int  fdo 
) const [inline]

Copy the complete data.

Parameters:
fdiInput file descriptor.
write_headerOutput header.
fdoOutput file descriptor.
void gta::header::linear_index_to_indices ( uintmax_t  index,
uintmax_t *  indices 
) const [inline]

Transform a linear index to array indices.

Parameters:
indexThe linear index.
indicesThe array indices.
uintmax_t gta::header::indices_to_linear_index ( const uintmax_t *  indices) const [inline]

Transform array indices to a linear index.

Parameters:
indicesThe array indices.
Returns:
The linear index.
const void* gta::header::element ( const void *  data,
const uintmax_t *  indices 
) const [inline]

Get an array element.

Parameters:
dataData Buffer.
indicesIndices for each dimension of the array.
Returns:
A pointer to the element.
void* gta::header::element ( void *  data,
const uintmax_t *  indices 
) const [inline]

Get an array element.

Parameters:
dataData Buffer.
indicesIndices for each dimension of the array.
Returns:
A pointer to the element.
const void* gta::header::element ( const void *  data,
uintmax_t  index 
) const [inline]

Get an array element via a linear index.

Parameters:
dataData Buffer.
indexIndex of the element.
Returns:
A pointer to the element.

This function not only works for one-dimensional arrays in the obvious way, but also for multidimensional arrays by using index as a linear index to the array data.

void* gta::header::element ( void *  data,
uintmax_t  index 
) const [inline]

Get an array element via a linear index.

Parameters:
dataData Buffer.
indexIndex of the element.
Returns:
A pointer to the element.

This function not only works for one-dimensional arrays in the obvious way, but also for multidimensional arrays by using index as a linear index to the array data.

const void* gta::header::element ( const void *  data,
uintmax_t  index0,
uintmax_t  index1 
) const [inline]

Get an array element (variant for two-dimensional arrays).

Parameters:
dataData Buffer.
index0Index of the element in the first dimension.
index1Index of the element in the second dimension.
Returns:
A pointer to the element.
void* gta::header::element ( void *  data,
uintmax_t  index0,
uintmax_t  index1 
) const [inline]

Get an array element (variant for two-dimensional arrays).

Parameters:
dataData Buffer.
index0Index of the element in the first dimension.
index1Index of the element in the second dimension.
Returns:
A pointer to the element.
const void* gta::header::element ( const void *  data,
uintmax_t  index0,
uintmax_t  index1,
uintmax_t  index2 
) const [inline]

Get an array element (variant for three-dimensional arrays).

Parameters:
dataData Buffer.
index0Index of the element in the first dimension.
index1Index of the element in the second dimension.
index2Index of the element in the third dimension.
Returns:
A pointer to the element.
void* gta::header::element ( void *  data,
uintmax_t  index0,
uintmax_t  index1,
uintmax_t  index2 
) const [inline]

Get an array element (variant for three-dimensional arrays).

Parameters:
dataData Buffer.
index0Index of the element in the first dimension.
index1Index of the element in the second dimension.
index2Index of the element in the third dimension.
Returns:
A pointer to the element.
const void* gta::header::element ( const void *  data,
uintmax_t  index0,
uintmax_t  index1,
uintmax_t  index2,
uintmax_t  index3 
) const [inline]

Get an array element (variant for four-dimensional arrays).

Parameters:
dataData Buffer.
index0Index of the element in the first dimension.
index1Index of the element in the second dimension.
index2Index of the element in the third dimension.
index3Index of the element in the fourth dimension.
Returns:
A pointer to the element.
void* gta::header::element ( void *  data,
uintmax_t  index0,
uintmax_t  index1,
uintmax_t  index2,
uintmax_t  index3 
) const [inline]

Get an array element (variant for four-dimensional arrays).

Parameters:
dataData Buffer.
index0Index of the element in the first dimension.
index1Index of the element in the second dimension.
index2Index of the element in the third dimension.
index3Index of the element in the fourth dimension.
Returns:
A pointer to the element.
const void* gta::header::component ( const void *  element,
uintmax_t  i 
) const [inline]

Get a component of an array element.

Parameters:
elementElement.
iComponent index.
Returns:
A pointer to the component.
void* gta::header::component ( void *  element,
uintmax_t  i 
) const [inline]

Get a component of an array element.

Parameters:
elementElement.
iComponent index.
Returns:
A pointer to the component.
void gta::header::read_elements ( io_state state,
custom_io io,
uintmax_t  n,
void *  buf 
) const [inline]

Read array elements.

Parameters:
stateThe input/output state.
ioCustom input object.
nThe number of elements to read.
bufThe buffer for the elements.

Reads the given number of elements into the given buffer, which must be large enough.

void gta::header::read_elements ( io_state state,
std::istream &  is,
uintmax_t  n,
void *  buf 
) const [inline]

Read array elements.

Parameters:
stateThe input/output state.
isInput stream.
nThe number of elements to read.
bufThe buffer for the elements.

Reads the given number of elements into the given buffer, which must be large enough.

void gta::header::read_elements ( io_state state,
FILE *  f,
uintmax_t  n,
void *  buf 
) const [inline]

Read array elements.

Parameters:
stateThe input/output state.
fInput stream.
nThe number of elements to read.
bufThe buffer for the elements.

Reads the given number of elements into the given buffer, which must be large enough.

void gta::header::read_elements ( io_state state,
int  fd,
uintmax_t  n,
void *  buf 
) const [inline]

Read array elements.

Parameters:
stateThe input/output state.
fdInput file descriptor.
nThe number of elements to read.
bufThe buffer for the elements.

Reads the given number of elements into the given buffer, which must be large enough.

void gta::header::write_elements ( io_state state,
custom_io io,
uintmax_t  n,
const void *  buf 
) const [inline]

Write array elements.

Parameters:
stateThe input/output state.
ioCustom output object.
nThe number of elements to write.
bufThe buffer for the elements.

Writes the given number of elements from the given buffer.

void gta::header::write_elements ( io_state state,
std::ostream &  os,
uintmax_t  n,
const void *  buf 
) const [inline]

Write array elements.

Parameters:
stateThe input/output state.
osOutput stream.
nThe number of elements to write.
bufThe buffer for the elements.

Writes the given number of elements from the given buffer.

void gta::header::write_elements ( io_state state,
FILE *  f,
uintmax_t  n,
const void *  buf 
) const [inline]

Write array elements.

Parameters:
stateThe input/output state.
fOutput stream.
nThe number of elements to write.
bufThe buffer for the elements.

Writes the given number of elements from the given buffer.

void gta::header::write_elements ( io_state state,
int  fd,
uintmax_t  n,
const void *  buf 
) const [inline]

Write array elements.

Parameters:
stateThe input/output state.
fdOutput file descriptor.
nThe number of elements to write.
bufThe buffer for the elements.

Writes the given number of elements from the given buffer.

void gta::header::read_block ( custom_io io,
uintmax_t  data_offset,
const uintmax_t *  lower_coordinates,
const uintmax_t *  higher_coordinates,
void *  block 
) const [inline]

Read an array block.

Parameters:
ioCustom input object.
data_offsetOffset of the first data byte.
lower_coordinatesCoordinates of the lower corner element of the block.
higher_coordinatesCoordinates of the higher corner element of the block.
blockBlock buffer.

Reads the given array block and copies it to the given block buffer, which must be large enough.
This function modifies the file position indicator of the input.

void gta::header::read_block ( std::istream &  is,
uintmax_t  data_offset,
const uintmax_t *  lower_coordinates,
const uintmax_t *  higher_coordinates,
void *  block 
) const [inline]

Read an array block.

Parameters:
isInput stream.
data_offsetOffset of the first data byte.
lower_coordinatesCoordinates of the lower corner element of the block.
higher_coordinatesCoordinates of the higher corner element of the block.
blockBlock buffer.

Reads the given array block and copies it to the given block buffer, which must be large enough.
This function modifies the file position indicator of the input.

void gta::header::read_block ( FILE *  f,
uintmax_t  data_offset,
const uintmax_t *  lower_coordinates,
const uintmax_t *  higher_coordinates,
void *  block 
) const [inline]

Read an array block.

Parameters:
fInput C stream.
data_offsetOffset of the first data byte.
lower_coordinatesCoordinates of the lower corner element of the block.
higher_coordinatesCoordinates of the higher corner element of the block.
blockBlock buffer.

Reads the given array block and copies it to the given block buffer, which must be large enough.
This function modifies the file position indicator of the input.

void gta::header::read_block ( int  fd,
uintmax_t  data_offset,
const uintmax_t *  lower_coordinates,
const uintmax_t *  higher_coordinates,
void *  block 
) const [inline]

Read an array block.

Parameters:
fdInput file descriptor.
data_offsetOffset of the first data byte.
lower_coordinatesCoordinates of the lower corner element of the block.
higher_coordinatesCoordinates of the higher corner element of the block.
blockBlock buffer.

Reads the given array block and copies it to the given block buffer, which must be large enough.
This function modifies the file position indicator of the input.

void gta::header::write_block ( custom_io io,
uintmax_t  data_offset,
const uintmax_t *  lower_coordinates,
const uintmax_t *  higher_coordinates,
const void *  block 
) const [inline]

Write an array block.

Parameters:
ioCustom output object.
data_offsetOffset of the first data byte.
lower_coordinatesCoordinates of the lower corner element of the block.
higher_coordinatesCoordinates of the higher corner element of the block.
blockBlock buffer.

This function modifies the file position indicator of the output.

void gta::header::write_block ( std::ostream &  os,
uintmax_t  data_offset,
const uintmax_t *  lower_coordinates,
const uintmax_t *  higher_coordinates,
const void *  block 
) const [inline]

Write an array block.

Parameters:
osOutput stream.
data_offsetOffset of the first data byte.
lower_coordinatesCoordinates of the lower corner element of the block.
higher_coordinatesCoordinates of the higher corner element of the block.
blockBlock buffer.

This function modifies the file position indicator of the output.

void gta::header::write_block ( FILE *  f,
uintmax_t  data_offset,
const uintmax_t *  lower_coordinates,
const uintmax_t *  higher_coordinates,
const void *  block 
) const [inline]

Write an array block.

Parameters:
fOutput C stream.
data_offsetOffset of the first data byte.
lower_coordinatesCoordinates of the lower corner element of the block.
higher_coordinatesCoordinates of the higher corner element of the block.
blockBlock buffer.

This function modifies the file position indicator of the output.

void gta::header::write_block ( int  fd,
uintmax_t  data_offset,
const uintmax_t *  lower_coordinates,
const uintmax_t *  higher_coordinates,
const void *  block 
) const [inline]

Write an array block.

Parameters:
fdOutput file descriptor.
data_offsetOffset of the first data byte.
lower_coordinatesCoordinates of the lower corner element of the block.
higher_coordinatesCoordinates of the higher corner element of the block.
blockBlock buffer.

This function modifies the file position indicator of the output.


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