GeneratedExtension.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Google.ProtocolBuffers.Descriptors;
  5. namespace Google.ProtocolBuffers {
  6. /// <summary>
  7. /// Base class for all generated extensions.
  8. /// </summary>
  9. /// <remarks>
  10. /// The protocol compiler generates a static singleton instance of this
  11. /// class for each extension. For exmaple, imagine a .proto file with:
  12. /// <code>
  13. /// message Foo {
  14. /// extensions 1000 to max
  15. /// }
  16. ///
  17. /// extend Foo {
  18. /// optional int32 bar;
  19. /// }
  20. /// </code>
  21. /// Then MyProto.Foo.Bar has type GeneratedExtension&lt;MyProto.Foo,int&gt;.
  22. /// <para />
  23. /// In general, users should ignore the details of this type, and
  24. /// simply use the static singletons as parmaeters to the extension accessors
  25. /// in ExtendableMessage and ExtendableBuilder.
  26. /// </remarks>
  27. public class GeneratedExtension<TContainer, TExtension> where TContainer : IMessage<TContainer> {
  28. public FieldDescriptor Descriptor;
  29. public IMessage MessageDefaultInstance;
  30. }
  31. }