libwreport
3.29
|
Sequence of opcodes, as a slice of a Varcode vector. More...
#include <opcodes.h>
Public Member Functions | |
Opcodes (const std::vector< Varcode > &vals) | |
Sequence spanning the whole vector. | |
Opcodes (const Varcode *begin, const Varcode *end) | |
Sequence from begin (inclusive) to end (excluded) | |
Opcodes (const Opcodes &o)=default | |
Opcodes & | operator= (const Opcodes &o)=default |
Varcode | operator[] (unsigned i) const |
Return the i-th varcode in the chain. | |
unsigned | size () const |
Number of items in this opcode list. | |
bool | empty () const |
True if there are no opcodes. | |
Varcode | pop_left () |
Return the first element and advance begin to the next one. More... | |
Opcodes | pop_left (unsigned count) |
Return the first count elements and advance begin to the first opcode after the sequence. More... | |
Varcode | head () const |
First opcode in the list (0 if the list is empty) | |
Opcodes | next () const |
List of all opcodes after the first one. More... | |
Opcodes | sub (unsigned skip) const |
Return the opcodes from skip until the end. | |
Opcodes | sub (unsigned skip, unsigned len) const |
Return len opcodes starting from skip. | |
void | print (FILE *out) const |
Print the contents of this opcode list. | |
Data Fields | |
const Varcode * | begin |
First element of the varcode sequence. | |
const Varcode * | end |
One-past-the-last element of the varcode sequence. | |
Sequence of opcodes, as a slice of a Varcode vector.
This is used for BUFR and CREX encoding and decoding.
It can be considered as a sort of subroutine to be interpreted by the encoders/decoders.
|
inline |
|
inline |
|
inline |
Return the first count elements and advance begin to the first opcode after the sequence.
If the sequence has less that count elements, throw an exception
References begin, size(), and wreport::error_consistency::throwf().