Class ProtoMessage<M> (2.32.0)

A representation of the Spanner PROTO type: a protobuf message.

A ProtoMessage<M> can be implicitly constructed from and explicitly converted to an M. Values can be copied, assigned, and streamed.

A ProtoMessage<M> can also be explicitly constructed from and converted to the M wire format, although this is intended for internal use only.

Example

Given a proto definition message Mesg { string field = 1; }:

Mesg m;
m.set_field("value");
auto pm = spanner::ProtoMessage<Mesg>(m);
assert(Mesg(pm).field() == "value");

Constructors

ProtoMessage()

The default value.

ProtoMessage(M const &)

Implicit construction from the message type.

Parameter
Name Description
m M const &

ProtoMessage(std::string)

Explicit construction from wire format.

Parameter
Name Description
serialized_message std::string

Operators

operator message_type() const

Explicit conversion to the message type.

operator std::string() const

Explicit conversion to wire format.

Functions

static TypeName()

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

Returns
Type Description
std::string const &

Type Aliases

message_type

Alias Of: M