libdballe  9.11
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dballe::impl::ValuesBase< Value > Class Template Reference
Inheritance diagram for dballe::impl::ValuesBase< Value >:
dballe::Values

Public Types

typedef std::vector< Value >::const_iterator const_iterator
 
typedef std::vector< Value >::iterator iterator
 

Public Member Functions

 ValuesBase (const ValuesBase &)=default
 
 ValuesBase (ValuesBase &&)=default
 
ValuesBaseoperator= (const ValuesBase &)=default
 
ValuesBaseoperator= (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 Valuevalue (wreport::Varcode code) const
 Lookup a value, throwing an exception if not found.
 
const Valuevalue (const char *code) const
 
const Valuevalue (const std::string &code) const
 
const wreport::Varvar (wreport::Varcode code) const
 Lookup a wreport::Var, throwing an exception if not found.
 
const wreport::Varvar (const char *code) const
 
const wreport::Varvar (const std::string &code) const
 
wreport::Varvar (wreport::Varcode code)
 Lookup a wreport::Var, throwing an exception if not found (non-const version)
 
wreport::Varvar (const char *code)
 
wreport::Varvar (const std::string &code)
 
const Valuemaybe_value (wreport::Varcode code) const
 Lookup a value, returning nullptr if not found.
 
const Valuemaybe_value (const char *code) const
 
const Valuemaybe_value (const std::string &code) const
 
const wreport::Varmaybe_var (wreport::Varcode code) const
 Lookup a variable, returning nullptr if not found.
 
const wreport::Varmaybe_var (const char *code) const
 
const wreport::Varmaybe_var (const std::string &code) const
 
wreport::Varmaybe_var (wreport::Varcode code)
 Lookup a variable, returning nullptr if not found (non-const version)
 
wreport::Varmaybe_var (const char *code)
 
wreport::Varmaybe_var (const std::string &code)
 
template<typename C , typename 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.
 

Static Public Member Functions

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.
 

Protected Member Functions

iterator insert_new (Value &&val)
 

Protected Attributes

std::vector< Valuem_values
 

Member Function Documentation

◆ move_to()

template<typename Value>
void dballe::impl::ValuesBase< Value >::move_to ( std::function< void(std::unique_ptr< wreport::Var >)>  dest)

Move all the Var passing them to the given function.

After this method is called, this Values will be empty.

◆ move_to_attributes()

template<typename Value>
void dballe::impl::ValuesBase< Value >::move_to_attributes ( wreport::Var dest)

Move all the Var as attributes to dest.

After this method is called, this Values will be empty.


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