aboutsummaryrefslogtreecommitdiff
path: root/csharp/ProtocolBuffers/GeneratedExtension.cs
blob: d39d794ed5c882c46746ff242b7ec7c0d3b4ae9a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using Google.ProtocolBuffers.Descriptors;

namespace Google.ProtocolBuffers {

  /// <summary>
  /// Base class for all generated extensions.
  /// </summary>
  /// <remarks>
  /// The protocol compiler generates a static singleton instance of this
  /// class for each extension. For exmaple, imagine a .proto file with:
  /// <code>
  /// message Foo {
  ///   extensions 1000 to max
  /// }
  /// 
  /// extend Foo {
  ///   optional int32 bar;
  /// }
  /// </code>
  /// Then MyProto.Foo.Bar has type GeneratedExtension&lt;MyProto.Foo,int&gt;.
  /// <para />
  /// In general, users should ignore the details of this type, and
  /// simply use the static singletons as parmaeters to the extension accessors
  /// in ExtendableMessage and ExtendableBuilder.
  /// </remarks>
  public class GeneratedExtension<TContainer, TExtension> where TContainer : IMessage<TContainer> {
    public FieldDescriptor Descriptor;

    public IMessage MessageDefaultInstance;
  }
}