Protocol Buffers - Google's data interchange format (grpc依赖) https://developers.google.com/protocol-buffers/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

375 lines
17 KiB

// Generated by the protocol buffer compiler. DO NOT EDIT!
using pb = global::Google.ProtocolBuffers;
using pbc = global::Google.ProtocolBuffers.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors;
using scg = global::System.Collections.Generic;
using self = global::Google.ProtocolBuffers.TestProtos;
namespace Google.ProtocolBuffers.TestProtos {
public static partial class UnitTestEmbedOptimizeForProtoFile {
#region Descriptor
public static pbd::FileDescriptor Descriptor {
get { return descriptor; }
}
private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
new byte[] {
0x0a, 0x31, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a,
0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x70, 0x74,
0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa1, 0x01, 0x0a, 0x19,
0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f,
0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69,
0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x65,
0x61, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54,
0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x42,
0x4a, 0x48, 0x01, 0xc2, 0x3e, 0x21, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca,
0x3e, 0x21, 0x55, 0x6e, 0x69, 0x74, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6d,
0x69, 0x7a, 0x65, 0x46, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65,
}, new pbd::FileDescriptor[] {
self::UnitTestOptimizeForProtoFile.Descriptor,
});
#endregion
#region Extensions
#endregion
#region Static variables
internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor
= Descriptor.MessageTypes[0];
internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable
= new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor,
new string[] { "OptionalMessage", "RepeatedMessage", },
typeof (self::TestEmbedOptimizedForSize),
typeof (self::TestEmbedOptimizedForSize.Builder));
#endregion
}
#region Enums
#endregion
#region Messages
public sealed partial class TestEmbedOptimizedForSize : pb::GeneratedMessage<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> {
// Use TestEmbedOptimizedForSize.CreateBuilder() to construct.
private TestEmbedOptimizedForSize() {}
private static readonly TestEmbedOptimizedForSize defaultInstance = new TestEmbedOptimizedForSize();
public static TestEmbedOptimizedForSize DefaultInstance {
get { return defaultInstance; }
}
public override TestEmbedOptimizedForSize DefaultInstanceForType {
get { return defaultInstance; }
}
public static pbd::MessageDescriptor Descriptor {
get { return self::UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor; }
}
protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
get { return self::UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable; }
}
// optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;
private bool hasOptionalMessage;
private self::TestOptimizedForSize optionalMessage_ = self::TestOptimizedForSize.DefaultInstance;
public bool HasOptionalMessage {
get { return hasOptionalMessage; }
}
public self::TestOptimizedForSize OptionalMessage {
get { return optionalMessage_; }
}
// repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;
private scg::IList<self::TestOptimizedForSize> repeatedMessage_ = pbc::Lists<self::TestOptimizedForSize>.Empty;
public scg::IList<self::TestOptimizedForSize> RepeatedMessageList {
get { return repeatedMessage_; }
}
public int RepeatedMessageCount
{ get { return repeatedMessage_.Count; }
}
public self::TestOptimizedForSize GetRepeatedMessage(int index) {
return repeatedMessage_ [index];
}
public override bool IsInitialized {
get {
if (HasOptionalMessage) {
if (!OptionalMessage.IsInitialized) return false;
}
foreach (self::TestOptimizedForSize element in RepeatedMessageList) {
if (!element.IsInitialized) return false;
}
return true;
}
}
public override void WriteTo(pb::CodedOutputStream output) {
if (HasOptionalMessage) {
output.WriteMessage(1, OptionalMessage);
}
foreach (self::TestOptimizedForSize element in RepeatedMessageList) {
output.WriteMessage(2, element);
}
UnknownFields.WriteTo(output);
}
private int memoizedSerializedSize = -1;
public override int SerializedSize {
get {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (HasOptionalMessage) {
size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage);
}
foreach (self::TestOptimizedForSize element in RepeatedMessageList) {
size += pb::CodedOutputStream.ComputeMessageSize(2, element);
}
size += UnknownFields.SerializedSize;
memoizedSerializedSize = size;
return size;
}
}
public static self::TestEmbedOptimizedForSize ParseFrom(pb::ByteString data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static self::TestEmbedOptimizedForSize ParseFrom(pb::ByteString data,
pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
.BuildParsed();
}
public static self::TestEmbedOptimizedForSize ParseFrom(byte[] data) {
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
}
public static self::TestEmbedOptimizedForSize parseFrom(byte[] data,
pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
.BuildParsed();
}
public static self::TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static self::TestEmbedOptimizedForSize ParseFrom(
global::System.IO.Stream input,
pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
.BuildParsed();
}
public static self::TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input) {
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
}
public static self::TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input,
pb::ExtensionRegistry extensionRegistry) {
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
.BuildParsed();
}
public static Builder CreateBuilder() { return new Builder(); }
public override IBuilder<self::TestEmbedOptimizedForSize> CreateBuilderForType() { return new Builder(); }
public static Builder CreateBuilder(self::TestEmbedOptimizedForSize prototype) {
return (Builder) new Builder().MergeFrom(prototype);
}
public sealed partial class Builder : pb::GeneratedBuilder<self::TestEmbedOptimizedForSize, Builder> {
// Construct using self::TestEmbedOptimizedForSize.CreateBuilder()
internal Builder() {}
self::TestEmbedOptimizedForSize result = new self::TestEmbedOptimizedForSize();
protected override self::TestEmbedOptimizedForSize MessageBeingBuilt {
get { return result; }
}
public override IBuilder<self::TestEmbedOptimizedForSize> Clear() {
result = new self::TestEmbedOptimizedForSize();
return this;
}
public override IBuilder<self::TestEmbedOptimizedForSize> Clone() {
return new Builder().MergeFrom(result);
}
public override pbd::MessageDescriptor DescriptorForType {
get { return self::TestEmbedOptimizedForSize.Descriptor; }
}
public override self::TestEmbedOptimizedForSize DefaultInstanceForType {
get { return self::TestEmbedOptimizedForSize.DefaultInstance; }
}
public override self::TestEmbedOptimizedForSize BuildPartial() {
if (result.repeatedMessage_ != pbc::Lists<self::TestOptimizedForSize>.Empty) {
result.repeatedMessage_ = pbc::Lists<self::TestOptimizedForSize>.AsReadOnly(result.repeatedMessage_);
}
self::TestEmbedOptimizedForSize returnMe = result;
result = null;
return returnMe;
}
protected override IBuilder MergeFromImpl(CodedInputStream data, ExtensionRegistry extensionRegistry) {
return MergeFrom(data, extensionRegistry);
}
public override IBuilder MergeFrom(pb::IMessage other) {
if (other is self::TestEmbedOptimizedForSize) {
return MergeFrom((self::TestEmbedOptimizedForSize) other);
} else {
base.MergeFrom(other);
return this;
}
}
public override IBuilder<self::TestEmbedOptimizedForSize> MergeFrom(self::TestEmbedOptimizedForSize other) {
if (other == self::TestEmbedOptimizedForSize.DefaultInstance) return this;
if (other.HasOptionalMessage) {
MergeOptionalMessage(other.OptionalMessage);
}
if (other.repeatedMessage_.Count != 0) {
if (result.repeatedMessage_.Count == 0) {
result.repeatedMessage_ = new scg::List<self::TestOptimizedForSize>();
}
base.AddRange(other.repeatedMessage_, result.repeatedMessage_);
}
this.MergeUnknownFields(other.UnknownFields);
return this;
}
public override IBuilder<self::TestEmbedOptimizedForSize> MergeFrom(pb::CodedInputStream input) {
return MergeFrom(input, pb::ExtensionRegistry.Empty);
}
public override IBuilder<self::TestEmbedOptimizedForSize> MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
pb::UnknownFieldSet.Builder unknownFields =
pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
while (true) {
uint tag = input.ReadTag();
switch (tag) {
case 0:
this.UnknownFields = unknownFields.Build();
return this;
default: {
if (!ParseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.UnknownFields = unknownFields.Build();
return this;
}
break;
}
case 10: {
self::TestOptimizedForSize.Builder subBuilder = self::TestOptimizedForSize.CreateBuilder();
if (HasOptionalMessage) {
subBuilder.MergeFrom(OptionalMessage);
}
input.ReadMessage(subBuilder, extensionRegistry);
OptionalMessage = subBuilder.BuildPartial();
break;
}
case 18: {
self::TestOptimizedForSize.Builder subBuilder = self::TestOptimizedForSize.CreateBuilder();
input.ReadMessage(subBuilder, extensionRegistry);
AddRepeatedMessage(subBuilder.BuildPartial());
break;
}
}
}
}
// optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;
public bool HasOptionalMessage {
get { return result.HasOptionalMessage; }
}
public self::TestOptimizedForSize OptionalMessage {
get { return result.OptionalMessage; }
set { SetOptionalMessage(value); }
}
public Builder SetOptionalMessage(self::TestOptimizedForSize value) {
result.hasOptionalMessage = true;
result.optionalMessage_ = value;
return this;
}
public Builder SetOptionalMessage(self::TestOptimizedForSize.Builder builderForValue) {
result.hasOptionalMessage = true;
result.optionalMessage_ = builderForValue.Build();
return this;
}
public Builder MergeOptionalMessage(self::TestOptimizedForSize value) {
if (result.HasOptionalMessage &&
result.optionalMessage_ != self::TestOptimizedForSize.DefaultInstance) {
result.optionalMessage_ =
self::TestOptimizedForSize.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial();
} else {
result.optionalMessage_ = value;
}
result.hasOptionalMessage = true;
return this;
}
public Builder ClearOptionalMessage() {
result.hasOptionalMessage = false;
result.optionalMessage_ = self::TestOptimizedForSize.DefaultInstance;
return this;
}
// repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;
public scg::IList<self::TestOptimizedForSize> RepeatedMessageList {
get { return pbc::Lists.AsReadOnly(result.repeatedMessage_); }
}
public int RepeatedMessageCount {
get { return result.RepeatedMessageCount; }
}
public self::TestOptimizedForSize GetRepeatedMessage(int index) {
return result.GetRepeatedMessage(index);
}
public Builder SetRepeatedMessage(int index, self::TestOptimizedForSize value) {
result.repeatedMessage_[index] = value;
return this;
}
public Builder SetRepeatedMessage(int index, self::TestOptimizedForSize.Builder builderForValue) {
result.repeatedMessage_[index] = builderForValue.Build();
return this;
}
public Builder AddRepeatedMessage(self::TestOptimizedForSize value) {
if (result.repeatedMessage_ == pbc::Lists<self::TestOptimizedForSize>.Empty) {
result.repeatedMessage_ = new scg::List<self::TestOptimizedForSize>();
}
result.repeatedMessage_.Add(value);
return this;
}
public Builder AddRepeatedMessage(self::TestOptimizedForSize.Builder builderForValue) {
if (result.repeatedMessage_ == pbc::Lists<self::TestOptimizedForSize>.Empty) {
result.repeatedMessage_ = new scg::List<self::TestOptimizedForSize>();
}
result.repeatedMessage_.Add(builderForValue.Build());
return this;
}
public Builder AddRangeRepeatedMessage(scg::IEnumerable<self::TestOptimizedForSize> values) {
if (result.repeatedMessage_ == pbc::Lists<self::TestOptimizedForSize>.Empty) {
result.repeatedMessage_ = new scg::List<self::TestOptimizedForSize>();
}
base.AddRange(values, result.repeatedMessage_);
return this;
}
public Builder ClearRepeatedMessage() {
result.repeatedMessage_ = pbc::Lists<self::TestOptimizedForSize>.Empty;
return this;
}
}
}
#endregion
#region Services
#endregion
}