wreport::Opcodes Struct Reference

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.
Opcodes | pop_left (unsigned count)
| Return the first count elements and advance begin to the first opcode after the sequence.
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.
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.

## Detailed Description

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.

## Member Function Documentation

## next()

Opcodes wreport::Opcodes::next | ( |  | ) | const

inline

List of all opcodes after the first one.

If the list is empty, return the empty list

References begin, end, and Opcodes().

## pop_left() [1/2]

Varcode wreport::Opcodes::pop_left | ( |  | ) |

inline

Return the first element and advance begin to the next one.

If the sequence is empty, throw an exception

References begin, and empty().

## pop_left() [2/2]

Opcodes wreport::Opcodes::pop_left | ( | unsigned | count | ) |

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, Opcodes(), size(), and wreport::error_consistency::throwf().

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

- opcodes.h