diff options
author | Jon Skeet <skeet@pobox.com> | 2008-08-14 20:37:12 +0100 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2008-08-14 20:37:12 +0100 |
commit | 272d384f6ad064756edc8d9778c5bcf667783821 (patch) | |
tree | eed1435ff63c89a52e426df79323a9b1c1bef24a /csharp/ProtocolBuffers/FieldAccess/IFieldAccessor.cs | |
parent | db9d2fcd06bd8604f2ff9f30489640f64c70c4cb (diff) | |
download | protobuf-272d384f6ad064756edc8d9778c5bcf667783821.tar.gz protobuf-272d384f6ad064756edc8d9778c5bcf667783821.tar.bz2 protobuf-272d384f6ad064756edc8d9778c5bcf667783821.zip |
Use delegates instead of dynamic reflection.
Diffstat (limited to 'csharp/ProtocolBuffers/FieldAccess/IFieldAccessor.cs')
-rw-r--r-- | csharp/ProtocolBuffers/FieldAccess/IFieldAccessor.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/csharp/ProtocolBuffers/FieldAccess/IFieldAccessor.cs b/csharp/ProtocolBuffers/FieldAccess/IFieldAccessor.cs index 3e47fdc6..eb57c8c9 100644 --- a/csharp/ProtocolBuffers/FieldAccess/IFieldAccessor.cs +++ b/csharp/ProtocolBuffers/FieldAccess/IFieldAccessor.cs @@ -21,23 +21,25 @@ namespace Google.ProtocolBuffers.FieldAccess { /// The property descriptors for each field are created once and then cached. /// In addition, this interface holds knowledge of repeated fields, builders etc. /// </summary> - internal interface IFieldAccessor { + internal interface IFieldAccessor<TMessage, TBuilder> + where TMessage : IMessage<TMessage, TBuilder> + where TBuilder : IBuilder<TMessage, TBuilder> { /// <summary> /// Indicates whether the specified message contains the field. /// </summary> - bool Has(IMessage message); + bool Has(TMessage message); /// <summary> /// Gets the count of the repeated field in the specified message. /// </summary> - int GetRepeatedCount(IMessage message); + int GetRepeatedCount(TMessage message); /// <summary> /// Clears the field in the specified builder. /// </summary> /// <param name="builder"></param> - void Clear(IBuilder builder); + void Clear(TBuilder builder); /// <summary> /// Creates a builder for the type of this field (which must be a message field). @@ -47,11 +49,11 @@ namespace Google.ProtocolBuffers.FieldAccess { /// <summary> /// Accessor for single fields /// </summary> - object GetValue(IMessage message); + object GetValue(TMessage message); /// <summary> /// Mutator for single fields /// </summary> - void SetValue(IBuilder builder, object value); + void SetValue(TBuilder builder, object value); /// <summary> /// Accessor for repeated fields |