IODA Bundle
odc Namespace Reference

Namespaces

 api
 
 codec
 
 core
 
 sql
 
 tool
 
 utility
 

Classes

type  odc_reader
 
type  odc_frame
 
type  odc_decoder
 
type  odc_encoder
 
interface  failure_handler_t
 
interface  strlen
 
interface  c_odc_version
 
interface  c_odc_vcs_version
 
interface  odc_initialise_api
 
interface  odc_integer_behaviour
 
interface  c_odc_set_failure_handler
 
interface  odc_halt_on_failure
 
interface  c_odc_column_type_name
 
interface  odc_column_type_count
 
interface  c_odc_error_string
 
interface  odc_missing_integer
 
interface  odc_missing_double
 
interface  odc_set_missing_integer
 
interface  odc_set_missing_double
 
interface  odc_open_path
 
interface  odc_close
 
interface  odc_new_frame
 
interface  odc_free_frame
 
interface  odc_next_frame
 
interface  odc_next_frame_aggregated
 
interface  odc_copy_frame
 
interface  odc_frame_row_count
 
interface  odc_frame_column_count
 
interface  odc_frame_column_attributes
 
interface  odc_frame_bitfield_attributes
 
interface  odc_new_decoder
 
interface  odc_free_decoder
 
interface  odc_decoder_defaults_from_frame
 
interface  odc_decoder_set_column_major
 
interface  odc_decoder_set_row_count
 
interface  odc_decoder_row_count
 
interface  odc_decoder_set_data_array
 
interface  odc_decoder_data_array
 
interface  odc_decoder_add_column
 
interface  odc_decoder_column_count
 
interface  odc_decoder_column_set_data_size
 
interface  odc_decoder_column_set_data_array
 
interface  odc_decoder_column_data_array
 
interface  odc_decode
 
interface  odc_decode_threaded
 
interface  odc_new_encoder
 
interface  odc_free_encoder
 
interface  odc_encoder_set_row_count
 
interface  odc_encoder_set_rows_per_frame
 
interface  odc_encoder_set_data_array
 
interface  odc_encoder_add_column
 
interface  odc_encoder_column_set_data_size
 
interface  odc_encoder_column_set_data_array
 
interface  odc_encoder_column_add_bitfield
 
interface  odc_encode_to_stream
 
class  Block
 
class  Comparator
 
class  ConstantSetter
 
class  TextReader
 
class  TextReaderIterator
 
class  DataHandleFactory
 
class  FileHandleFactory
 
class  HttpHandle
 
class  HttpHandleFactory
 
class  PartFileHandleFactory
 
class  DispatchingWriter
 
class  Indexer
 
class  IteratorProxy
 
class  Row_
 
class  LibOdc
 
class  MDI
 
class  MDSetter
 
class  MDUpdatingIterator
 
class  ODAHandle
 
class  ODAUpdatingIterator
 
class  ODBAPISettings
 
class  ODBAPIVersion
 
class  ODBTarget
 
class  Partition
 
class  Partitioner
 
class  Partitions
 
class  Reader
 
class  ReaderIterator
 
class  RowsCounter
 
class  Select
 
class  SelectIterator
 
class  SharedIterator
 Represents a smart iterator. More...
 
class  Writer
 
class  StringTool
 
struct  TemplateParameter
 
class  TemplateParameters
 
class  WriterBufferingIterator
 
class  WriterDispatchingIterator
 

Typedefs

typedef unsigned long long ullong
 
typedef std::vector< std::pair< eckit::Offset, eckit::Length > > BlockOffsets
 
typedef std::vector< PartitionPartitionsBase
 
typedef std::map< std::string, std::vector< std::string > > RequestDict
 
typedef WriterBufferingIterator DefaultWritingIterator
 

Functions

character(:) function, allocatable, target fortranise_cstr (cstr)
 
subroutine failure_handler_wrapper (unused_context, error)
 
integer function, public odc_set_failure_handler (handler, context)
 
integer function, public odc_version (version_str)
 
integer function, public odc_vcs_version (git_sha1)
 
integer function, public odc_column_type_name (type, type_name)
 
character(:) function, allocatable, target, public odc_error_string (err)
 
integer function reader_open_path (reader, path)
 
integer function reader_close (reader)
 
integer function frame_initialise (frame, reader)
 
integer function frame_free (frame)
 
integer function frame_copy (frame, new_frame)
 
integer function frame_next (frame, aggregated, maximum_rows)
 
integer function frame_row_count (frame, nrows)
 
integer function frame_column_count (frame, ncols)
 
integer function frame_column_attributes (frame, col, name, type, element_size, element_size_doubles, bitfield_count)
 
integer function frame_bitfield_attributes (frame, col, field, name, offset, size)
 
integer function decoder_initialise (decoder, column_major)
 
integer function decoder_free (decoder)
 
integer function decoder_defaults_from_frame (decoder, frame)
 
integer function decoder_set_row_count (decoder, count)
 
integer function decoder_row_count (decoder, count)
 
integer function decoder_set_data_array (decoder, data, column_major)
 
integer function decoder_data_array (decoder, data, column_major)
 
integer function decoder_add_column (decoder, name)
 
integer function decoder_column_count (decoder, count)
 
integer function decoder_column_set_data_size (decoder, col, element_size)
 
integer function decoder_column_set_data_array (decoder, col, element_size, stride, data)
 
integer function decoder_column_data_array (decoder, col, element_size, element_size_doubles, stride, data)
 
integer function decoder_decode (decoder, frame, rows_decoded, nthreads)
 
integer function encoder_initialise (encoder)
 
integer function encoder_free (encoder)
 
integer function encoder_set_row_count (encoder, row_count)
 
integer function encoder_set_rows_per_frame (encoder, rows_per_frame)
 
integer function encoder_set_data_array (encoder, data, column_major)
 
integer function encoder_add_column (encoder, name, type)
 
integer function encoder_column_set_data_size (encoder, col, element_size, element_size_doubles)
 
integer function encoder_column_set_data_array (encoder, col, element_size, element_size_doubles, stride, data)
 
integer function encoder_column_add_bitfield (encoder, col, name, nbits)
 
integer(c_long) function write_fn (context, buffer, length)
 
integer function encoder_encode (encoder, outunit, bytes_written)
 
ostream & operator<< (ostream &o, const Block &b)
 
std::ostream & operator<< (std::ostream &, const Block &)
 
const char * gitsha1 ()
 
std::ostream & operator<< (std::ostream &o, const Partition &p)
 
ullong writeBlock (DataHandle &in, const Block &block, Writer<>::iterator &out)
 
std::ostream & operator<< (std::ostream &o, const Partitions &p)
 
RequestDict unquoteRequestValues (const RequestDict &request)
 
void checkKeywordsHaveValues (const RequestDict &request, const std::vector< std::string > &keywords)
 
ostream & operator<< (std::ostream &s, const std::vector< std::string > &st)
 

Variables

integer(c_int), parameter, public odc_ignore = 0
 
integer(c_int), parameter, public odc_integer = 1
 
integer(c_int), parameter, public odc_real = 2
 
integer(c_int), parameter, public odc_string = 3
 
integer(c_int), parameter, public odc_bitfield = 4
 
integer(c_int), parameter, public odc_double = 5
 
integer, parameter, public odc_success = 0
 
integer, parameter, public odc_iteration_complete = 1
 
integer, parameter, public odc_error_general_exception = 2
 
integer, parameter, public odc_error_unknown_exception = 3
 
integer, parameter dp = selected_real_kind(15, 307)
 
integer, parameter double_size = 8
 
integer(c_long), save failure_handler_context
 
procedure(failure_handler_t), pointer, save failure_handler_fn
 
const double maxAbsoluteError = 1e-9
 
const double maxRelativeError = 1e-9
 

Detailed Description

Author
Simon Smart
Date
March 2019
Author
Simon Smart
Date
January 2019
Author
Piotr Kuchta, ECMWF, Oct 2015
Piotr Kuchta
Simon Smart
Date
January 2019
Note
We have some strange behaviour in here. In particular, we support BOTH decoding and encoding integers from a representation as doubles, and also as integers. This is a little bit strange, and reflects the history of these being used in the IFS and ODB1 where everything was a double.

n.b. The decoded size is int64_t, even though the codec only goes up to int32, as we want to support bigger numbers in the future.

Author
Simon Smart
Date
Dec 2018
Author
Piotr Kuchta, May 2015
Piotr Kuchta, October 2016
Piotr Kuchta, August 2015
Piotr Kuchta, ECMWF, November 2015
Simon Smart
Date
June 2017
Author
Anne Fouilloux

This file will be updated autmatically by the make.sms script

Author
Piotr Kuchta, ECMWF, January 2016
Simon Smart
Date
Aug 2018
Author
Piotr Kuchta
Simon Smart
Date
Feb 2009
Author
Piotr Kuchta
Date
July 2010
Author
Simon Smart
Date
January 2019
Author
Piotr Kuchta
Simon Smart
Date
Jan 2009
Aug 2018
Author
Simon Smart Aug 2018
Simon Smart
Date
Aug 2018
Note
This output is designed to generalise and standardise the output mechanism for the odc::Select class. Prior to this, the class had two problems:

i) It invasively used the internals of the SQLSelect and TableIterators, accessing their internal data buffers, and the results objects directly. This is nasty and results in significant duplicate code.

ii) As a result of the original IFS origins of this code, integers are returned as DOUBLES. this is reasonable, but a bit odd, and it is worth having in code the support to output integers as integers for future/other use - without having to reimplement and duplicate everything.

This output mechanism allows output to be made to a specified buffer (which may be changed on a per-step basis) with a semantically correct behaviour depending on the column type.

This has been put in odc, not in eckit, on the understanding that the handling of integers as doubles is esoteric and should probably not be replicated anywhere else.

Author
Piotr Kuchta
Simon Smart ECMWF Oct 2010

Typedef Documentation

◆ BlockOffsets

typedef std::vector<std::pair<eckit::Offset,eckit::Length> > odc::BlockOffsets

Definition at line 22 of file Indexer.h.

◆ DefaultWritingIterator

Definition at line 27 of file Writer.h.

◆ PartitionsBase

typedef std::vector<Partition> odc::PartitionsBase

Definition at line 25 of file Partitions.h.

◆ RequestDict

typedef std::map<std::string, std::vector<std::string> > odc::RequestDict

Definition at line 27 of file RequestUtils.h.

◆ ullong

typedef unsigned long long odc::ullong

Definition at line 27 of file Block.h.

Function Documentation

◆ checkKeywordsHaveValues()

void odc::checkKeywordsHaveValues ( const RequestDict request,
const std::vector< std::string > &  keywords 
)

Definition at line 38 of file RequestUtils.cc.

Here is the caller graph for this function:

◆ decoder_add_column()

integer function odc::decoder_add_column ( class(odc_decoder), intent(inout)  decoder,
character(*), intent(in)  name 
)
private

Definition at line 840 of file odc.f90.

◆ decoder_column_count()

integer function odc::decoder_column_count ( class(odc_decoder), intent(in)  decoder,
integer, intent(out)  count 
)
private

Definition at line 850 of file odc.f90.

Here is the call graph for this function:

◆ decoder_column_data_array()

integer function odc::decoder_column_data_array ( class(odc_decoder), intent(in)  decoder,
integer, intent(in)  col,
integer, intent(out), optional  element_size,
integer, intent(out), optional  element_size_doubles,
integer, intent(out), optional  stride,
type(c_ptr), intent(out), optional  data 
)
private

Definition at line 888 of file odc.f90.

◆ decoder_column_set_data_array()

integer function odc::decoder_column_set_data_array ( class(odc_decoder), intent(inout)  decoder,
integer, intent(in)  col,
integer, intent(in), optional  element_size,
integer, intent(in), optional  stride,
type(c_ptr), intent(in), optional  data 
)
private

Definition at line 869 of file odc.f90.

◆ decoder_column_set_data_size()

integer function odc::decoder_column_set_data_size ( class(odc_decoder), intent(inout)  decoder,
integer, intent(in)  col,
integer(c_int), intent(in)  element_size 
)
private

Definition at line 859 of file odc.f90.

◆ decoder_data_array()

integer function odc::decoder_data_array ( class(odc_decoder), intent(in)  decoder,
real(dp), dimension(:,:), intent(inout), optional, pointer  data,
logical, intent(out), optional  column_major 
)
private

Definition at line 815 of file odc.f90.

◆ decoder_decode()

integer function odc::decoder_decode ( class(odc_decoder), intent(inout)  decoder,
class(odc_frame), intent(inout)  frame,
integer(c_long), intent(out)  rows_decoded,
integer, intent(in), optional  nthreads 
)
private

Definition at line 912 of file odc.f90.

◆ decoder_defaults_from_frame()

integer function odc::decoder_defaults_from_frame ( class(odc_decoder), intent(inout)  decoder,
type(odc_frame), intent(in)  frame 
)
private

Definition at line 776 of file odc.f90.

◆ decoder_free()

integer function odc::decoder_free ( class(odc_decoder), intent(inout)  decoder)
private

Definition at line 770 of file odc.f90.

◆ decoder_initialise()

integer function odc::decoder_initialise ( class(odc_decoder), intent(inout)  decoder,
logical, intent(in), optional  column_major 
)
private

Definition at line 758 of file odc.f90.

◆ decoder_row_count()

integer function odc::decoder_row_count ( class(odc_decoder), intent(in)  decoder,
integer(c_long), intent(out)  count 
)
private

Definition at line 790 of file odc.f90.

Here is the call graph for this function:

◆ decoder_set_data_array()

integer function odc::decoder_set_data_array ( class(odc_decoder), intent(inout)  decoder,
real(dp), dimension(:,:), intent(inout), target  data,
logical, intent(in), optional  column_major 
)
private

Definition at line 797 of file odc.f90.

◆ decoder_set_row_count()

integer function odc::decoder_set_row_count ( class(odc_decoder), intent(inout)  decoder,
integer(c_long), intent(in)  count 
)
private

Definition at line 783 of file odc.f90.

Here is the call graph for this function:

◆ encoder_add_column()

integer function odc::encoder_add_column ( class(odc_encoder), intent(inout)  encoder,
character(*), intent(in)  name,
integer, intent(in)  type 
)
private

Definition at line 976 of file odc.f90.

◆ encoder_column_add_bitfield()

integer function odc::encoder_column_add_bitfield ( class(odc_encoder), intent(inout)  encoder,
integer, intent(in)  col,
character(*), intent(in)  name,
integer, intent(in)  nbits 
)
private

Definition at line 1023 of file odc.f90.

◆ encoder_column_set_data_array()

integer function odc::encoder_column_set_data_array ( class(odc_encoder), intent(inout)  encoder,
integer, intent(in)  col,
integer, intent(in), optional  element_size,
integer, intent(in), optional  element_size_doubles,
integer, intent(in), optional  stride,
type(c_ptr), intent(in), optional  data 
)
private

Definition at line 1002 of file odc.f90.

◆ encoder_column_set_data_size()

integer function odc::encoder_column_set_data_size ( class(odc_encoder), intent(inout)  encoder,
integer, intent(in)  col,
integer, intent(in), optional  element_size,
integer, intent(in), optional  element_size_doubles 
)
private

Definition at line 986 of file odc.f90.

◆ encoder_encode()

integer function odc::encoder_encode ( class(odc_encoder), intent(inout)  encoder,
integer, intent(in), target  outunit,
integer(c_long), intent(out)  bytes_written 
)
private

Definition at line 1051 of file odc.f90.

◆ encoder_free()

integer function odc::encoder_free ( class(odc_encoder), intent(inout)  encoder)
private

Definition at line 934 of file odc.f90.

◆ encoder_initialise()

integer function odc::encoder_initialise ( class(odc_encoder), intent(inout)  encoder)
private

Definition at line 928 of file odc.f90.

◆ encoder_set_data_array()

integer function odc::encoder_set_data_array ( class(odc_encoder), intent(inout)  encoder,
real(dp), dimension(:,:), intent(in), target  data,
logical, intent(in), optional  column_major 
)
private

Definition at line 954 of file odc.f90.

◆ encoder_set_row_count()

integer function odc::encoder_set_row_count ( class(odc_encoder), intent(inout)  encoder,
integer(c_long), intent(in)  row_count 
)
private

Definition at line 940 of file odc.f90.

◆ encoder_set_rows_per_frame()

integer function odc::encoder_set_rows_per_frame ( class(odc_encoder), intent(inout)  encoder,
integer(c_long), intent(in)  rows_per_frame 
)
private

Definition at line 947 of file odc.f90.

◆ failure_handler_wrapper()

subroutine odc::failure_handler_wrapper ( type(c_ptr), intent(in), value  unused_context,
integer(c_long), intent(in), value  error 
)
private

Definition at line 579 of file odc.f90.

Here is the caller graph for this function:

◆ fortranise_cstr()

character(:) function, allocatable, target odc::fortranise_cstr ( type(c_ptr), intent(in)  cstr)
private

Definition at line 567 of file odc.f90.

Here is the caller graph for this function:

◆ frame_bitfield_attributes()

integer function odc::frame_bitfield_attributes ( class(odc_frame), intent(in)  frame,
integer, intent(in)  col,
integer, intent(in)  field,
character(:), intent(out), optional, allocatable  name,
integer, intent(out), optional  offset,
integer, intent(out), optional  size 
)
private

Definition at line 731 of file odc.f90.

Here is the call graph for this function:

◆ frame_column_attributes()

integer function odc::frame_column_attributes ( class(odc_frame), intent(in)  frame,
integer, intent(in)  col,
character(:), intent(out), optional, allocatable  name,
integer, intent(out), optional  type,
integer, intent(out), optional  element_size,
integer, intent(out), optional  element_size_doubles,
integer, intent(out), optional  bitfield_count 
)
private

Definition at line 701 of file odc.f90.

Here is the call graph for this function:

◆ frame_column_count()

integer function odc::frame_column_count ( class(odc_frame), intent(in)  frame,
integer(c_int), intent(out)  ncols 
)
private

Definition at line 694 of file odc.f90.

◆ frame_copy()

integer function odc::frame_copy ( class(odc_frame), intent(inout)  frame,
class(odc_frame), intent(inout)  new_frame 
)
private

Definition at line 658 of file odc.f90.

◆ frame_free()

integer function odc::frame_free ( class(odc_frame), intent(inout)  frame)
private

Definition at line 652 of file odc.f90.

◆ frame_initialise()

integer function odc::frame_initialise ( class(odc_frame), intent(inout)  frame,
type(odc_reader), intent(inout)  reader 
)
private

Definition at line 645 of file odc.f90.

◆ frame_next()

integer function odc::frame_next ( class(odc_frame), intent(inout)  frame,
logical, intent(in), optional  aggregated,
integer(c_long), intent(in), optional  maximum_rows 
)
private

Definition at line 665 of file odc.f90.

◆ frame_row_count()

integer function odc::frame_row_count ( class(odc_frame), intent(in)  frame,
integer(c_long), intent(out)  nrows 
)
private

Definition at line 687 of file odc.f90.

◆ gitsha1()

const char* odc::gitsha1 ( )

Definition at line 22 of file ODBAPIVersion.cc.

◆ odc_column_type_name()

integer function, public odc::odc_column_type_name ( integer(c_int), intent(in)  type,
character(:), intent(out), allocatable  type_name 
)

Definition at line 610 of file odc.f90.

Here is the call graph for this function:

◆ odc_error_string()

character(:) function, allocatable, target, public odc::odc_error_string ( integer, intent(in)  err)

Definition at line 619 of file odc.f90.

Here is the call graph for this function:

◆ odc_set_failure_handler()

integer function, public odc::odc_set_failure_handler ( procedure(failure_handler_t), pointer  handler,
integer(c_long)  context 
)

Definition at line 585 of file odc.f90.

Here is the call graph for this function:

◆ odc_vcs_version()

integer function, public odc::odc_vcs_version ( character(:), intent(out), allocatable  git_sha1)

Definition at line 602 of file odc.f90.

Here is the call graph for this function:

◆ odc_version()

integer function, public odc::odc_version ( character(:), intent(out), allocatable  version_str)

Definition at line 594 of file odc.f90.

Here is the call graph for this function:

◆ operator<<() [1/5]

ostream& odc::operator<< ( ostream &  o,
const Block b 
)

Definition at line 34 of file Block.cc.

◆ operator<<() [2/5]

std::ostream& odc::operator<< ( std::ostream &  ,
const Block  
)

◆ operator<<() [3/5]

std::ostream& odc::operator<< ( std::ostream &  o,
const Partition p 
)

Definition at line 33 of file Partition.cc.

◆ operator<<() [4/5]

std::ostream& odc::operator<< ( std::ostream &  o,
const Partitions p 
)

Definition at line 29 of file Partitions.cc.

◆ operator<<() [5/5]

std::ostream & odc::operator<< ( std::ostream &  s,
const std::vector< std::string > &  st 
)

Definition at line 153 of file StringTool.cc.

◆ reader_close()

integer function odc::reader_close ( class(odc_reader), intent(inout)  reader)
private

Definition at line 636 of file odc.f90.

◆ reader_open_path()

integer function odc::reader_open_path ( class(odc_reader), intent(inout)  reader,
character(*), intent(in)  path 
)
private

Definition at line 627 of file odc.f90.

◆ unquoteRequestValues()

RequestDict odc::unquoteRequestValues ( const RequestDict request)

Definition at line 26 of file RequestUtils.cc.

Here is the caller graph for this function:

◆ write_fn()

integer(c_long) function odc::write_fn ( type(c_ptr), intent(in), value  context,
type(c_ptr), intent(in), value  buffer,
integer(c_long), intent(in), value  length 
)
private

Definition at line 1037 of file odc.f90.

Here is the caller graph for this function:

◆ writeBlock()

ullong odc::writeBlock ( DataHandle &  in,
const Block block,
Writer<>::iterator &  out 
)

Definition at line 151 of file Partition.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ double_size

integer, parameter odc::double_size = 8
private

Definition at line 24 of file odc.f90.

◆ dp

integer, parameter odc::dp = selected_real_kind(15, 307)
private

Definition at line 23 of file odc.f90.

◆ failure_handler_context

integer(c_long), save odc::failure_handler_context
private

Definition at line 110 of file odc.f90.

◆ failure_handler_fn

procedure(failure_handler_t), pointer, save odc::failure_handler_fn
private

Definition at line 111 of file odc.f90.

◆ maxAbsoluteError

const double odc::maxAbsoluteError = 1e-9

Definition at line 33 of file Comparator.h.

◆ maxRelativeError

const double odc::maxRelativeError = 1e-9

Definition at line 34 of file Comparator.h.

◆ odc_bitfield

integer(c_int), parameter, public odc::odc_bitfield = 4

Definition at line 11 of file odc.f90.

◆ odc_double

integer(c_int), parameter, public odc::odc_double = 5

Definition at line 12 of file odc.f90.

◆ odc_error_general_exception

integer, parameter, public odc::odc_error_general_exception = 2

Definition at line 18 of file odc.f90.

◆ odc_error_unknown_exception

integer, parameter, public odc::odc_error_unknown_exception = 3

Definition at line 19 of file odc.f90.

◆ odc_ignore

integer(c_int), parameter, public odc::odc_ignore = 0

Definition at line 7 of file odc.f90.

◆ odc_integer

integer(c_int), parameter, public odc::odc_integer = 1

Definition at line 8 of file odc.f90.

◆ odc_iteration_complete

integer, parameter, public odc::odc_iteration_complete = 1

Definition at line 17 of file odc.f90.

◆ odc_real

integer(c_int), parameter, public odc::odc_real = 2

Definition at line 9 of file odc.f90.

◆ odc_string

integer(c_int), parameter, public odc::odc_string = 3

Definition at line 10 of file odc.f90.

◆ odc_success

integer, parameter, public odc::odc_success = 0

Definition at line 16 of file odc.f90.