Class ProtoMessage<M> (2.30.0)
Stay organized with collections
Save and categorize content based on your preferences.
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()
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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-04 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-10-04 UTC."}
[[["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 2024-10-04 UTC."]]