Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2922-DataCompletenessChartPerf/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/2.4.1/ProtobufCS/src/ProtocolBuffers/FieldAccess/IFieldAccessor.cs

Last change on this file was 8295, checked in by abeham, 12 years ago

#1897:

  • Removed protocol buffers 0.9.1
  • Added protocol buffers 2.4.1
  • Updated proto processing command
File size: 3.8 KB
Line 
1// Protocol Buffers - Google's data interchange format
2// Copyright 2008 Google Inc.  All rights reserved.
3// http://github.com/jskeet/dotnet-protobufs/
4// Original C++/Java/Python code:
5// http://code.google.com/p/protobuf/
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are
9// met:
10//
11//     * Redistributions of source code must retain the above copyright
12// notice, this list of conditions and the following disclaimer.
13//     * Redistributions in binary form must reproduce the above
14// copyright notice, this list of conditions and the following disclaimer
15// in the documentation and/or other materials provided with the
16// distribution.
17//     * Neither the name of Google Inc. nor the names of its
18// contributors may be used to endorse or promote products derived from
19// this software without specific prior written permission.
20//
21// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33namespace Google.ProtocolBuffers.FieldAccess
34{
35    /// <summary>
36    /// Allows fields to be reflectively accessed in a smart manner.
37    /// The property descriptors for each field are created once and then cached.
38    /// In addition, this interface holds knowledge of repeated fields, builders etc.
39    /// </summary>
40    internal interface IFieldAccessor<TMessage, TBuilder>
41        where TMessage : IMessage<TMessage, TBuilder>
42        where TBuilder : IBuilder<TMessage, TBuilder>
43    {
44        /// <summary>
45        /// Indicates whether the specified message contains the field.
46        /// </summary>
47        bool Has(TMessage message);
48
49        /// <summary>
50        /// Gets the count of the repeated field in the specified message.
51        /// </summary>
52        int GetRepeatedCount(TMessage message);
53
54        /// <summary>
55        /// Clears the field in the specified builder.
56        /// </summary>
57        /// <param name="builder"></param>
58        void Clear(TBuilder builder);
59
60        /// <summary>
61        /// Creates a builder for the type of this field (which must be a message field).
62        /// </summary>
63        IBuilder CreateBuilder();
64
65        /// <summary>
66        /// Accessor for single fields
67        /// </summary>
68        object GetValue(TMessage message);
69
70        /// <summary>
71        /// Mutator for single fields
72        /// </summary>
73        void SetValue(TBuilder builder, object value);
74
75        /// <summary>
76        /// Accessor for repeated fields
77        /// </summary>
78        object GetRepeatedValue(TMessage message, int index);
79
80        /// <summary>
81        /// Mutator for repeated fields
82        /// </summary>
83        void SetRepeated(TBuilder builder, int index, object value);
84
85        /// <summary>
86        /// Adds the specified value to the field in the given builder.
87        /// </summary>
88        void AddRepeated(TBuilder builder, object value);
89
90        /// <summary>
91        /// Returns a read-only wrapper around the value of a repeated field.
92        /// </summary>
93        object GetRepeatedWrapper(TBuilder builder);
94    }
95}
Note: See TracBrowser for help on using the repository browser.