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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-21 UTC."],[[["This page provides documentation for the `ProtoEnum` class in the Google Cloud Spanner C++ library, specifically for version 2.27.0, with links to other versions ranging from 2.11.0 to 2.37.0-rc."],["`ProtoEnum` represents a protobuf enumeration and can be implicitly constructed from and explicitly converted to its underlying enum type `E`."],["The class offers operations for copying, assignment, equality comparison, and streaming of enum values."],["The default constructor of `ProtoEnum` sets the value to the first listed element in the enum definition."],["A static `TypeName()` function retrieves the fully qualified name of the enum type, while `enum_type` is an alias of `E` that is the underlying type."]]],[]]