wreport::bulletin::Interpreter Struct Reference

Interpreter for data descriptor sections. More...

`#include <interpreter.h>`

Inheritance diagram for wreport::bulletin::Interpreter:

## Public Member Functions

| Interpreter (const Tables &tables, const Opcodes &opcodes)
| Interpreter (const Interpreter &)=delete
Interpreter & | operator= (const Interpreter &)=delete
void | run ()
| Run the interpreter.
virtual void | b_variable (Varcode code)
| Notify of a B variable entry.
virtual void | c_modifier (Varcode code, Opcodes &next)
| Notify of a C modifier.
virtual void | r_replication (Varcode code, Varcode delayed_code, const Opcodes &ops)
| Handle a replicated section.
virtual void | r_bitmap (Varcode code, Varcode delayed_code, const Opcodes &ops)
| Handle a replicated section which defines a bitmap.
virtual void | run_r_repetition (unsigned cur, unsigned total)
| Executes a repetition of the opcodes on top of the stack.
virtual void | run_d_expansion (Varcode code)
| Executes the expansion of code, which has been put on top of the opcode stack.
virtual void | define_bitmap (unsigned bitmap_size)
| Request processing of a data present bitmap.
virtual void | define_variable (Varinfo info)
| Request processing, according to info, of a data variable.
virtual void | define_variable_with_associated_field (Varinfo info)
| Request processing, according to info, of a data variable.
virtual unsigned | define_delayed_replication_factor (Varinfo info)
| Request processing, according to info, of a data variabile that is significant for controlling the encoding process.
virtual unsigned | define_bitmap_delayed_replication_factor (Varinfo info)
| Request processing of a delayed replication factor variable used to encode the size of a bitmap.
virtual unsigned | define_associated_field_significance (Varinfo info)
| Request processing of an associated field significance variable (B31021).
virtual void | define_substituted_value (unsigned pos)
| Request processing of a substituted value corresponding to position pos in the list or previous variables.
virtual void | define_attribute (Varinfo info, unsigned pos)
| Request processing of an attribute encoded with info, related to the variable as position pos in the list of previous variables.
virtual void | define_raw_character_data (Varcode code)
| Request processing of C05yyy raw character data.
virtual void | define_c03_refval_override (Varcode code)
| Request processing of a new value for the reference value of the given B code.

## Static Public Member Functions

static void | print_c_modifier (FILE *out, Varcode code, Opcodes &nex)
| Print a description of this C modifier.

## Data Fields

const Tables & | tables
std::stack< Opcodes > | opcode_stack
Bitmaps | bitmaps
| Bitmap iteration.
AssociatedField | associated_field
| Current associated field state.
int | c_scale_change = 0
| Current value of scale change from C modifier.
int | c_width_change = 0
| Current value of width change from C modifier.
int | c_scale_ref_width_increase = 0
| Increase of scale, reference value and data width.
int | c_string_len_override = 0
| Current value of string length override from C08 modifiers (0 for no override).
std::map< wreport::Varcode, uint32_t > | c03_refval_overrides
| Current reference value overrides.
unsigned | c03_refval_override_bits = 0
| Set to the number of reference value override bits while reading the override values.

## Protected Member Functions

Varinfo | get_varinfo (Varcode code)
| Return a Varinfo for the given Varcode, applying all relevant C modifications that are currently active.

## Detailed Description

Interpreter for data descriptor sections.

By default, the interpreter goes through all the motions without doing anything. To provide actual functionality, subclass the interpreter and override the various virtual methods.

## Member Function Documentation

## b_variable()

virtual void wreport::bulletin::Interpreter::b_variable | ( | Varcode | code | ) |

virtual

Notify of a B variable entry.

Parameters

  code | The B variable code

Reimplemented in wreport::bufr::VerboseDataSectionDecoder, and wreport::bulletin::Printer.

## c_modifier()

virtual void wreport::bulletin::Interpreter::c_modifier | ( | Varcode | code,
|  | Opcodes & | next )

virtual

Notify of a C modifier.

Whenever the modifier is a supported one, this is followed by an invocation of one of the specific c_* methods.

Parameters

  code | The C modifier code

Reimplemented in wreport::bufr::VerboseDataSectionDecoder, wreport::bulletin::Printer, and wreport::bulletin::ScanFeatures.

## define_associated_field_significance()

virtual unsigned wreport::bulletin::Interpreter::define_associated_field_significance | ( | Varinfo | info | ) |

virtual

Request processing of an associated field significance variable (B31021).

Returns
  the associated field significance value

Reimplemented in wreport::bufr::DataSectionDecoder, wreport::bufr::VerboseDataSectionDecoder, wreport::bulletin::Printer, wreport::bulletin::ScanFeatures, and wreport::bulletin::UncompressedEncoder.

## define_attribute()

virtual void wreport::bulletin::Interpreter::define_attribute | ( | Varinfo | info,
|  | unsigned | pos )

virtual

Request processing of an attribute encoded with info, related to the variable as position pos in the list of previous variables.

Reimplemented in wreport::bufr::DataSectionDecoder, wreport::bufr::VerboseDataSectionDecoder, wreport::bulletin::DDSPrinter, and wreport::bulletin::DDSValidator.

## define_bitmap()

virtual void wreport::bulletin::Interpreter::define_bitmap | ( | unsigned | bitmap_size | ) |

virtual

Request processing of a data present bitmap.

Parameters

  code | The C modifier code that defines the bitmap
  rep_code | The R replicator that defines the bitmap
  delayed_code | The B delayed replicator that defines the bitmap length (it is 0 if the length is encoded in the YYY part of rep_code
  ops | The replicated opcodes that define the bitmap

Returns
  The bitmap that has been processed.

Reimplemented in wreport::bufr::DataSectionDecoder, wreport::bufr::VerboseDataSectionDecoder, wreport::bulletin::DDSPrinter, wreport::bulletin::Printer, wreport::bulletin::ScanFeatures, and wreport::bulletin::UncompressedEncoder.

## define_bitmap_delayed_replication_factor()

virtual unsigned wreport::bulletin::Interpreter::define_bitmap_delayed_replication_factor | ( | Varinfo | info | ) |

virtual

Request processing of a delayed replication factor variable used to encode the size of a bitmap.

Returns
  the repetition count

Reimplemented in wreport::bufr::DataSectionDecoder, wreport::bufr::VerboseDataSectionDecoder, wreport::bulletin::Printer, wreport::bulletin::ScanFeatures, and wreport::bulletin::UncompressedEncoder.

## define_c03_refval_override()

virtual void wreport::bulletin::Interpreter::define_c03_refval_override | ( | Varcode | code | ) |

virtual

Request processing of a new value for the reference value of the given B code.

Reimplemented in wreport::bufr::DataSectionDecoder, wreport::bufr::VerboseDataSectionDecoder, and wreport::bulletin::DDSValidator.

## define_delayed_replication_factor()

virtual unsigned wreport::bulletin::Interpreter::define_delayed_replication_factor | ( | Varinfo | info | ) |

virtual

Request processing, according to info, of a data variabile that is significant for controlling the encoding process.

This means that the variable has always the same value on all datasets (in case of compressed datasets), and that the interpreter needs to know its value.

Returns
  the value of the variable, or 0xffffffff if it is unset

Reimplemented in wreport::bufr::DataSectionDecoder, wreport::bufr::VerboseDataSectionDecoder, and wreport::bulletin::UncompressedEncoder.

## define_raw_character_data()

virtual void wreport::bulletin::Interpreter::define_raw_character_data | ( | Varcode | code | ) |

virtual

Request processing of C05yyy raw character data.

Reimplemented in wreport::bufr::DataSectionDecoder, wreport::bufr::VerboseDataSectionDecoder, wreport::bulletin::DDSPrinter, and wreport::bulletin::DDSValidator.

## define_substituted_value()

virtual void wreport::bulletin::Interpreter::define_substituted_value | ( | unsigned | pos | ) |

virtual

Request processing of a substituted value corresponding to position pos in the list or previous variables.

Reimplemented in wreport::bufr::DataSectionDecoder, wreport::bufr::VerboseDataSectionDecoder, wreport::bulletin::DDSPrinter, and wreport::bulletin::DDSValidator.

## define_variable()

virtual void wreport::bulletin::Interpreter::define_variable | ( | Varinfo | info | ) |

virtual

Request processing, according to info, of a data variable.

Reimplemented in wreport::bufr::DataSectionDecoder, wreport::bufr::VerboseDataSectionDecoder, wreport::bulletin::Printer, wreport::bulletin::ScanFeatures, and wreport::bulletin::UncompressedEncoder.

## define_variable_with_associated_field()

virtual void wreport::bulletin::Interpreter::define_variable_with_associated_field | ( | Varinfo | info | ) |

virtual

Request processing, according to info, of a data variable.

Reimplemented in wreport::bufr::DataSectionDecoder, wreport::bufr::VerboseDataSectionDecoder, wreport::bulletin::Printer, and wreport::bulletin::UncompressedEncoder.

## r_replication()

virtual void wreport::bulletin::Interpreter::r_replication | ( | Varcode | code,
|  | Varcode | delayed_code,
|  | const Opcodes & | ops )

virtual

Handle a replicated section.

Parameters

  code | The R replication code
  delayed_code | The delayed replication B code, or 0 if delayed replication is not used
  ops | The replicated operators

Reimplemented in wreport::bufr::VerboseDataSectionDecoder, wreport::bulletin::DDSPrinter, wreport::bulletin::Printer, and wreport::bulletin::ScanFeatures.

## run_d_expansion()

virtual void wreport::bulletin::Interpreter::run_d_expansion | ( | Varcode | code | ) |

virtual

Executes the expansion of code, which has been put on top of the opcode stack.

By default it just calls run(), but it can be overridden to execute operations before and after.

Parameters

  code | The D code that is being run

Reimplemented in wreport::bufr::VerboseDataSectionDecoder, wreport::bulletin::DDSPrinter, and wreport::bulletin::Printer.

## run_r_repetition()

virtual void wreport::bulletin::Interpreter::run_r_repetition | ( | unsigned | cur,
|  | unsigned | total )

virtual

Executes a repetition of the opcodes on top of the stack.

By default it just calls run(), but it can be overridden to execute operations before and after.

Parameters

  cur | The 0-based index of the current repetition
  total | The total number of repetitions

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

- interpreter.h