IMemoable.cs 1.1 KB

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