4 #include <dballe/fwd.h> 26 Value(
Value&& o) : m_var(o.m_var) { o.m_var =
nullptr; }
32 Value(std::unique_ptr<wreport::Var>&& var) : m_var(var.
release()) {}
39 bool operator==(
const Value& o)
const;
40 bool operator!=(
const Value& o)
const;
58 void reset(std::unique_ptr<wreport::Var>&& var);
61 std::unique_ptr<wreport::Var>
release();
64 void print(FILE* out)
const;
93 bool operator==(
const DBValue& o)
const;
94 bool operator!=(
const DBValue& o)
const;
97 void print(FILE* out)
const;
100 std::ostream& operator<<(std::ostream&,
const Value&);
101 std::ostream& operator<<(std::ostream&,
const DBValue&);
wreport::Varcode code() const
Return the varcode of the variable, or 0 if no variable has been set.
Value(std::unique_ptr< wreport::Var > &&var)
Construct from a wreport::Var, taking ownership of it.
Definition: value.h:32
int data_id
Database ID of the value.
Definition: value.h:76
DBValue(int data_id, const wreport::Var &var)
Construct from a wreport::Var.
Definition: value.h:83
std::unique_ptr< wreport::Var > release()
Return the Var pointer, setting the Value to undefined.
void print(FILE *out) const
Print the contents of this Value.
void reset(const wreport::Var &var)
Fill from a wreport::Var.
Container for a wreport::Var pointer.
Definition: value.h:18
Container for a wreport::Var pointer, and its database ID.
Definition: value.h:71
void print(FILE *out) const
Print the contents of this Value.
DBValue(int data_id, std::unique_ptr< wreport::Var > &&var)
Construct from a wreport::Var, taking ownership of it.
Definition: value.h:87