1 #ifndef DBALLE_CORE_ENQ_H
2 #define DBALLE_CORE_ENQ_H
4 #include <dballe/fwd.h>
23 Enq(
const char* key,
unsigned len)
29 [[noreturn]]
void throw_notfound()
35 virtual const char* name()
const = 0;
38 virtual void set_bool(
bool val) = 0;
41 virtual void set_int(
int val) = 0;
44 virtual void set_dballe_int(
int val) = 0;
47 virtual void set_string(
const std::string& val)
53 virtual void set_ident(
const Ident& ident)
108 template<
typename Values>
109 bool search_b_values(
const Values& values)
111 if (key[0] !=
'B' || len != 6)
116 if (var && var->
isset())
123 if (key[0] !=
'B' || len != 6)
127 if (code != value.
code())
131 if (var && var->
isset())
136 template<
typename Values>
137 void search_alias_values(
const Values& values)
141 if (var && var->
isset())
148 if (code != value.
code())
151 if (var && var->
isset())
161 const char* name()
const override {
return "enqi"; }
163 void set_bool(
bool val)
override
169 void set_int(
int val)
override
175 void set_dballe_int(
int val)
override
177 if (val == MISSING_INT)
183 void set_lat(
int lat)
override
185 if (lat == MISSING_INT)
191 void set_lon(
int lon)
override
193 if (lon == MISSING_INT)
211 const char* name()
const override {
return "enqd"; }
213 void set_bool(
bool val)
override
219 void set_int(
int val)
override
225 void set_dballe_int(
int val)
override
227 if (val == MISSING_INT)
233 void set_lat(
int lat)
override
235 if (lat == MISSING_INT)
241 void set_lon(
int lon)
override
243 if (lon == MISSING_INT)
wreport::Varcode code() const
Return the varcode of the variable, or 0 if no variable has been set.
Class passed to key-value accessors to set values in an invoker-defined way.
Definition: core/enq.h:17
wreport::Varcode resolve_varcode(const std::string &name)
Resolve a variable name to a varcode proper, dealing with aliases and validation.
Station information.
Definition: types.h:793
const wreport::Var * maybe_var(wreport::Varcode code) const
Lookup a variable, returning nullptr if not found.
static double lon_from_int(int lon)
Convert a longitude from the internal integer representation.
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
A station identifier, that can be any string (including the empty string) or a missing value.
Definition: types.h:747
void set_var_value(const wreport::Var &var) override
Set the value using the value of the given variable.
Definition: core/enq.h:199
Definition: core/enq.h:156
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:686
Container for a wreport::Var pointer.
Definition: value.h:18
Vertical level or layer.
Definition: types.h:624
#define WR_STRING_TO_VAR(str)
Collection of Value objects, indexed by wreport::Varcode.
Definition: values.h:176
Date and time.
Definition: types.h:164
void set_var_value(const wreport::Var &var) override
Set the value using the value of the given variable.
Definition: core/enq.h:249
Definition: core/enq.h:206
virtual void set_var_value(const wreport::Var &var)=0
Set the value using the value of the given variable.
Coordinates.
Definition: types.h:368
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
static double lat_from_int(int lat)
Convert a latitude from the internal integer representation.