Commit 53727a0a authored by csharptest's avatar csharptest Committed by rogerk

Rebuild source for Issue 84 change to code generator

parent b4bd2e03
......@@ -159,7 +159,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _phoneNumberFieldNames;
if (hasNumber) {
output.WriteString(1, field_names[0], Number);
......@@ -175,20 +175,25 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasNumber) {
size += pb::CodedOutputStream.ComputeStringSize(1, Number);
}
if (hasType) {
size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Type);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasNumber) {
size += pb::CodedOutputStream.ComputeStringSize(1, Number);
}
if (hasType) {
size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Type);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static PhoneNumber ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -485,7 +490,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _personFieldNames;
if (hasName) {
output.WriteString(1, field_names[2], Name);
......@@ -507,26 +512,31 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasName) {
size += pb::CodedOutputStream.ComputeStringSize(1, Name);
}
if (hasId) {
size += pb::CodedOutputStream.ComputeInt32Size(2, Id);
}
if (hasEmail) {
size += pb::CodedOutputStream.ComputeStringSize(3, Email);
}
foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in PhoneList) {
size += pb::CodedOutputStream.ComputeMessageSize(4, element);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasName) {
size += pb::CodedOutputStream.ComputeStringSize(1, Name);
}
if (hasId) {
size += pb::CodedOutputStream.ComputeInt32Size(2, Id);
}
if (hasEmail) {
size += pb::CodedOutputStream.ComputeStringSize(3, Email);
}
foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneNumber element in PhoneList) {
size += pb::CodedOutputStream.ComputeMessageSize(4, element);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static Person ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -886,7 +896,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _addressBookFieldNames;
if (person_.Count > 0) {
output.WriteMessageArray(1, field_names[0], person_);
......@@ -899,17 +909,22 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in PersonList) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
foreach (global::Google.ProtocolBuffers.Examples.AddressBook.Person element in PersonList) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static AddressBook ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......
......@@ -107,7 +107,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _importMessageFieldNames;
if (hasD) {
output.WriteInt32(1, field_names[0], D);
......@@ -120,17 +120,22 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasD) {
size += pb::CodedOutputStream.ComputeInt32Size(1, D);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasD) {
size += pb::CodedOutputStream.ComputeInt32Size(1, D);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static ImportMessage ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -118,7 +118,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _optionsMessageFieldNames;
if (hasNormal) {
output.WriteString(1, field_names[1], Normal);
......@@ -137,23 +137,28 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasNormal) {
size += pb::CodedOutputStream.ComputeStringSize(1, Normal);
}
if (hasOptionsMessage_) {
size += pb::CodedOutputStream.ComputeStringSize(2, OptionsMessage_);
}
if (hasCustomName) {
size += pb::CodedOutputStream.ComputeStringSize(3, CustomName);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasNormal) {
size += pb::CodedOutputStream.ComputeStringSize(1, Normal);
}
if (hasOptionsMessage_) {
size += pb::CodedOutputStream.ComputeStringSize(2, OptionsMessage_);
}
if (hasCustomName) {
size += pb::CodedOutputStream.ComputeStringSize(3, CustomName);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static OptionsMessage ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......
......@@ -120,7 +120,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _testEmbedOptimizedForSizeFieldNames;
if (hasOptionalMessage) {
output.WriteMessage(1, field_names[0], OptionalMessage);
......@@ -136,20 +136,25 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasOptionalMessage) {
size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage);
}
foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) {
size += pb::CodedOutputStream.ComputeMessageSize(2, element);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasOptionalMessage) {
size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage);
}
foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) {
size += pb::CodedOutputStream.ComputeMessageSize(2, element);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static TestEmbedOptimizedForSize ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......
......@@ -190,7 +190,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _testUnpackedExtensionsFieldNames;
pb::ExtendableMessage<TestUnpackedExtensions, TestUnpackedExtensions.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);
extensionWriter.WriteUntil(536870912, output);
......@@ -202,15 +202,20 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
size += ExtensionsSerializedSize;
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
size += ExtensionsSerializedSize;
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static TestUnpackedExtensions ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......
......@@ -70,7 +70,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _importMessageLiteFieldNames;
if (hasD) {
output.WriteInt32(1, field_names[0], D);
......@@ -82,16 +82,21 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasD) {
size += pb::CodedOutputStream.ComputeInt32Size(1, D);
}
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasD) {
size += pb::CodedOutputStream.ComputeInt32Size(1, D);
}
memoizedSerializedSize = size;
return size;
}
#region Lite runtime methods
public override int GetHashCode() {
int hash = GetType().GetHashCode();
......
......@@ -107,7 +107,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _importMessageFieldNames;
if (hasD) {
output.WriteInt32(1, field_names[0], D);
......@@ -120,17 +120,22 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasD) {
size += pb::CodedOutputStream.ComputeInt32Size(1, D);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasD) {
size += pb::CodedOutputStream.ComputeInt32Size(1, D);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static ImportMessage ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......
......@@ -132,7 +132,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _testMessageSetFieldNames;
pb::ExtendableMessage<TestMessageSet, TestMessageSet.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);
extensionWriter.WriteUntil(536870912, output);
......@@ -144,15 +144,20 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
size += ExtensionsSerializedSize;
size += UnknownFields.SerializedSizeAsMessageSet;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
size += ExtensionsSerializedSize;
size += UnknownFields.SerializedSizeAsMessageSet;
memoizedSerializedSize = size;
return size;
}
public static TestMessageSet ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -373,7 +378,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _testMessageSetContainerFieldNames;
if (hasMessageSet) {
output.WriteMessage(1, field_names[0], MessageSet);
......@@ -386,17 +391,22 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasMessageSet) {
size += pb::CodedOutputStream.ComputeMessageSize(1, MessageSet);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasMessageSet) {
size += pb::CodedOutputStream.ComputeMessageSize(1, MessageSet);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static TestMessageSetContainer ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -670,7 +680,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _testMessageSetExtension1FieldNames;
if (hasI) {
output.WriteInt32(15, field_names[0], I);
......@@ -683,17 +693,22 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasI) {
size += pb::CodedOutputStream.ComputeInt32Size(15, I);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasI) {
size += pb::CodedOutputStream.ComputeInt32Size(15, I);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static TestMessageSetExtension1 ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -942,7 +957,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _testMessageSetExtension2FieldNames;
if (hasStr) {
output.WriteString(25, field_names[0], Str);
......@@ -955,17 +970,22 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasStr) {
size += pb::CodedOutputStream.ComputeStringSize(25, Str);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasStr) {
size += pb::CodedOutputStream.ComputeStringSize(25, Str);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static TestMessageSetExtension2 ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -1254,7 +1274,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _itemFieldNames;
if (hasTypeId) {
output.WriteInt32(2, field_names[1], TypeId);
......@@ -1270,20 +1290,25 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasTypeId) {
size += pb::CodedOutputStream.ComputeInt32Size(2, TypeId);
}
if (hasMessage) {
size += pb::CodedOutputStream.ComputeBytesSize(3, Message);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasTypeId) {
size += pb::CodedOutputStream.ComputeInt32Size(2, TypeId);
}
if (hasMessage) {
size += pb::CodedOutputStream.ComputeBytesSize(3, Message);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static Item ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -1537,7 +1562,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _rawMessageSetFieldNames;
if (item_.Count > 0) {
output.WriteGroupArray(1, field_names[0], item_);
......@@ -1550,17 +1575,22 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
foreach (global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item element in ItemList) {
size += pb::CodedOutputStream.ComputeGroupSize(1, element);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
foreach (global::Google.ProtocolBuffers.TestProtos.RawMessageSet.Types.Item element in ItemList) {
size += pb::CodedOutputStream.ComputeGroupSize(1, element);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static RawMessageSet ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......
......@@ -118,7 +118,7 @@ namespace Google.ProtocolBuffers.TestProtos.NoGenericService {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _testMessageFieldNames;
pb::ExtendableMessage<TestMessage, TestMessage.Builder>.ExtensionWriter extensionWriter = CreateExtensionWriter(this);
if (hasA) {
......@@ -133,18 +133,23 @@ namespace Google.ProtocolBuffers.TestProtos.NoGenericService {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasA) {
size += pb::CodedOutputStream.ComputeInt32Size(1, A);
}
size += ExtensionsSerializedSize;
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasA) {
size += pb::CodedOutputStream.ComputeInt32Size(1, A);
}
size += ExtensionsSerializedSize;
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static TestMessage ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......
......@@ -122,7 +122,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _searchRequestFieldNames;
if (criteria_.Count > 0) {
output.WriteStringArray(1, field_names[0], criteria_);
......@@ -135,22 +135,27 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
foreach (string element in CriteriaList) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
}
size += dataSize;
size += 1 * criteria_.Count;
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
foreach (string element in CriteriaList) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
}
size += dataSize;
size += 1 * criteria_.Count;
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static SearchRequest ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -450,7 +455,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _resultItemFieldNames;
if (hasUrl) {
output.WriteString(1, field_names[1], Url);
......@@ -466,20 +471,25 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasUrl) {
size += pb::CodedOutputStream.ComputeStringSize(1, Url);
}
if (hasName) {
size += pb::CodedOutputStream.ComputeStringSize(2, Name);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasUrl) {
size += pb::CodedOutputStream.ComputeStringSize(1, Url);
}
if (hasName) {
size += pb::CodedOutputStream.ComputeStringSize(2, Name);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static ResultItem ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -737,7 +747,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _searchResponseFieldNames;
if (results_.Count > 0) {
output.WriteMessageArray(1, field_names[0], results_);
......@@ -750,17 +760,22 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
foreach (global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem element in ResultsList) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
foreach (global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem element in ResultsList) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static SearchResponse ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -1046,7 +1061,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _refineSearchRequestFieldNames;
if (criteria_.Count > 0) {
output.WriteStringArray(1, field_names[0], criteria_);
......@@ -1062,25 +1077,30 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
foreach (string element in CriteriaList) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
}
size += dataSize;
size += 1 * criteria_.Count;
}
if (hasPreviousResults) {
size += pb::CodedOutputStream.ComputeMessageSize(2, PreviousResults);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
foreach (string element in CriteriaList) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
}
size += dataSize;
size += 1 * criteria_.Count;
}
if (hasPreviousResults) {
size += pb::CodedOutputStream.ComputeMessageSize(2, PreviousResults);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static RefineSearchRequest ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......
......@@ -313,7 +313,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _cSharpFileOptionsFieldNames;
if (hasNamespace) {
output.WriteString(1, field_names[9], Namespace);
......@@ -371,62 +371,67 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasNamespace) {
size += pb::CodedOutputStream.ComputeStringSize(1, Namespace);
}
if (hasUmbrellaClassname) {
size += pb::CodedOutputStream.ComputeStringSize(2, UmbrellaClassname);
}
if (hasPublicClasses) {
size += pb::CodedOutputStream.ComputeBoolSize(3, PublicClasses);
}
if (hasMultipleFiles) {
size += pb::CodedOutputStream.ComputeBoolSize(4, MultipleFiles);
}
if (hasNestClasses) {
size += pb::CodedOutputStream.ComputeBoolSize(5, NestClasses);
}
if (hasCodeContracts) {
size += pb::CodedOutputStream.ComputeBoolSize(6, CodeContracts);
}
if (hasExpandNamespaceDirectories) {
size += pb::CodedOutputStream.ComputeBoolSize(7, ExpandNamespaceDirectories);
}
if (hasClsCompliance) {
size += pb::CodedOutputStream.ComputeBoolSize(8, ClsCompliance);
}
if (hasAddSerializable) {
size += pb::CodedOutputStream.ComputeBoolSize(9, AddSerializable);
}
if (hasGeneratePrivateCtor) {
size += pb::CodedOutputStream.ComputeBoolSize(10, GeneratePrivateCtor);
}
if (hasFileExtension) {
size += pb::CodedOutputStream.ComputeStringSize(221, FileExtension);
}
if (hasUmbrellaNamespace) {
size += pb::CodedOutputStream.ComputeStringSize(222, UmbrellaNamespace);
}
if (hasOutputDirectory) {
size += pb::CodedOutputStream.ComputeStringSize(223, OutputDirectory);
}
if (hasIgnoreGoogleProtobuf) {
size += pb::CodedOutputStream.ComputeBoolSize(224, IgnoreGoogleProtobuf);
}
if (hasServiceGeneratorType) {
size += pb::CodedOutputStream.ComputeEnumSize(225, (int) ServiceGeneratorType);
}
if (hasGeneratedCodeAttributes) {
size += pb::CodedOutputStream.ComputeBoolSize(226, GeneratedCodeAttributes);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasNamespace) {
size += pb::CodedOutputStream.ComputeStringSize(1, Namespace);
}
if (hasUmbrellaClassname) {
size += pb::CodedOutputStream.ComputeStringSize(2, UmbrellaClassname);
}
if (hasPublicClasses) {
size += pb::CodedOutputStream.ComputeBoolSize(3, PublicClasses);
}
if (hasMultipleFiles) {
size += pb::CodedOutputStream.ComputeBoolSize(4, MultipleFiles);
}
if (hasNestClasses) {
size += pb::CodedOutputStream.ComputeBoolSize(5, NestClasses);
}
if (hasCodeContracts) {
size += pb::CodedOutputStream.ComputeBoolSize(6, CodeContracts);
}
if (hasExpandNamespaceDirectories) {
size += pb::CodedOutputStream.ComputeBoolSize(7, ExpandNamespaceDirectories);
}
if (hasClsCompliance) {
size += pb::CodedOutputStream.ComputeBoolSize(8, ClsCompliance);
}
if (hasAddSerializable) {
size += pb::CodedOutputStream.ComputeBoolSize(9, AddSerializable);
}
if (hasGeneratePrivateCtor) {
size += pb::CodedOutputStream.ComputeBoolSize(10, GeneratePrivateCtor);
}
if (hasFileExtension) {
size += pb::CodedOutputStream.ComputeStringSize(221, FileExtension);
}
if (hasUmbrellaNamespace) {
size += pb::CodedOutputStream.ComputeStringSize(222, UmbrellaNamespace);
}
if (hasOutputDirectory) {
size += pb::CodedOutputStream.ComputeStringSize(223, OutputDirectory);
}
if (hasIgnoreGoogleProtobuf) {
size += pb::CodedOutputStream.ComputeBoolSize(224, IgnoreGoogleProtobuf);
}
if (hasServiceGeneratorType) {
size += pb::CodedOutputStream.ComputeEnumSize(225, (int) ServiceGeneratorType);
}
if (hasGeneratedCodeAttributes) {
size += pb::CodedOutputStream.ComputeBoolSize(226, GeneratedCodeAttributes);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static CSharpFileOptions ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -1091,7 +1096,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _cSharpFieldOptionsFieldNames;
if (hasPropertyName) {
output.WriteString(1, field_names[0], PropertyName);
......@@ -1104,17 +1109,22 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasPropertyName) {
size += pb::CodedOutputStream.ComputeStringSize(1, PropertyName);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasPropertyName) {
size += pb::CodedOutputStream.ComputeStringSize(1, PropertyName);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static CSharpFieldOptions ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -1362,7 +1372,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _cSharpServiceOptionsFieldNames;
if (hasInterfaceId) {
output.WriteString(1, field_names[0], InterfaceId);
......@@ -1375,17 +1385,22 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasInterfaceId) {
size += pb::CodedOutputStream.ComputeStringSize(1, InterfaceId);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasInterfaceId) {
size += pb::CodedOutputStream.ComputeStringSize(1, InterfaceId);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static CSharpServiceOptions ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......@@ -1633,7 +1648,7 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _cSharpMethodOptionsFieldNames;
if (hasDispatchId) {
output.WriteInt32(1, field_names[0], DispatchId);
......@@ -1646,17 +1661,22 @@ namespace Google.ProtocolBuffers.DescriptorProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasDispatchId) {
size += pb::CodedOutputStream.ComputeInt32Size(1, DispatchId);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasDispatchId) {
size += pb::CodedOutputStream.ComputeInt32Size(1, DispatchId);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static CSharpMethodOptions ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......
......@@ -70,7 +70,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _importMessageLiteFieldNames;
if (hasD) {
output.WriteInt32(1, field_names[0], D);
......@@ -82,16 +82,21 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasD) {
size += pb::CodedOutputStream.ComputeInt32Size(1, D);
}
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasD) {
size += pb::CodedOutputStream.ComputeInt32Size(1, D);
}
memoizedSerializedSize = size;
return size;
}
#region Lite runtime methods
public override int GetHashCode() {
int hash = GetType().GetHashCode();
......
......@@ -107,7 +107,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _importMessageFieldNames;
if (hasD) {
output.WriteInt32(1, field_names[0], D);
......@@ -120,17 +120,22 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasD) {
size += pb::CodedOutputStream.ComputeInt32Size(1, D);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasD) {
size += pb::CodedOutputStream.ComputeInt32Size(1, D);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
public static ImportMessage ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
......
......@@ -61,7 +61,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _testLiteImportsNonliteFieldNames;
if (hasMessage) {
output.WriteMessage(1, field_names[0], Message);
......@@ -73,16 +73,21 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasMessage) {
size += pb::CodedOutputStream.ComputeMessageSize(1, Message);
}
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasMessage) {
size += pb::CodedOutputStream.ComputeMessageSize(1, Message);
}
memoizedSerializedSize = size;
return size;
}
#region Lite runtime methods
public override int GetHashCode() {
int hash = GetType().GetHashCode();
......
......@@ -63,7 +63,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _searchRequestFieldNames;
if (criteria_.Count > 0) {
output.WriteStringArray(1, field_names[0], criteria_);
......@@ -75,21 +75,26 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
foreach (string element in CriteriaList) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
}
size += dataSize;
size += 1 * criteria_.Count;
}
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
foreach (string element in CriteriaList) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
}
size += dataSize;
size += 1 * criteria_.Count;
}
memoizedSerializedSize = size;
return size;
}
#region Lite runtime methods
public override int GetHashCode() {
int hash = GetType().GetHashCode();
......@@ -377,7 +382,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _resultItemFieldNames;
if (hasUrl) {
output.WriteString(1, field_names[1], Url);
......@@ -392,19 +397,24 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasUrl) {
size += pb::CodedOutputStream.ComputeStringSize(1, Url);
}
if (hasName) {
size += pb::CodedOutputStream.ComputeStringSize(2, Name);
}
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (hasUrl) {
size += pb::CodedOutputStream.ComputeStringSize(1, Url);
}
if (hasName) {
size += pb::CodedOutputStream.ComputeStringSize(2, Name);
}
memoizedSerializedSize = size;
return size;
}
#region Lite runtime methods
public override int GetHashCode() {
int hash = GetType().GetHashCode();
......@@ -666,7 +676,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _searchResponseFieldNames;
if (results_.Count > 0) {
output.WriteMessageArray(1, field_names[0], results_);
......@@ -678,16 +688,21 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
foreach (global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem element in ResultsList) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element);
}
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
foreach (global::Google.ProtocolBuffers.TestProtos.SearchResponse.Types.ResultItem element in ResultsList) {
size += pb::CodedOutputStream.ComputeMessageSize(1, element);
}
memoizedSerializedSize = size;
return size;
}
#region Lite runtime methods
public override int GetHashCode() {
int hash = GetType().GetHashCode();
......@@ -969,7 +984,7 @@ namespace Google.ProtocolBuffers.TestProtos {
}
public override void WriteTo(pb::ICodedOutputStream output) {
int size = SerializedSize;
CalcSerializedSize();
string[] field_names = _refineSearchRequestFieldNames;
if (criteria_.Count > 0) {
output.WriteStringArray(1, field_names[0], criteria_);
......@@ -984,24 +999,29 @@ namespace Google.ProtocolBuffers.TestProtos {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
foreach (string element in CriteriaList) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
}
size += dataSize;
size += 1 * criteria_.Count;
}
if (hasPreviousResults) {
size += pb::CodedOutputStream.ComputeMessageSize(2, PreviousResults);
}
memoizedSerializedSize = size;
return size;
return CalcSerializedSize();
}
}
private int CalcSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
foreach (string element in CriteriaList) {
dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element);
}
size += dataSize;
size += 1 * criteria_.Count;
}
if (hasPreviousResults) {
size += pb::CodedOutputStream.ComputeMessageSize(2, PreviousResults);
}
memoizedSerializedSize = size;
return size;
}
#region Lite runtime methods
public override int GetHashCode() {
int hash = GetType().GetHashCode();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment