1 #ifndef WREPORT_OPCODE_H
2 #define WREPORT_OPCODE_H
45 unsigned size()
const {
return static_cast<unsigned>(
end -
begin); }
Report an error when a consistency check failed.
Definition: error.h:192
static void throwf(const char *fmt,...) WREPORT_THROWF_ATTRS(1
Throw the exception, building the message printf-style.
String functions.
Definition: benchmark.h:13
uint16_t Varcode
Holds the WMO variable code of a variable.
Definition: fwd.h:12
Sequence of opcodes, as a slice of a Varcode vector.
Definition: opcodes.h:20
const Varcode * end
One-past-the-last element of the varcode sequence.
Definition: opcodes.h:24
Opcodes sub(unsigned skip, unsigned len) const
Return len opcodes starting from skip.
Definition: opcodes.h:107
Varcode head() const
First opcode in the list (0 if the list is empty)
Definition: opcodes.h:77
Opcodes(const std::vector< Varcode > &vals)
Sequence spanning the whole vector.
Definition: opcodes.h:27
unsigned size() const
Number of items in this opcode list.
Definition: opcodes.h:45
Opcodes sub(unsigned skip) const
Return the opcodes from skip until the end.
Definition: opcodes.h:98
Opcodes next() const
List of all opcodes after the first one.
Definition: opcodes.h:89
Varcode operator[](unsigned i) const
Return the i-th varcode in the chain.
Definition: opcodes.h:36
Varcode pop_left()
Return the first element and advance begin to the next one.
Definition: opcodes.h:55
Opcodes pop_left(unsigned count)
Return the first count elements and advance begin to the first opcode after the sequence.
Definition: opcodes.h:67
void print(FILE *out) const
Print the contents of this opcode list.
const Varcode * begin
First element of the varcode sequence.
Definition: opcodes.h:22
bool empty() const
True if there are no opcodes.
Definition: opcodes.h:48
Opcodes(const Varcode *begin, const Varcode *end)
Sequence from begin (inclusive) to end (excluded)
Definition: opcodes.h:29
Implement fast access to information about WMO variables.