Go to the documentation of this file.
68 "private static readonly pb::FieldCodec<$type_name$> _single_$name$_codec = ");
73 "private $type_name$ $name$_;\n");
78 "$access_level$ $type_name$ $property_name$ {\n"
79 " get { return $name$_; }\n"
87 "/// <summary>Gets whether the $descriptor_name$ field is set</summary>\n");
91 "$access_level$ bool Has$property_name$ {\n"
92 " get { return $name$_ != null; }\n"
96 "/// <summary>Clears the value of the $descriptor_name$ field</summary>\n");
100 "$access_level$ void Clear$property_name$() {\n"
109 "if (other.$has_property_check$) {\n"
110 " if ($has_not_property_check$ || other.$property_name$ != $default_value$) {\n"
111 " $property_name$ = other.$property_name$;\n"
119 "$type_name$ value = _single_$name$_codec.Read(input);\n"
120 "if ($has_not_property_check$ || value != $default_value$) {\n"
121 " $property_name$ = value;\n"
128 "if ($has_property_check$) {\n"
129 " _single_$name$_codec.WriteTagAndValue(output, $property_name$);\n"
136 "if ($has_property_check$) {\n"
137 " size += _single_$name$_codec.CalculateSizeWithTag($property_name$);\n"
142 const char *text =
"if ($has_property_check$) hash ^= $property_name$.GetHashCode();\n";
144 text =
"if ($has_property_check$) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableSingleEqualityComparer.GetHashCode($property_name$);\n";
147 text =
"if ($has_property_check$) hash ^= pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.GetHashCode($property_name$);\n";
153 const char *text =
"if ($property_name$ != other.$property_name$) return false;\n";
155 text =
"if (!pbc::ProtobufEqualityComparers.BitwiseNullableSingleEqualityComparer.Equals($property_name$, other.$property_name$)) return false;\n";
158 text =
"if (!pbc::ProtobufEqualityComparers.BitwiseNullableDoubleEqualityComparer.Equals($property_name$, other.$property_name$)) return false;\n";
169 "$property_name$ = other.$property_name$;\n");
176 "pb::FieldCodec.ForStructWrapper<$nonnullable_type_name$>($tag$)");
180 "pb::FieldCodec.ForClassWrapper<$type_name$>($tag$)");
189 "$access_level$ static readonly pb::Extension<$extended_type$, $type_name$> $property_name$ =\n"
190 " new pb::Extension<$extended_type$, $type_name$>($number$, ");
192 printer->
Print(
");\n");
208 "private static readonly pb::FieldCodec<$type_name$> _oneof_$name$_codec = ");
210 printer->
Print(
";\n");
215 "$access_level$ $type_name$ $property_name$ {\n"
216 " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : ($type_name$) null; }\n"
218 " $oneof_name$_ = value;\n"
219 " $oneof_name$Case_ = value == null ? $oneof_property_name$OneofCase.None : $oneof_property_name$OneofCase.$property_name$;\n"
225 "/// <summary>Gets whether the \"$descriptor_name$\" field is set</summary>\n");
229 "$access_level$ bool Has$property_name$ {\n"
230 " get { return $oneof_name$Case_ == $oneof_property_name$OneofCase.$property_name$; }\n"
234 "/// <summary> Clears the value of the oneof if it's currently set to \"$descriptor_name$\" </summary>\n");
238 "$access_level$ void Clear$property_name$() {\n"
239 " if ($has_property_check$) {\n"
240 " Clear$oneof_property_name$();\n"
247 printer->
Print(
variables_,
"$property_name$ = other.$property_name$;\n");
253 "$property_name$ = _oneof_$name$_codec.Read(input);\n");
260 "if ($has_property_check$) {\n"
261 " _oneof_$name$_codec.WriteTagAndValue(output, ($type_name$) $oneof_name$_);\n"
269 "if ($has_property_check$) {\n"
270 " size += _oneof_$name$_codec.CalculateSizeWithTag($property_name$);\n"
void Print(const std::map< std::string, std::string > &variables, const char *text)
virtual void GenerateSerializationCode(io::Printer *printer)
virtual void GenerateMergingCode(io::Printer *printer)
void SetCommonOneofFieldVariables(std::map< string, string > *variables)
const FieldDescriptor * descriptor_
bool IsProto2(const FileDescriptor *descriptor)
void AddDeprecatedFlag(io::Printer *printer)
std::map< string, string > variables_
virtual void WriteToString(io::Printer *printer)
const FieldDescriptor * field(int index) const
~WrapperOneofFieldGenerator()
virtual void WriteEquals(io::Printer *printer)
virtual void GenerateParsingCode(io::Printer *printer)
const FileDescriptor * file() const
void AddPublicMemberAttributes(io::Printer *printer)
virtual void GenerateCodecCode(io::Printer *printer)
virtual void GenerateSerializationCode(io::Printer *printer)
virtual void GenerateSerializedSizeCode(io::Printer *printer)
virtual void GenerateParsingCode(io::Printer *printer)
virtual void GenerateMembers(io::Printer *printer)
virtual void WriteHash(io::Printer *printer)
void WritePropertyDocComment(io::Printer *printer, const FieldDescriptor *field)
WrapperOneofFieldGenerator(const FieldDescriptor *descriptor, int presenceIndex, const Options *options)
const Descriptor * message_type() const
virtual void GenerateSerializedSizeCode(io::Printer *printer)
virtual void GenerateMergingCode(io::Printer *printer)
virtual void GenerateExtensionCode(io::Printer *printer)
virtual void GenerateMembers(io::Printer *printer)
virtual void GenerateCloningCode(io::Printer *printer)
WrapperFieldGenerator(const FieldDescriptor *descriptor, int presenceIndex, const Options *options)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:49