![]() |
mutable
A Database System for Research and Fast Prototyping
|
This class holds a SQL attribute value. More...
#include <Tuple.hpp>
Public Types | |
using | val_t = union { bool b |
Public Member Functions | |
Value () | |
template<typename T > | |
Value (T val) | |
template<typename T > | |
std::conditional_t< std::is_pointer_v< T >, T, T & > | as () |
Returns a reference to the value interpreted as of type T . | |
template<typename T > | |
T | as () const |
Returns the value interpreted as of type T . | |
auto & | as_b () |
Returns a reference to the value interpreted as of type bool . | |
auto & | as_i () |
Returns a reference to the value interpreted as of type int64_t . | |
auto & | as_f () |
Returns a reference to the value interpreted as of type float . | |
auto & | as_d () |
Returns a reference to the value interpreted as of type double . | |
auto | as_p () |
Returns a reference to the value interpreted as of type void* . | |
auto | as_b () const |
Returns the value interpreted as of type bool . | |
auto | as_i () const |
Returns the value interpreted as of type int64_t . | |
auto | as_f () const |
Returns the value interpreted as of type float . | |
auto | as_d () const |
Returns the value interpreted as of type double . | |
auto | as_p () const |
Returns the value interpreted as of type void* . | |
operator bool () const | |
operator int32_t () const | |
operator int64_t () const | |
operator float () const | |
operator double () const | |
template<typename T > | |
operator T* () const | |
M_LCOV_EXCL_STOP void | print (std::ostream &out, const Type &ty) const |
Interpret this Value as of Type ty and print a human-readable representation to out . | |
bool | operator== (Value other) const |
Checks whether this Value is equal to other . | |
bool | operator!= (Value other) const |
Checks whether this Value is not equal to other . | |
void | dump (std::ostream &out) const |
void | dump () const |
Data Fields | |
int64_t | i |
float | f |
double | d |
void * | p |
Private Attributes | |
val_t | val_ |
Friends | |
M_LCOV_EXCL_START friend std::ostream & | operator<< (std::ostream &out, Value val) |
Print a hexdump of val to out . | |
This class holds a SQL attribute value.
It cannot represent NULL
.
using m::Value::val_t = union { bool b |
Returns a reference to the value interpreted as of type T
.
Definition at line 79 of file Tuple.hpp.
References GET, m::T(), and VALIDATE_TYPE.
Referenced by m::idx::ArrayIndex< Key >::bulkload(), and m::StackMachine::operator()().
|
inline |
Returns a reference to the value interpreted as of type bool
.
Definition at line 101 of file Tuple.hpp.
Referenced by m::StackMachine::operator()(), and print().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void Value::dump | ( | ) | const |
|
inline |
|
inline |
M_LCOV_EXCL_START void Value::print | ( | std::ostream & | out, |
const Type & | ty | ||
) | const |
Interpret this Value
as of Type
ty
and print a human-readable representation to out
.
Definition at line 17 of file Tuple.cpp.
References as_b(), as_d(), as_f(), as_i(), M_unreachable, m::powi(), and m::visit().
Referenced by m::Tuple::print().
|
friend |
|
private |
Definition at line 43 of file Tuple.hpp.
Referenced by std::hash< m::Value >::operator()(), and operator==().