IMemoable.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities
  5. {
  6. public interface IMemoable
  7. {
  8. /// <summary>
  9. /// Produce a copy of this object with its configuration and in its current state.
  10. /// </summary>
  11. /// <remarks>
  12. /// The returned object may be used simply to store the state, or may be used as a similar object
  13. /// starting from the copied state.
  14. /// </remarks>
  15. IMemoable Copy();
  16. /// <summary>
  17. /// Restore a copied object state into this object.
  18. /// </summary>
  19. /// <remarks>
  20. /// Implementations of this method <em>should</em> try to avoid or minimise memory allocation to perform the reset.
  21. /// </remarks>
  22. /// <param name="other">an object originally {@link #copy() copied} from an object of the same type as this instance.</param>
  23. /// <exception cref="InvalidCastException">if the provided object is not of the correct type.</exception>
  24. /// <exception cref="MemoableResetException">if the <b>other</b> parameter is in some other way invalid.</exception>
  25. void Reset(IMemoable other);
  26. }
  27. }
  28. #pragma warning restore
  29. #endif