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;
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);
Key/value store where keys are strings and values are wreport variables.
Definition: data.h:18
A station identifier, that can be any string (including the empty string) or a missing value.
Definition: types.h:748
Holds data for database I/O.
Definition: core/data.h:18
bool operator!=(const dballe::Data &rec) const override
Check if two records differ.
std::string to_string() const
Encode in a one-liner of comma-separated assignments.
void validate()
Check the data fields for consistency, and fill in missing values:
void clear() override
Remove all contents from the record.
static const Data & downcast(const dballe::Data &data)
Return a reference to record downcasted as core::Record.
void set_from_test_string(const std::string &s)
Set the Data from a ", "-separated string of assignments.
bool operator==(const dballe::Data &rec) const override
Check if two records are the same.
void clear_ids() override
Unset all database IDs in station and values.
static Data & downcast(dballe::Data &data)
Return a reference to record downcasted as core::Record.
void clear_vars() override
Remove all Bxxyyy keys from the record, leaving the rest intact.
void set_from_string(const char *str)
Set a value according to an assignment encoded in a string.
void print(FILE *out) const override
Print the contents of this record to the given stream.
Coordinates.
Definition: types.h:369
Collection of DBValue objects, indexed by wreport::Varcode.
Definition: values.h:192
Range of datetimes.
Definition: types.h:295
Date and time.
Definition: types.h:165
Range of latitudes.
Definition: types.h:468
Vertical level or layer.
Definition: types.h:625
Range of longitudes.
Definition: types.h:552
Station information.
Definition: types.h:794
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:687
Structures used as input to database insert functions.