subset.h
#ifndef WREPORT_SUBSET_H
#define WREPORT_SUBSET_H
#include <wreport/var.h>
#include <vector>
namespace wreport {
class Subset : public std::vector<Var>
{
public:
const Tables* tables;
Subset(const Tables& tables);
Subset(const Subset& subset) = default;
Subset(Subset&& subset)
: std::vector<Var>(move(subset)), tables(subset.tables)
{
}
~Subset();
Subset& operator=(const Subset&) = default;
Subset& operator=(Subset&& s);
void store_variable(const Var& var);
void store_variable(Var&& var);
void store_variable(Varcode code, const Var& var);
void store_variable_i(Varcode code, int val);
void store_variable_d(Varcode code, double val);
void store_variable_c(Varcode code, const char* val);
void store_variable_undef(Varcode code);
void store_variable_undef(Varinfo info);
int append_dpb(Varcode ccode, unsigned size, Varcode attr);
void append_fixed_dpb(Varcode ccode, int size);
void print(FILE* out) const;
unsigned diff(const Subset& s2) const;
protected:
void append_c_with_dpb(Varcode ccode, int count, const char* bitmap);
};
}
#endif
wreport::Subset
Represent a BUFR/CREX data subset as a list of decoded variables.
Definition subset.h:13
wreport::Subset::print
void print(FILE *out) const
Dump the contents of this subset.
wreport::Subset::diff
unsigned diff(const Subset &s2) const
Compute the differences between two wreport subsets.
wreport::Subset::append_dpb
int append_dpb(Varcode ccode, unsigned size, Varcode attr)
Compute and append a data present bitmap.
wreport::Subset::Subset
Subset(const Tables &tables)
Create a new BUFR/CREX subset.
wreport::Subset::tables
const Tables * tables
Tables used for creating variables in this subset.
Definition subset.h:16
wreport::Subset::store_variable
void store_variable(Var &&var)
Store a decoded variable in the message, to be encoded later.
wreport::Subset::append_fixed_dpb
void append_fixed_dpb(Varcode ccode, int size)
Append a fixed-size data present bitmap with all zeros.
wreport::Subset::store_variable_c
void store_variable_c(Varcode code, const char *val)
Store a new variable in the message, providing its value as a string.
wreport::Subset::store_variable_i
void store_variable_i(Varcode code, int val)
Store a new variable in the message, providing its value as an int.
wreport::Subset::store_variable
void store_variable(Varcode code, const Var &var)
Store a new variable in the message, copying it from an already existing variable.
wreport::Subset::store_variable_undef
void store_variable_undef(Varinfo info)
Store a new, undefined variable in the message.
wreport::Subset::store_variable_undef
void store_variable_undef(Varcode code)
Store a new, undefined variable in the message.
wreport::Subset::append_c_with_dpb
void append_c_with_dpb(Varcode ccode, int count, const char *bitmap)
Append a C operator with a count long bitmap.
wreport::Subset::store_variable_d
void store_variable_d(Varcode code, double val)
Store a new variable in the message, providing its value as a double.
wreport::Subset::store_variable
void store_variable(const Var &var)
Store a decoded variable in the message, to be encoded later.
wreport::Var
A physical variable.
Definition var.h:25
wreport
String functions.
Definition benchmark.h:13
wreport::Varinfo
const _Varinfo * Varinfo
Varinfo reference.
Definition fwd.h:11
wreport::Varcode
uint16_t Varcode
Holds the WMO variable code of a variable.
Definition fwd.h:12
wreport::Tables
Collection of BUFR/CREX tables used to work on a bulletin.
Definition tables.h:15