libwreport  2.4
Public Member Functions | Data Fields
wreport::Opcodes Struct Reference

Sequence of opcodes, as a slice of a Varcode vector. More...

#include <opcode.h>

Public Member Functions

 Opcodes (const std::vector< Varcode > &vals)
 Sequence spanning the whole vector.
 Opcodes (const std::vector< Varcode > &vals, unsigned begin, unsigned end)
 Sequence from begin (inclusive) to end (excluded)
 Opcodes (const Opcodes &o)
 Copy constructor.
Opcodesoperator= (const Opcodes &o)
 Assignment only works if the Opcodes share the same vector.
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 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 visit (opcode::Visitor &e, const DTable &dtable) const
 Walk the structure of the opcodes sending events to an opcode::Visitor.
void visit (opcode::Visitor &e) const
 Walk the structure of the opcodes sending events to an opcode::Visitor.
void print (FILE *out) const
 Print the contents of this opcode list.

Data Fields

const std::vector< Varcode > & vals
 Reference to the vector with all the expanded varcodes.
unsigned begin
 First element of the varcode sequence in Opcodes::vals.
unsigned end
 One-past-the-last element of the varcode sequence in Opcodes::vals.

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

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, Opcodes(), and vals.

Opcodes& wreport::Opcodes::operator= ( const Opcodes o)
inline

Assignment only works if the Opcodes share the same vector.

Warning
: for efficiency reasons, we do not check for it

References begin, and end.

void wreport::Opcodes::visit ( opcode::Visitor e,
const DTable dtable 
) const

Walk the structure of the opcodes sending events to an opcode::Visitor.

Initialise e.dtable with dtable.

void wreport::Opcodes::visit ( opcode::Visitor e) const

Walk the structure of the opcodes sending events to an opcode::Visitor.

Assume that e.dtable is already initialised.


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