1#ifndef DBALLE_MESSAGE_H
2#define DBALLE_MESSAGE_H
28class Message :
public std::enable_shared_from_this<Message>
49 virtual std::shared_ptr<Message>
clone()
const = 0;
126 void set(
const char* shortcut, std::unique_ptr<wreport::Var> var);
178 virtual void print(FILE* out)
const = 0;
194 static std::shared_ptr<Message>
create(MessageType type);
213const char* format_message_type(MessageType type);
217std::ostream& operator<<(std::ostream&,
const dballe::MessageType&);
A station identifier, that can be any string (including the empty string) or a missing value.
Definition: types.h:748
A bulletin that has been decoded and physically interpreted.
Definition: message.h:29
void set(const Level &lev, const Trange &tr, const wreport::Var &var)
Add or replace a value.
virtual void print(FILE *out) const =0
Print all the contents of this message to an output stream.
virtual std::shared_ptr< Message > clone() const =0
Return a copy of this message.
virtual unsigned diff(const Message &msg) const =0
Compute the differences between two Messages.
void set(const Level &lev, const Trange &tr, std::unique_ptr< wreport::Var > var)
Add or replace a value, taking ownership of the source variable without copying it.
void set(const char *shortcut, std::unique_ptr< wreport::Var > var)
Add or replace a value, taking ownership of the source variable without copying it.
const wreport::Var * get(const Level &lev, const Trange &tr, wreport::Varcode code) const
Get a variable given its code, level and time range information.
virtual MessageType get_type() const =0
Return the type of the data in the message.
virtual Datetime get_datetime() const =0
Get the reference Datetime for this message.
static std::shared_ptr< Message > create(MessageType type)
Create a new empty message.
virtual bool foreach_var(std::function< bool(const Level &, const Trange &, const wreport::Var &)>) const =0
Iterate the contents of the message.
virtual void set_impl(const Level &lev, const Trange &tr, std::unique_ptr< wreport::Var > var)=0
Implementation of set(const Level& const Trange&, std::unique_ptr<wreport::Var>)
void set(const char *shortcut, const wreport::Var &var)
Add or replace a value.
virtual const wreport::Var * get_impl(const Level &lev, const Trange &tr, wreport::Varcode code) const =0
Implementation of get(const Level&, const Trange&, wreport::Varcode)
virtual Ident get_ident() const =0
Get the station identifier for this message.
const wreport::Var * get(const std::string &shortcut) const
Get a variable given its shortcut name.
virtual std::shared_ptr< CursorStationData > query_station_data(const Query &query) const =0
Query the station variables in the message.
virtual Coords get_coords() const =0
Get the reference coordinates for this message.
void set(const Level &lev, const Trange &tr, wreport::Varcode code, const wreport::Var &var)
Add or replace a value.
virtual std::string get_report() const =0
Get the report for this message.
const wreport::Var * get(const char *shortcut) const
Get a variable given its shortcut name.
virtual std::shared_ptr< CursorStation > query_stations(const Query &query) const =0
Return a Cursor to access the station information in the message.
virtual std::shared_ptr< CursorData > query_data(const Query &query) const =0
Query the variables in the message.
Query used to filter DB-All.e data.
Definition: query.h:15
Coordinates.
Definition: types.h:369
Date and time.
Definition: types.h:165
Vertical level or layer.
Definition: types.h:625
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:687
Common base types used by most of DB-All.e code.