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