Class Value (2.42.0-rc)

The Value class represents a type-safe, nullable Bigtable value.

For now, this is a minimal class to unblock further development of the Bigtable GoogleSQL feature. It is conceptually similar to a std::any except the only allowed types will be those supported by Bigtable, and a "null" value (similar to a std::any without a value) still has an associated type. The supported types are shown in the following table along with how they map to the Bigtable types (https://cloud.google.com/bigtable/docs/data-types):

Bigtable Type C++ Type T
BOOL bool

Callers may create instances by passing any of the supported values (shown in the table above) to the constructor. "Null" values are created using the MakeNullValue<T>() factory function or by passing an empty absl::optional<T> to the Value constructor.

Constructors

Value()

Constructs a Value that holds nothing.

Value(bool)

Constructs an instance with the specified type and value.

Parameter
Name Description
v bool

Value(absl::optional< T >)

Constructs a non-null instance if opt has a value, otherwise constructs a null instance with the specified type T.

Parameters
Name Description
opt absl::optional< T >
typename T

Value(Value const &)

Parameter
Name Description
Value const &

Value(Value &&)

Parameter
Name Description
Value &&

Operators

operator=(Value const &)

Parameter
Name Description
Value const &
Returns
Type Description
Value &

operator=(Value &&)

Parameter
Name Description
Value &&
Returns
Type Description
Value &

Functions

get() const &

Parameter
Name Description
typename T
Returns
Type Description
StatusOr< T >

get() &&

Parameter
Name Description
typename T
Returns
Type Description
StatusOr< T >

is_null() const

Returns
Type Description
bool