|
libdballe
8.6
|
Holds data for database I/O. More...
#include <data.h>
Public Member Functions | |
| Data (const Data &rec)=default | |
| Data (Data &&rec)=default | |
| Data & | operator= (const Data &rec)=default |
| Data & | operator= (Data &&rec)=default |
| bool | operator== (const dballe::Data &rec) const override |
| Check if two records are the same. | |
| bool | operator!= (const dballe::Data &rec) const override |
| Check if two records differ. | |
| void | validate () |
| Check the data fields for consistency, and fill in missing values: More... | |
| void | clear () override |
| Remove all contents from the record. | |
| void | clear_vars () override |
| Remove all Bxxyyy keys from the record, leaving the rest intact. | |
| void | clear_ids () override |
| Unset all database IDs in station and values. | |
| void | print (FILE *out) const override |
| Print the contents of this record to the given stream. | |
| void | set_from_string (const char *str) |
| Set a value according to an assignment encoded in a string. More... | |
| void | set_from_test_string (const std::string &s) |
| Set the Data from a ", "-separated string of assignments. More... | |
| std::string | to_string () const |
| Encode in a one-liner of comma-separated assignments. | |
Static Public Member Functions | |
| static const Data & | downcast (const dballe::Data &data) |
| Return a reference to record downcasted as core::Record. More... | |
| static Data & | downcast (dballe::Data &data) |
| Return a reference to record downcasted as core::Record. More... | |
Static Public Member Functions inherited from dballe::Data | |
| static std::unique_ptr< Data > | create () |
| Create a new Record. | |
Public Attributes | |
| DBStation | station |
| Datetime | datetime |
| Level | level |
| Trange | trange |
| DBValues | values |
Protected Member Functions | |
| void | setf (const char *key, unsigned len, const char *val) |
Holds data for database I/O.
Data is a container for one observation of meteorological values, that includes station informations, physical location of the observation in time and space, and all the observed variables.
|
static |
Return a reference to record downcasted as core::Record.
Throws an exception if record is not a core::Record.
Referenced by dballe::tests::ActualCursor::data_var_matches().
|
static |
Return a reference to record downcasted as core::Record.
Throws an exception if record is not a core::Record.
| void dballe::core::Data::set_from_string | ( | const char * | str | ) |
Set a value according to an assignment encoded in a string.
String can use keywords, aliases and varcodes. Examples: ana_id=3, name=Bologna, B12012=32.4
In case of numeric parameter, a hyphen ("-") means MISSING_INT (e.g., leveltype2=-).
| str | The string containing the assignment. |
| void dballe::core::Data::set_from_test_string | ( | const std::string & | s | ) |
Set the Data from a ", "-separated string of assignments.
The implementation is not efficient and the method is not safe for any input, since ", " could appear in a station identifier. It is however useful to quickly create test queries for unit testing.
| void dballe::core::Data::validate | ( | ) |
Check the data fields for consistency, and fill in missing values:
1.8.16