libdballe
9.11
|
Collection of Value objects, indexed by wreport::Varcode. More...
#include <values.h>
Public Member Functions | |
Values (const DBValues &) | |
Values (DBValues &&) | |
Values & | operator= (const DBValues &) |
Values & | operator= (DBValues &&) |
![]() | |
ValuesBase (const ValuesBase &)=default | |
ValuesBase (ValuesBase &&)=default | |
ValuesBase & | operator= (const ValuesBase &)=default |
ValuesBase & | operator= (ValuesBase &&)=default |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
iterator | begin () |
iterator | end () |
iterator | find (wreport::Varcode code) noexcept |
const_iterator | find (wreport::Varcode code) const noexcept |
size_t | size () const |
bool | empty () const |
void | clear () |
void | reserve (typename std::vector< Value >::size_type size) |
bool | operator== (const ValuesBase< Value > &o) const |
bool | operator!= (const ValuesBase< Value > &o) const |
void | set (const wreport::Var &) |
Set from a wreport::Var. | |
void | set (std::unique_ptr< wreport::Var > &&) |
Set from a wreport::Var, taking ownership of it. | |
void | set (Value &&val) |
Set with a Value. | |
void | unset (wreport::Varcode code) |
Remove one variable. | |
void | merge (const ValuesBase< Value > &vals) |
Add all the variables from vals. | |
void | merge (ValuesBase< Value > &&vals) |
Add all the variables from vals. | |
template<typename C , typename T > | |
void | set (const C &code, const T &val) |
Set a variable value, creating it if it does not exist. | |
template<typename C , typename T > | |
void | setf (const C &code, const T &val) |
const Value & | value (wreport::Varcode code) const |
Lookup a value, throwing an exception if not found. | |
const Value & | value (const char *code) const |
const Value & | value (const std::string &code) const |
const wreport::Var & | var (wreport::Varcode code) const |
Lookup a wreport::Var, throwing an exception if not found. | |
const wreport::Var & | var (const char *code) const |
const wreport::Var & | var (const std::string &code) const |
wreport::Var & | var (wreport::Varcode code) |
Lookup a wreport::Var, throwing an exception if not found (non-const version) | |
wreport::Var & | var (const char *code) |
wreport::Var & | var (const std::string &code) |
const Value * | maybe_value (wreport::Varcode code) const |
Lookup a value, returning nullptr if not found. | |
const Value * | maybe_value (const char *code) const |
const Value * | maybe_value (const std::string &code) const |
const wreport::Var * | maybe_var (wreport::Varcode code) const |
Lookup a variable, returning nullptr if not found. | |
const wreport::Var * | maybe_var (const char *code) const |
const wreport::Var * | maybe_var (const std::string &code) const |
wreport::Var * | maybe_var (wreport::Varcode code) |
Lookup a variable, returning nullptr if not found (non-const version) | |
wreport::Var * | maybe_var (const char *code) |
wreport::Var * | maybe_var (const std::string &code) |
template<typename C , typename T > | |
T | enq (C code, const T &def) |
Get the value of a variable, or def if it is not set. | |
void | move_to_attributes (wreport::Var &dest) |
Move all the Var as attributes to dest. More... | |
void | move_to (std::function< void(std::unique_ptr< wreport::Var >)> dest) |
Move all the Var passing them to the given function. More... | |
void | print (FILE *out) const |
Print the contents of this Values. | |
std::vector< uint8_t > | encode () const |
Encode these values in a DB-All.e specific binary representation. | |
Additional Inherited Members | |
![]() | |
typedef std::vector< Value >::const_iterator | const_iterator |
typedef std::vector< Value >::iterator | iterator |
![]() | |
static std::vector< uint8_t > | encode_attrs (const wreport::Var &var) |
Encode the attributes of var in a DB-All.e specific binary representation. | |
static void | decode (const std::vector< uint8_t > &buf, std::function< void(std::unique_ptr< wreport::Var >)> dest) |
Decode variables from a DB-All.e specific binary representation. | |
![]() | |
iterator | insert_new (Value &&val) |
![]() | |
std::vector< Value > | m_values |
Collection of Value objects, indexed by wreport::Varcode.