libwreport  3.6
internals.h
1 #ifndef WREPORT_BULLETIN_INTERNALS_H
2 #define WREPORT_BULLETIN_INTERNALS_H
3 
4 #include <wreport/varinfo.h>
5 #include <wreport/opcodes.h>
6 #include <wreport/bulletin/interpreter.h>
7 #include <vector>
8 #include <memory>
9 #include <cmath>
10 
11 namespace wreport {
12 struct Var;
13 struct Subset;
14 struct Bulletin;
15 
16 namespace bulletin {
17 
23 {
27  unsigned current_var = 0;
28 
29  UncompressedEncoder(const Bulletin& bulletin, unsigned subset_no);
30  virtual ~UncompressedEncoder();
31 
33  const Var& peek_var();
34 
36  const Var& get_var();
37 
39  const Var& get_var(unsigned pos) const;
40 
41  void define_bitmap(unsigned bitmap_size) override;
42 
43  void define_variable(Varinfo info) override;
44  unsigned define_delayed_replication_factor(Varinfo info) override;
45  unsigned define_associated_field_significance(Varinfo info) override;
46  unsigned define_bitmap_delayed_replication_factor(Varinfo info) override;
47 
57  virtual void encode_var(Varinfo info, const Var& var);
58 
66  virtual void encode_associated_field(const Var& var);
67 };
68 
70 {
73 
74  UncompressedDecoder(Bulletin& bulletin, unsigned subset_no);
76 };
77 
79 {
80  Bulletin& output_bulletin;
81 
82  CompressedDecoder(Bulletin& bulletin);
83  virtual ~CompressedDecoder();
84 };
85 
86 }
87 }
88 
89 #endif
void define_bitmap(unsigned bitmap_size) override
Request processing of a data present bitmap.
virtual void encode_var(Varinfo info, const Var &var)
Encode a variable.
Definition: internals.h:78
A physical variable.
Definition: var.h:23
unsigned current_var
Index of the next variable to be visited.
Definition: internals.h:27
virtual void encode_associated_field(const Var &var)
Encode an attribute for an associated field.
Storage for the decoded data of a BUFR or CREX message.
Definition: bulletin.h:29
Base Interpreter specialisation for message encoders that works on a subset at a time.
Definition: internals.h:22
const Subset & current_subset
Current subset (used to refer to past variables)
Definition: internals.h:25
Information about a variable.
Definition: varinfo.h:135
const Var & peek_var()
Get the next variable, without incrementing current_var.
unsigned define_delayed_replication_factor(Varinfo info) override
Request processing, according to info, of a data variabile that is significant for controlling the en...
unsigned define_associated_field_significance(Varinfo info) override
Request processing of an associated field significance variable (B31021).
unsigned define_bitmap_delayed_replication_factor(Varinfo info) override
Request processing of a delayed replication factor variable used to encode the size of a bitmap...
String functions.
Definition: benchmark.h:13
Interpreter for data descriptor sections.
Definition: interpreter.h:25
Implement fast access to information about WMO variables.
void define_variable(Varinfo info) override
Request processing, according to info, of a data variable.
Represent a BUFR/CREX data subset as a list of decoded variables.
Definition: subset.h:13
Definition: internals.h:69
Subset & output_subset
Subset where decoded variables go.
Definition: internals.h:72
const Var & get_var()
Get the next variable, incrementing current_var by 1.