Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | |
| 3 | using pb = global::Google.ProtocolBuffers; |
| 4 | using pbc = global::Google.ProtocolBuffers.Collections; |
| 5 | using pbd = global::Google.ProtocolBuffers.Descriptors; |
| 6 | using scg = global::System.Collections.Generic; |
| 7 | namespace Google.ProtocolBuffers.TestProtos { |
| 8 | |
| 9 | public static partial class UnitTestEmbedOptimizeForProtoFile { |
| 10 | |
| 11 | #region Descriptor |
| 12 | public static pbd::FileDescriptor Descriptor { |
| 13 | get { return descriptor; } |
| 14 | } |
| 15 | private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom( |
| 16 | global::System.Convert.FromBase64String( |
| 17 | "CjFnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfZW1iZWRfb3B0aW1pemVfZm9y" + |
| 18 | "LnByb3RvEhFwcm90b2J1Zl91bml0dGVzdBokZ29vZ2xlL3Byb3RvYnVmL2Nz" + |
Jon Skeet | 343d9f5 | 2009-01-16 11:52:44 +0000 | [diff] [blame] | 19 | "aGFycF9vcHRpb25zLnByb3RvGitnb29nbGUvcHJvdG9idWYvdW5pdHRlc3Rf" + |
| 20 | "b3B0aW1pemVfZm9yLnByb3RvIqEBChlUZXN0RW1iZWRPcHRpbWl6ZWRGb3JT" + |
| 21 | "aXplEkEKEG9wdGlvbmFsX21lc3NhZ2UYASABKAsyJy5wcm90b2J1Zl91bml0" + |
| 22 | "dGVzdC5UZXN0T3B0aW1pemVkRm9yU2l6ZRJBChByZXBlYXRlZF9tZXNzYWdl" + |
| 23 | "GAIgAygLMicucHJvdG9idWZfdW5pdHRlc3QuVGVzdE9wdGltaXplZEZvclNp" + |
| 24 | "emVCS0gBwj5GCiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MS" + |
| 25 | "IVVuaXRUZXN0RW1iZWRPcHRpbWl6ZUZvclByb3RvRmlsZQ=="), |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 26 | new pbd::FileDescriptor[] { |
| 27 | global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 28 | global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.Descriptor, |
| 29 | }); |
| 30 | #endregion |
| 31 | |
| 32 | #region Static variables |
| 33 | internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor |
| 34 | = Descriptor.MessageTypes[0]; |
| 35 | internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Builder> internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable |
| 36 | = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Builder>(internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor, |
| 37 | new string[] { "OptionalMessage", "RepeatedMessage", }); |
| 38 | #endregion |
| 39 | } |
| 40 | #region Messages |
| 41 | public sealed partial class TestEmbedOptimizedForSize : pb::GeneratedMessage<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> { |
| 42 | private static readonly TestEmbedOptimizedForSize defaultInstance = new Builder().BuildPartial(); |
| 43 | public static TestEmbedOptimizedForSize DefaultInstance { |
| 44 | get { return defaultInstance; } |
| 45 | } |
| 46 | |
| 47 | public override TestEmbedOptimizedForSize DefaultInstanceForType { |
| 48 | get { return defaultInstance; } |
| 49 | } |
| 50 | |
| 51 | protected override TestEmbedOptimizedForSize ThisMessage { |
| 52 | get { return this; } |
| 53 | } |
| 54 | |
| 55 | public static pbd::MessageDescriptor Descriptor { |
| 56 | get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor; } |
| 57 | } |
| 58 | |
| 59 | protected override pb::FieldAccess.FieldAccessorTable<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> InternalFieldAccessors { |
| 60 | get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable; } |
| 61 | } |
| 62 | |
Jon Skeet | 7ee85c4 | 2009-05-28 21:11:15 +0100 | [diff] [blame^] | 63 | public const int OptionalMessageFieldNumber = 1; |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 64 | private bool hasOptionalMessage; |
| 65 | private global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance; |
| 66 | public bool HasOptionalMessage { |
| 67 | get { return hasOptionalMessage; } |
| 68 | } |
| 69 | public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage { |
| 70 | get { return optionalMessage_; } |
| 71 | } |
| 72 | |
Jon Skeet | 7ee85c4 | 2009-05-28 21:11:15 +0100 | [diff] [blame^] | 73 | public const int RepeatedMessageFieldNumber = 2; |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 74 | private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> repeatedMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize>(); |
| 75 | public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> RepeatedMessageList { |
| 76 | get { return repeatedMessage_; } |
| 77 | } |
| 78 | public int RepeatedMessageCount { |
| 79 | get { return repeatedMessage_.Count; } |
| 80 | } |
| 81 | public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) { |
| 82 | return repeatedMessage_[index]; |
| 83 | } |
| 84 | |
| 85 | public override bool IsInitialized { |
| 86 | get { |
| 87 | if (HasOptionalMessage) { |
| 88 | if (!OptionalMessage.IsInitialized) return false; |
| 89 | } |
| 90 | foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) { |
| 91 | if (!element.IsInitialized) return false; |
| 92 | } |
| 93 | return true; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | public override void WriteTo(pb::CodedOutputStream output) { |
| 98 | if (HasOptionalMessage) { |
| 99 | output.WriteMessage(1, OptionalMessage); |
| 100 | } |
| 101 | foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) { |
| 102 | output.WriteMessage(2, element); |
| 103 | } |
| 104 | UnknownFields.WriteTo(output); |
| 105 | } |
| 106 | |
| 107 | private int memoizedSerializedSize = -1; |
| 108 | public override int SerializedSize { |
| 109 | get { |
| 110 | int size = memoizedSerializedSize; |
| 111 | if (size != -1) return size; |
| 112 | |
| 113 | size = 0; |
| 114 | if (HasOptionalMessage) { |
| 115 | size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage); |
| 116 | } |
| 117 | foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) { |
| 118 | size += pb::CodedOutputStream.ComputeMessageSize(2, element); |
| 119 | } |
| 120 | size += UnknownFields.SerializedSize; |
| 121 | memoizedSerializedSize = size; |
| 122 | return size; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | public static TestEmbedOptimizedForSize ParseFrom(pb::ByteString data) { |
| 127 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
| 128 | } |
| 129 | public static TestEmbedOptimizedForSize ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { |
| 130 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
| 131 | } |
| 132 | public static TestEmbedOptimizedForSize ParseFrom(byte[] data) { |
| 133 | return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); |
| 134 | } |
| 135 | public static TestEmbedOptimizedForSize ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { |
| 136 | return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); |
| 137 | } |
| 138 | public static TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input) { |
| 139 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
| 140 | } |
| 141 | public static TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { |
| 142 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
| 143 | } |
| 144 | public static TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input) { |
| 145 | return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); |
| 146 | } |
| 147 | public static TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
| 148 | return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); |
| 149 | } |
| 150 | public static Builder CreateBuilder() { return new Builder(); } |
Jon Skeet | e81a9d7 | 2009-02-24 16:50:56 +0000 | [diff] [blame] | 151 | public override Builder ToBuilder() { return CreateBuilder(this); } |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 152 | public override Builder CreateBuilderForType() { return new Builder(); } |
| 153 | public static Builder CreateBuilder(TestEmbedOptimizedForSize prototype) { |
| 154 | return (Builder) new Builder().MergeFrom(prototype); |
| 155 | } |
| 156 | |
| 157 | public sealed partial class Builder : pb::GeneratedBuilder<TestEmbedOptimizedForSize, Builder> { |
| 158 | protected override Builder ThisBuilder { |
| 159 | get { return this; } |
| 160 | } |
| 161 | public Builder() {} |
| 162 | |
| 163 | TestEmbedOptimizedForSize result = new TestEmbedOptimizedForSize(); |
| 164 | |
| 165 | protected override TestEmbedOptimizedForSize MessageBeingBuilt { |
| 166 | get { return result; } |
| 167 | } |
| 168 | |
| 169 | public override Builder Clear() { |
| 170 | result = new TestEmbedOptimizedForSize(); |
| 171 | return this; |
| 172 | } |
| 173 | |
| 174 | public override Builder Clone() { |
| 175 | return new Builder().MergeFrom(result); |
| 176 | } |
| 177 | |
| 178 | public override pbd::MessageDescriptor DescriptorForType { |
| 179 | get { return TestEmbedOptimizedForSize.Descriptor; } |
| 180 | } |
| 181 | |
| 182 | public override TestEmbedOptimizedForSize DefaultInstanceForType { |
| 183 | get { return TestEmbedOptimizedForSize.DefaultInstance; } |
| 184 | } |
| 185 | |
| 186 | public override TestEmbedOptimizedForSize BuildPartial() { |
| 187 | result.repeatedMessage_.MakeReadOnly(); |
| 188 | TestEmbedOptimizedForSize returnMe = result; |
| 189 | result = null; |
| 190 | return returnMe; |
| 191 | } |
| 192 | |
| 193 | public override Builder MergeFrom(pb::IMessage other) { |
| 194 | if (other is TestEmbedOptimizedForSize) { |
| 195 | return MergeFrom((TestEmbedOptimizedForSize) other); |
| 196 | } else { |
| 197 | base.MergeFrom(other); |
| 198 | return this; |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | public override Builder MergeFrom(TestEmbedOptimizedForSize other) { |
| 203 | if (other == TestEmbedOptimizedForSize.DefaultInstance) return this; |
| 204 | if (other.HasOptionalMessage) { |
| 205 | MergeOptionalMessage(other.OptionalMessage); |
| 206 | } |
| 207 | if (other.repeatedMessage_.Count != 0) { |
| 208 | base.AddRange(other.repeatedMessage_, result.repeatedMessage_); |
| 209 | } |
| 210 | this.MergeUnknownFields(other.UnknownFields); |
| 211 | return this; |
| 212 | } |
| 213 | |
| 214 | public override Builder MergeFrom(pb::CodedInputStream input) { |
| 215 | return MergeFrom(input, pb::ExtensionRegistry.Empty); |
| 216 | } |
| 217 | |
| 218 | public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { |
Jon Skeet | 7de1aef | 2009-03-05 14:23:17 +0000 | [diff] [blame] | 219 | pb::UnknownFieldSet.Builder unknownFields = null; |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 220 | while (true) { |
| 221 | uint tag = input.ReadTag(); |
| 222 | switch (tag) { |
| 223 | case 0: { |
Jon Skeet | 7de1aef | 2009-03-05 14:23:17 +0000 | [diff] [blame] | 224 | if (unknownFields != null) { |
| 225 | this.UnknownFields = unknownFields.Build(); |
| 226 | } |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 227 | return this; |
| 228 | } |
| 229 | default: { |
Jon Skeet | 7de1aef | 2009-03-05 14:23:17 +0000 | [diff] [blame] | 230 | if (pb::WireFormat.IsEndGroupTag(tag)) { |
| 231 | if (unknownFields != null) { |
| 232 | this.UnknownFields = unknownFields.Build(); |
| 233 | } |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 234 | return this; |
| 235 | } |
Jon Skeet | 7de1aef | 2009-03-05 14:23:17 +0000 | [diff] [blame] | 236 | if (unknownFields == null) { |
| 237 | unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); |
| 238 | } |
| 239 | ParseUnknownField(input, unknownFields, extensionRegistry, tag); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 240 | break; |
| 241 | } |
| 242 | case 10: { |
| 243 | global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(); |
| 244 | if (HasOptionalMessage) { |
| 245 | subBuilder.MergeFrom(OptionalMessage); |
| 246 | } |
| 247 | input.ReadMessage(subBuilder, extensionRegistry); |
| 248 | OptionalMessage = subBuilder.BuildPartial(); |
| 249 | break; |
| 250 | } |
| 251 | case 18: { |
| 252 | global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(); |
| 253 | input.ReadMessage(subBuilder, extensionRegistry); |
| 254 | AddRepeatedMessage(subBuilder.BuildPartial()); |
| 255 | break; |
| 256 | } |
| 257 | } |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | |
| 262 | public bool HasOptionalMessage { |
| 263 | get { return result.HasOptionalMessage; } |
| 264 | } |
| 265 | public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage { |
| 266 | get { return result.OptionalMessage; } |
| 267 | set { SetOptionalMessage(value); } |
| 268 | } |
| 269 | public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 270 | pb::ThrowHelper.ThrowIfNull(value, "value"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 271 | result.hasOptionalMessage = true; |
| 272 | result.optionalMessage_ = value; |
| 273 | return this; |
| 274 | } |
| 275 | public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 276 | pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 277 | result.hasOptionalMessage = true; |
| 278 | result.optionalMessage_ = builderForValue.Build(); |
| 279 | return this; |
| 280 | } |
| 281 | public Builder MergeOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 282 | pb::ThrowHelper.ThrowIfNull(value, "value"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 283 | if (result.HasOptionalMessage && |
| 284 | result.optionalMessage_ != global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance) { |
| 285 | result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial(); |
| 286 | } else { |
| 287 | result.optionalMessage_ = value; |
| 288 | } |
| 289 | result.hasOptionalMessage = true; |
| 290 | return this; |
| 291 | } |
| 292 | public Builder ClearOptionalMessage() { |
| 293 | result.hasOptionalMessage = false; |
| 294 | result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance; |
| 295 | return this; |
| 296 | } |
| 297 | |
| 298 | public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> RepeatedMessageList { |
| 299 | get { return result.repeatedMessage_; } |
| 300 | } |
| 301 | public int RepeatedMessageCount { |
| 302 | get { return result.RepeatedMessageCount; } |
| 303 | } |
| 304 | public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) { |
| 305 | return result.GetRepeatedMessage(index); |
| 306 | } |
| 307 | public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 308 | pb::ThrowHelper.ThrowIfNull(value, "value"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 309 | result.repeatedMessage_[index] = value; |
| 310 | return this; |
| 311 | } |
| 312 | public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 313 | pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 314 | result.repeatedMessage_[index] = builderForValue.Build(); |
| 315 | return this; |
| 316 | } |
| 317 | public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 318 | pb::ThrowHelper.ThrowIfNull(value, "value"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 319 | result.repeatedMessage_.Add(value); |
| 320 | return this; |
| 321 | } |
| 322 | public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) { |
Jon Skeet | 642a814 | 2009-01-27 12:25:21 +0000 | [diff] [blame] | 323 | pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); |
Jon Skeet | 6803686 | 2008-10-22 13:30:34 +0100 | [diff] [blame] | 324 | result.repeatedMessage_.Add(builderForValue.Build()); |
| 325 | return this; |
| 326 | } |
| 327 | public Builder AddRangeRepeatedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> values) { |
| 328 | base.AddRange(values, result.repeatedMessage_); |
| 329 | return this; |
| 330 | } |
| 331 | public Builder ClearRepeatedMessage() { |
| 332 | result.repeatedMessage_.Clear(); |
| 333 | return this; |
| 334 | } |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | #endregion |
| 339 | |
| 340 | } |