aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers/IMessage.cs
diff options
context:
space:
mode:
authorJon Skeet <skeet@pobox.com>2015-06-19 17:30:13 +0100
committerJon Skeet <skeet@pobox.com>2015-06-19 17:30:13 +0100
commitcdeda4b87625084f5687115bb1fd7772b7c34ad6 (patch)
tree373f4c38dbfb318626037ff204c30466574ab876 /csharp/src/ProtocolBuffers/IMessage.cs
parentd7dda2fed8c37a83e2d4cd7ecc4201b628588c4c (diff)
downloadprotobuf-cdeda4b87625084f5687115bb1fd7772b7c34ad6.tar.gz
protobuf-cdeda4b87625084f5687115bb1fd7772b7c34ad6.tar.bz2
protobuf-cdeda4b87625084f5687115bb1fd7772b7c34ad6.zip
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
Diffstat (limited to 'csharp/src/ProtocolBuffers/IMessage.cs')
-rw-r--r--csharp/src/ProtocolBuffers/IMessage.cs43
1 files changed, 38 insertions, 5 deletions
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?
+
+ /// <summary>
+ /// Reflection support for a specific message type. message
+ /// </summary>
+ /// <typeparam name="T">The message type being reflected.</typeparam>
public interface IReflectedMessage<T> where T : IMessage<T>
{
FieldAccessorTable<T> Fields { get; }
+ // TODO(jonskeet): Descriptor? Or a single property which has "all you need for reflection"?
}
+ /// <summary>
+ /// Interface for a Protocol Buffers message, supporting
+ /// basic operations required for serialization.
+ /// </summary>
public interface IMessage
{
+ /// <summary>
+ /// Merges the data from the specified coded input stream with the current message.
+ /// </summary>
+ /// <remarks>See the user guide for precise merge semantics.</remarks>
+ /// <param name="input"></param>
void MergeFrom(CodedInputStream input);
+
+ /// <summary>
+ /// Writes the data to the given coded output stream.
+ /// </summary>
+ /// <param name="output">Coded output stream to write the data to. Must not be null.</param>
void WriteTo(CodedOutputStream output);
+
+ /// <summary>
+ /// Calculates the size of this message in Protocol Buffer wire format, in bytes.
+ /// </summary>
+ /// <returns>The number of bytes required to write this message
+ /// to a coded output stream.</returns>
int CalculateSize();
}
+ /// <summary>
+ /// Generic interface for a Protocol Buffers message,
+ /// where the type parameter is expected to be the same type as
+ /// the implementation class.
+ /// </summary>
+ /// <typeparam name="T">The message type.</typeparam>
public interface IMessage<T> : IMessage where T : IMessage<T>
{
+ /// <summary>
+ /// Merges the given message into this one.
+ /// </summary>
+ /// <remarks>See the user guide for precise merge semantics.</remarks>
+ /// <param name="message">The message to merge with this one. Must not be null.</param>
void MergeFrom(T message);
}
} \ No newline at end of file