1 #ifndef DBALLE_CORE_DATA_H 2 #define DBALLE_CORE_DATA_H 4 #include <dballe/data.h> 32 Data& operator=(
const Data& rec) =
default;
33 Data& operator=(
Data&& rec) =
default;
48 void clear()
override;
52 void set_datetime(
const Datetime& dt)
override;
54 void set_coords(
const Coords& c)
override;
55 void set_latrange(
const LatRange& lr)
override;
56 void set_lonrange(
const LonRange& lr)
override;
57 void set_level(
const Level& lev)
override;
58 void set_trange(
const Trange& tr)
override;
60 void set_var_acquire(std::unique_ptr<wreport::Var>&& var)
override;
61 void set_station(
const Station& s)
override;
62 void set_dbstation(
const DBStation& s)
override;
64 void print(FILE* out)
const override;
81 Coords get_coords()
const override;
82 Ident get_ident()
const override;
83 Level get_level()
const override;
84 Trange get_trange()
const override;
85 Datetime get_datetime()
const override;
87 Station get_station()
const override;
121 void setf(
const char* key,
unsigned len,
const char* val);
bool operator==(const dballe::Data &rec) const override
Check if two records are the same.
void print(FILE *out) const override
Print the contents of this record to the given stream.
Station information.
Definition: types.h:793
Coordinates.
Definition: types.h:368
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:686
static const Data & downcast(const dballe::Data &data)
Return a reference to record downcasted as core::Record.
Collection of DBValue objects, indexed by wreport::Varcode.
Definition: values.h:191
Vertical level or layer.
Definition: types.h:624
A station identifier, that can be any string (including the empty string) or a missing value...
Definition: types.h:747
Range of datetimes.
Definition: types.h:294
Key/value store where keys are strings and values are wreport variables.
Definition: data.h:17
Range of latitudes.
Definition: types.h:467
Date and time.
Definition: types.h:164
void clear() override
Remove all contents from the record.
void validate()
Check the data fields for consistency, and fill in missing values:
Holds data for database I/O.
Definition: core/data.h:17
void set_from_test_string(const std::string &s)
Set the Data from a ", "-separated string of assignments.
void clear_ids() override
Unset all database IDs in station and values.
std::string to_string() const
Encode in a one-liner of comma-separated assignments.
Range of longitudes.
Definition: types.h:551
Structures used as input to database insert functions.
void clear_vars() override
Remove all Bxxyyy keys from the record, leaving the rest intact.
bool operator!=(const dballe::Data &rec) const override
Check if two records differ.
void set_from_string(const char *str)
Set a value according to an assignment encoded in a string.