From cdeda4b87625084f5687115bb1fd7772b7c34ad6 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Fri, 19 Jun 2015 17:30:13 +0100 Subject: Minor cleanup. - Make some members internal - Remove a lot of FrameworkPortability that isn't required - Start adding documentation comments - Remove some more group-based members - Not passing in "the last tag read" into Read*Array, g --- csharp/src/ProtocolBuffers/IMessage.cs | 43 ++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) (limited to 'csharp/src/ProtocolBuffers/IMessage.cs') diff --git a/csharp/src/ProtocolBuffers/IMessage.cs b/csharp/src/ProtocolBuffers/IMessage.cs index 55b6fc5d..9c2a2d85 100644 --- a/csharp/src/ProtocolBuffers/IMessage.cs +++ b/csharp/src/ProtocolBuffers/IMessage.cs @@ -34,30 +34,63 @@ #endregion -using System; -using System.Collections.Generic; -using System.IO; -using Google.Protobuf.Descriptors; using Google.Protobuf.FieldAccess; namespace Google.Protobuf { - // TODO(jonskeet): Do we want a "weak" version of IReflectedMessage? + // TODO(jonskeet): Do we want a "weak" (non-generic) version of IReflectedMessage? + + /// + /// Reflection support for a specific message type. message + /// + /// The message type being reflected. public interface IReflectedMessage where T : IMessage { FieldAccessorTable Fields { get; } + // TODO(jonskeet): Descriptor? Or a single property which has "all you need for reflection"? } + /// + /// Interface for a Protocol Buffers message, supporting + /// basic operations required for serialization. + /// public interface IMessage { + /// + /// Merges the data from the specified coded input stream with the current message. + /// + /// See the user guide for precise merge semantics. + /// void MergeFrom(CodedInputStream input); + + /// + /// Writes the data to the given coded output stream. + /// + /// Coded output stream to write the data to. Must not be null. void WriteTo(CodedOutputStream output); + + /// + /// Calculates the size of this message in Protocol Buffer wire format, in bytes. + /// + /// The number of bytes required to write this message + /// to a coded output stream. int CalculateSize(); } + /// + /// Generic interface for a Protocol Buffers message, + /// where the type parameter is expected to be the same type as + /// the implementation class. + /// + /// The message type. public interface IMessage : IMessage where T : IMessage { + /// + /// Merges the given message into this one. + /// + /// See the user guide for precise merge semantics. + /// The message to merge with this one. Must not be null. void MergeFrom(T message); } } \ No newline at end of file -- cgit v1.2.3