diff options
author | Jon Skeet <skeet@pobox.com> | 2015-07-30 09:47:38 +0100 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2015-07-30 09:47:38 +0100 |
commit | 7a0effb9e956ee5509d99a33f7d8fb52a9636871 (patch) | |
tree | 8bae164441950d8792d1b1612596809e45e9ce82 /csharp/src/Google.Protobuf/IMessage.cs | |
parent | 9cfea1d6f6b81462021b928f45c732cd9920d869 (diff) | |
parent | 7ec023acf4019e5401d4e147204ba5de12eed226 (diff) | |
download | protobuf-7a0effb9e956ee5509d99a33f7d8fb52a9636871.tar.gz protobuf-7a0effb9e956ee5509d99a33f7d8fb52a9636871.tar.bz2 protobuf-7a0effb9e956ee5509d99a33f7d8fb52a9636871.zip |
Merge pull request #654 from jtattermusch/csharp_hide_freeze
Remove the C# Freeze API
Diffstat (limited to 'csharp/src/Google.Protobuf/IMessage.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/IMessage.cs | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/csharp/src/Google.Protobuf/IMessage.cs b/csharp/src/Google.Protobuf/IMessage.cs index d179c386..60c6f8c3 100644 --- a/csharp/src/Google.Protobuf/IMessage.cs +++ b/csharp/src/Google.Protobuf/IMessage.cs @@ -79,7 +79,7 @@ namespace Google.Protobuf /// the implementation class.
/// </summary>
/// <typeparam name="T">The message type.</typeparam>
- public interface IMessage<T> : IMessage, IEquatable<T>, IDeepCloneable<T>, IFreezable where T : IMessage<T>
+ public interface IMessage<T> : IMessage, IEquatable<T>, IDeepCloneable<T> where T : IMessage<T>
{
/// <summary>
/// Merges the given message into this one.
@@ -97,10 +97,6 @@ namespace Google.Protobuf /// Additionally, due to the type constraint on <c>T</c> in <see cref="IMessage{T}"/>,
/// it is simpler to keep this as a separate interface.
/// </para>
- /// <para>
- /// Freezable types which implement this interface should always return a mutable clone,
- /// even if the original object is frozen.
- /// </para>
/// </remarks>
/// <typeparam name="T">The type itself, returned by the <see cref="Clone"/> method.</typeparam>
public interface IDeepCloneable<T>
@@ -111,32 +107,4 @@ namespace Google.Protobuf /// <returns>A deep clone of this object.</returns>
T Clone();
}
-
- /// <summary>
- /// Provides a mechanism for freezing a message (or repeated field collection)
- /// to make it immutable.
- /// </summary>
- /// <remarks>
- /// Implementations are under no obligation to make this thread-safe: if a freezable
- /// type instance is shared between threads before being frozen, and one thread then
- /// freezes it, it is possible for other threads to make changes during the freezing
- /// operation and also to observe stale values for mutated fields. Objects should be
- /// frozen before being made available to other threads.
- /// </remarks>
- public interface IFreezable
- {
- /// <summary>
- /// Freezes this object.
- /// </summary>
- /// <remarks>
- /// If the object is already frozen, this method has no effect.
- /// </remarks>
- void Freeze();
-
- /// <summary>
- /// Returns whether or not this object is frozen (and therefore immutable).
- /// </summary>
- /// <value><c>true</c> if this object is frozen; <c>false</c> otherwise.</value>
- bool IsFrozen { get; }
- }
}
|