Class ProtoEnum<E> (2.23.0)

A representation of the Spanner ENUM type: a protobuf enumeration.

A ProtoEnum<E> can be implicitly constructed from, and explicitly converted to an E. Values can be copied, assigned, compared for equality, and streamed.

Example

Given a proto definition enum Color { RED = 0; BLUE = 1; GREEN = 2; }:

auto e = spanner::ProtoEnum<Color>(BLUE);
assert(Color(e) == BLUE);

Constructors

ProtoEnum()

The default value is the first listed in the enum's definition.

ProtoEnum(enum_type)

Implicit construction from the enum type.

Parameter
Name Description
v enum_type

Operators

operator enum_type() const

Explicit conversion to the enum type.

Functions

static TypeName()

The fully-qualified name of the enum type, scope delimited by periods.

Returns
Type Description
std::string const &

Type Aliases

enum_type

Alias Of: E