libwreport 3.37
subset.h
1#ifndef WREPORT_SUBSET_H
2#define WREPORT_SUBSET_H
3
4#include <wreport/var.h>
5#include <vector>
6
7namespace wreport {
8
12class Subset : public std::vector<Var>
13{
14public:
16 const Tables* tables;
17
25 Subset(const Subset& subset) = default;
26 Subset(Subset&& subset)
27 : std::vector<Var>(move(subset)), tables(subset.tables)
28 {
29 }
30 ~Subset();
31 Subset& operator=(const Subset&) = default;
32 Subset& operator=(Subset&& s);
33
35 void store_variable(const Var& var);
36
38 void store_variable(Var&& var);
39
49 void store_variable(Varcode code, const Var& var);
50
59 void store_variable_i(Varcode code, int val);
60
69 void store_variable_d(Varcode code, double val);
70
79 void store_variable_c(Varcode code, const char* val);
80
83
86
99 int append_dpb(Varcode ccode, unsigned size, Varcode attr);
100
109 void append_fixed_dpb(Varcode ccode, int size);
110
112 void print(FILE* out) const;
113
125 unsigned diff(const Subset& s2) const;
126
127protected:
129 void append_c_with_dpb(Varcode ccode, int count, const char* bitmap);
130};
131
132}
133#endif
Represent a BUFR/CREX data subset as a list of decoded variables.
Definition: subset.h:13
void print(FILE *out) const
Dump the contents of this subset.
unsigned diff(const Subset &s2) const
Compute the differences between two wreport subsets.
int append_dpb(Varcode ccode, unsigned size, Varcode attr)
Compute and append a data present bitmap.
Subset(const Tables &tables)
Create a new BUFR/CREX subset.
const Tables * tables
Tables used for creating variables in this subset.
Definition: subset.h:16
void store_variable(Var &&var)
Store a decoded variable in the message, to be encoded later.
void append_fixed_dpb(Varcode ccode, int size)
Append a fixed-size data present bitmap with all zeros.
void store_variable_c(Varcode code, const char *val)
Store a new variable in the message, providing its value as a string.
void store_variable_i(Varcode code, int val)
Store a new variable in the message, providing its value as an int.
void store_variable(Varcode code, const Var &var)
Store a new variable in the message, copying it from an already existing variable.
void store_variable_undef(Varinfo info)
Store a new, undefined variable in the message.
void store_variable_undef(Varcode code)
Store a new, undefined variable in the message.
void append_c_with_dpb(Varcode ccode, int count, const char *bitmap)
Append a C operator with a count long bitmap.
void store_variable_d(Varcode code, double val)
Store a new variable in the message, providing its value as a double.
void store_variable(const Var &var)
Store a decoded variable in the message, to be encoded later.
A physical variable.
Definition: var.h:25
String functions.
Definition: benchmark.h:13
uint16_t Varcode
Holds the WMO variable code of a variable.
Definition: fwd.h:12
Collection of BUFR/CREX tables used to work on a bulletin.
Definition: tables.h:15
Information about a variable.
Definition: varinfo.h:139