libgta 1.0.6 Read and Write Generic Tagged Array (GTA) files

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

List of all members
gta::header Class Reference

The GTA header. More...

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

## 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

  hdr | The header to copy.

## Member Function Documentation

const header& gta::header::operator= | ( | const header & | hdr | ) |
| inline

Assignment operator.

Parameters

  hdr | The header to copy.

void gta::header::read_from | ( | custom_io & | io | ) |
| inline

Read a header.

Parameters

  io | Custom input object.

void gta::header::read_from | ( | std::istream & | is | ) |
| inline

Read a header.

Parameters

  is | Input stream.

void gta::header::read_from | ( | FILE * | f | ) |
| inline

Read a header.

Parameters

  f | Input C stream.

void gta::header::read_from | ( | int | fd | ) |
| inline

Read a header.

Parameters

  fd | Input file descriptor.

void gta::header::write_to | ( | custom_io & | io | ) | const
| inline

Write a header.

Parameters

  io | Custom output object.

void gta::header::write_to | ( | std::ostream & | os | ) | const
| inline

Write a header.

Parameters

  os | Output stream.

void gta::header::write_to | ( | FILE * | f | ) | const
| inline

Write a header.

Parameters

  f | Output C stream.

void gta::header::write_to | ( | int | fd | ) | const
| inline

Write a header.

Parameters

  fd | Output file descriptor.

const taglist& gta::header::global_taglist | ( |  | ) | const
| inline

Get the global tag list.

Returns
  The global tag list.

taglist& gta::header::global_taglist | ( |  | ) |
| inline

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

  i | The component index.

Returns
  The type of the component.

uintmax_t gta::header::component_size | ( | uintmax_t | i | ) | const
| inline

Get the component size.

Parameters

  i | The 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

  i | The component index.

Returns
  The tag list of the component.

taglist& gta::header::component_taglist | ( | uintmax_t | i | ) |
| inline

Get the component tag list.

Parameters

  i | The 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

  i | The 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

  i | The dimension index.

Returns
  The tag list of the dimension.

taglist& gta::header::dimension_taglist | ( | uintmax_t | i | ) |
| inline

Get the dimension tag list.

Parameters

  i | The 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.

gta::compression gta::header::compression | ( |  | ) | const
| inline

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

  compression | The 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

  n | The number of components.
  types | The types of the n components.
  sizes | NULL, 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

  type | The type of the component.
  size | The 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

  type0 | The type of the first component.
  type1 | The type of the second component.
  size0 | The size of the first component, in case its type is gta::blob.
  size1 | The 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

  type0 | The type of the first component.
  type1 | The type of the second component.
  type2 | The type of the third component.
  size0 | The size of the first component, in case its type is gta::blob.
  size1 | The size of the second component, in case its type is gta::blob.
  size2 | The 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

  type0 | The type of the first component.
  type1 | The type of the second component.
  type2 | The type of the third component.
  type3 | The type of the fourth component.
  size0 | The size of the first component, in case its type is gta::blob.
  size1 | The size of the second component, in case its type is gta::blob.
  size2 | The size of the third component, in case its type is gta::blob.
  size3 | The 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

  n | The number of dimensions.
  sizes | The 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

  size | The 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

  size0 | The size in the first dimension.
  size1 | The 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

  size0 | The size in the first dimension.
  size1 | The size in the second dimension.
  size2 | The 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

  size0 | The size in the first dimension.
  size1 | The size in the second dimension.
  size2 | The size in the third dimension.
  size3 | The size in the fourth dimension.

void gta::header::read_data | ( | custom_io & | io,
|  | void * | data
| ) |  | const
| inline

Read the complete data.

Parameters

  io | Custom input object.
  data | Data 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

  is | Input stream.
  data | Data 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

  f | Input C stream.
  data | Data 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

  fd | Input file descriptor.
  data | Data 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

  io | Custom 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

  is | Input 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

  f | Input 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

  fd | Input 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

  io | Custom output object.
  data | Data buffer.

void gta::header::write_data | ( | std::ostream & | os,
|  | const void * | data
| ) |  | const
| inline

Write the complete data.

Parameters

  os | Output stream.
  data | Data buffer.

void gta::header::write_data | ( | FILE * | f,
|  | const void * | data
| ) |  | const
| inline

Write the complete data.

Parameters

  f | Output C stream.
  data | Data buffer.

void gta::header::write_data | ( | int | fd,
|  | const void * | data
| ) |  | const
| inline

Write the complete data.

Parameters

  fd | Output file descriptor.
  data | Data 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_io | Custom input object.
  write_header | Output header.
  write_io | Custom output object.

void gta::header::copy_data | ( | std::istream & | is,
|  | const header & | write_header,
|  | std::ostream & | os
| ) |  | const
| inline

Copy the complete data.

Parameters

  is | Input stream.
  write_header | Output header.
  os | Output stream.

void gta::header::copy_data | ( | FILE * | fi,
|  | const header & | write_header,
|  | FILE * | fo
| ) |  | const
| inline

Copy the complete data.

Parameters

  fi | Input C stream.
  write_header | Output header.
  fo | Output C stream.

void gta::header::copy_data | ( | int | fdi,
|  | const header & | write_header,
|  | int | fdo
| ) |  | const
| inline

Copy the complete data.

Parameters

  fdi | Input file descriptor.
  write_header | Output header.
  fdo | Output 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

  index | The linear index.
  indices | The array indices.

uintmax_t gta::header::indices_to_linear_index | ( | const uintmax_t * | indices | ) | const
| inline

Transform array indices to a linear index.

Parameters

  indices | The 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

  data | Data Buffer.
  indices | Indices 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

  data | Data Buffer.
  indices | Indices 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

  data | Data Buffer.
  index | Index 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

  data | Data Buffer.
  index | Index 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

  data | Data Buffer.
  index0 | Index of the element in the first dimension.
  index1 | Index 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

  data | Data Buffer.
  index0 | Index of the element in the first dimension.
  index1 | Index 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

  data | Data Buffer.
  index0 | Index of the element in the first dimension.
  index1 | Index of the element in the second dimension.
  index2 | Index 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

  data | Data Buffer.
  index0 | Index of the element in the first dimension.
  index1 | Index of the element in the second dimension.
  index2 | Index 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

  data | Data Buffer.
  index0 | Index of the element in the first dimension.
  index1 | Index of the element in the second dimension.
  index2 | Index of the element in the third dimension.
  index3 | Index 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

  data | Data Buffer.
  index0 | Index of the element in the first dimension.
  index1 | Index of the element in the second dimension.
  index2 | Index of the element in the third dimension.
  index3 | Index 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

  element | Element.
  i | Component 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

  element | Element.
  i | Component 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

  state | The input/output state.
  io | Custom input object.
  n | The number of elements to read.
  buf | The 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

  state | The input/output state.
  is | Input stream.
  n | The number of elements to read.
  buf | The 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

  state | The input/output state.
  f | Input stream.
  n | The number of elements to read.
  buf | The 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

  state | The input/output state.
  fd | Input file descriptor.
  n | The number of elements to read.
  buf | The 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

  state | The input/output state.
  io | Custom output object.
  n | The number of elements to write.
  buf | The 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

  state | The input/output state.
  os | Output stream.
  n | The number of elements to write.
  buf | The 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

  state | The input/output state.
  f | Output stream.
  n | The number of elements to write.
  buf | The 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

  state | The input/output state.
  fd | Output file descriptor.
  n | The number of elements to write.
  buf | The 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

  io | Custom input object.
  data_offset | Offset of the first data byte.
  lower_coordinates | Coordinates of the lower corner element of the block.
  higher_coordinates | Coordinates of the higher corner element of the block.
  block | Block 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

  is | Input stream.
  data_offset | Offset of the first data byte.
  lower_coordinates | Coordinates of the lower corner element of the block.
  higher_coordinates | Coordinates of the higher corner element of the block.
  block | Block 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

  f | Input C stream.
  data_offset | Offset of the first data byte.
  lower_coordinates | Coordinates of the lower corner element of the block.
  higher_coordinates | Coordinates of the higher corner element of the block.
  block | Block 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

  fd | Input file descriptor.
  data_offset | Offset of the first data byte.
  lower_coordinates | Coordinates of the lower corner element of the block.
  higher_coordinates | Coordinates of the higher corner element of the block.
  block | Block 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

  io | Custom output object.
  data_offset | Offset of the first data byte.
  lower_coordinates | Coordinates of the lower corner element of the block.
  higher_coordinates | Coordinates of the higher corner element of the block.
  block | Block 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

  os | Output stream.
  data_offset | Offset of the first data byte.
  lower_coordinates | Coordinates of the lower corner element of the block.
  higher_coordinates | Coordinates of the higher corner element of the block.
  block | Block 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

  f | Output C stream.
  data_offset | Offset of the first data byte.
  lower_coordinates | Coordinates of the lower corner element of the block.
  higher_coordinates | Coordinates of the higher corner element of the block.
  block | Block 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

  fd | Output file descriptor.
  data_offset | Offset of the first data byte.
  lower_coordinates | Coordinates of the lower corner element of the block.
  higher_coordinates | Coordinates of the higher corner element of the block.
  block | Block buffer.

This function modifies the file position indicator of the output.

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

- gta/gta.hpp