libdballe 9.14
dballe::fortran::MsgAPI Class Reference
Inheritance diagram for dballe::fortran::MsgAPI:
dballe::fortran::CommonAPIImplementation dballe::fortran::API

Public Member Functions

 MsgAPI (const char *fname, const char *mode, const char *type)
const impl::Messagecurmsg () const
 Get a pointer to the current message being read or written.
impl::Messagecurmsg ()
void flushSubset ()
void flushMessage ()
void set_exporter (const char *template_name)
void reinit_db (const char *repinfofile=0) override
int query_stations () override
int query_data () override
void insert_data () override
void remove_data () override
void remove_all () override
void messages_open_input (const char *filename, const char *mode, Encoding format, bool) override
void messages_open_output (const char *filename, const char *mode, Encoding format) override
bool messages_read_next () override
void messages_write_next (const char *) override
Public Member Functions inherited from dballe::fortran::CommonAPIImplementation
 CommonAPIImplementation (const CommonAPIImplementation &)=delete
 CommonAPIImplementation (CommonAPIImplementation &&)=delete
CommonAPIImplementation & operator= (const CommonAPIImplementation &)=delete
CommonAPIImplementation & operator= (CommonAPIImplementation &&)=delete
template<typename Operation>
auto reset_operation (Operation *op) -> decltype(op->run())
void reset_operation ()
int enqi (const char *param) override
signed char enqb (const char *param) override
float enqr (const char *param) override
double enqd (const char *param) override
bool enqc (const char *param, char *res, unsigned res_len) override
void seti (const char *param, int value) override
void setb (const char *param, signed char value) override
void setr (const char *param, float value) override
void setd (const char *param, double value) override
void setc (const char *param, const char *value) override
void set_station_context () override
void enqlevel (int &ltype1, int &l1, int &ltype2, int &l2) override
void setlevel (int ltype1, int l1, int ltype2, int l2) override
void enqtimerange (int &ptype, int &p1, int &p2) override
void settimerange (int ptype, int p1, int p2) override
void enqdate (int &year, int &month, int &day, int &hour, int &min, int &sec) override
void setdate (int year, int month, int day, int hour, int min, int sec) override
void setdatemin (int year, int month, int day, int hour, int min, int sec) override
void setdatemax (int year, int month, int day, int hour, int min, int sec) override
void unset (const char *param) override
void unsetall () override
void unsetb () override
const char * describe_level (int ltype1, int l1, int ltype2, int l2) override
const char * describe_timerange (int ptype, int p1, int p2) override
const char * describe_var (const char *varcode, const char *value) override
void next_station () override
wreport::Varcode next_data () override
int query_attributes () override
const char * next_attribute () override
void insert_attributes () override
void remove_attributes () override
void commit () override
const Operation * test_get_operation () const
const core::Querytest_get_input_query () const
const core::Datatest_get_input_data () const
const Valuestest_get_qcinput () const
Public Member Functions inherited from dballe::fortran::API
const char * test_enqc (const char *param, unsigned len)
 Wrap enqc in a way that makes it easier to use in unit tests.

Public Attributes

std::shared_ptr< impl::Messagewmsg = nullptr
 Message subset being written.
std::vector< std::shared_ptr< dballe::Message > > * msgs = nullptr
 Message being written.
Public Attributes inherited from dballe::fortran::CommonAPIImplementation
unsigned perms = 0
core::Query input_query
wreport::Varcode input_query_var = 0
std::set< wreport::Varcode > input_query_varlist
core::Data input_data
std::vector< wreport::Varcode > selected_attr_codes
 Selected attribute varcodes (*varlist).
bool station_context = false
Values qcinput
Attributes qcoutput

Protected Types

enum  { STATE_BLANK = 1 , STATE_QUANTESONO = 2 , STATE_VOGLIOQUESTO = 4 , STATE_EOF = 8 }

Protected Member Functions

bool readNextMessage ()
 Read the next message.
Protected Member Functions inherited from dballe::fortran::CommonAPIImplementation
bool _seti (const char *key, unsigned len, int val)
bool _setd (const char *key, unsigned len, double val)
bool _setc (const char *key, unsigned len, const char *val)
bool _unset (const char *key, unsigned len)
void validate_input_query ()

Protected Attributes

Filefile
unsigned int state
 State flag to track what actions have been performed in order to decide what to do next.
Importerimporter
 Importer (NULL if we export).
std::string exporter_template
 Name of the last exporter template set.
Exporterexporter = nullptr
 Exporter (NULL if we import).
size_t curmsgidx
int cached_cat
 Category set for the message that we are writing.
int cached_subcat
 Subcategory set for the message that we are writing.
int cached_lcat
 Local category set for the message that we are writing.
Protected Attributes inherited from dballe::fortran::CommonAPIImplementation
Operation * operation = nullptr
std::string cached_spiega

Additional Inherited Members

Public Types inherited from dballe::fortran::CommonAPIImplementation
enum  Permissions {
  PERM_ANA_RO = (1 << 0) , PERM_ANA_WRITE = (1 << 1) , PERM_DATA_RO = (1 << 2) , PERM_DATA_ADD = (1 << 3) ,
  PERM_DATA_WRITE = (1 << 4) , PERM_ATTR_RO = (1 << 5) , PERM_ATTR_WRITE = (1 << 6)
}
Static Public Member Functions inherited from dballe::fortran::CommonAPIImplementation
static unsigned compute_permissions (const char *anaflag, const char *dataflag, const char *attrflag)
 Set the permission bits, parsing the flags and doing consistency checks.
Static Public Member Functions inherited from dballe::fortran::API
static void to_fortran (int32_t val, char *buf, unsigned buf_len)
static void to_fortran (const char *str, char *buf, unsigned buf_len)
static void to_fortran (const std::string &str, char *buf, unsigned buf_len)
Static Public Attributes inherited from dballe::fortran::API
static const signed char missing_byte
static const int missing_int
static const float missing_float
static const double missing_double

Constructor & Destructor Documentation

◆ MsgAPI()

dballe::fortran::MsgAPI::MsgAPI ( const char * fname,
const char * mode,
const char * type )
Parameters
fnamethe name of the file to open
modethe fopen-style mode to use when opening the file
typethe encoding to use for the file. It can be "BUFR" or "CREX" (read only) or "AUTO" (read only).

References MsgAPI().

Referenced by MsgAPI().

Member Function Documentation

◆ insert_data()

void dballe::fortran::MsgAPI::insert_data ( )
overridevirtual

Implements dballe::fortran::API.

◆ messages_open_input()

void dballe::fortran::MsgAPI::messages_open_input ( const char * filename,
const char * mode,
Encoding format,
bool  )
overridevirtual

Implements dballe::fortran::API.

◆ messages_open_output()

void dballe::fortran::MsgAPI::messages_open_output ( const char * filename,
const char * mode,
Encoding format )
overridevirtual

Implements dballe::fortran::API.

◆ messages_read_next()

bool dballe::fortran::MsgAPI::messages_read_next ( )
overridevirtual

Implements dballe::fortran::API.

◆ messages_write_next()

void dballe::fortran::MsgAPI::messages_write_next ( const char * )
overridevirtual

Implements dballe::fortran::API.

◆ query_data()

int dballe::fortran::MsgAPI::query_data ( )
overridevirtual

Implements dballe::fortran::API.

◆ query_stations()

int dballe::fortran::MsgAPI::query_stations ( )
overridevirtual

Implements dballe::fortran::API.

◆ readNextMessage()

bool dballe::fortran::MsgAPI::readNextMessage ( )
protected

Read the next message.

Returns
true if there was a next message, false if we reached end of file

◆ reinit_db()

void dballe::fortran::MsgAPI::reinit_db ( const char * repinfofile = 0)
overridevirtual

Implements dballe::fortran::API.

◆ remove_all()

void dballe::fortran::MsgAPI::remove_all ( )
overridevirtual

Implements dballe::fortran::API.

◆ remove_data()

void dballe::fortran::MsgAPI::remove_data ( )
overridevirtual

Implements dballe::fortran::API.


The documentation for this class was generated from the following file: