ThrowHelper.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System;
  2. using System.Diagnostics.CodeAnalysis;
  3. namespace NativeCollection
  4. {
  5. internal static class ThrowHelper
  6. {
  7. [DoesNotReturn]
  8. public static void StackInitialCapacityException()
  9. {
  10. throw new ArgumentOutOfRangeException();
  11. }
  12. [DoesNotReturn]
  13. public static void StackEmptyException()
  14. {
  15. throw new InvalidOperationException("Stack Empty");
  16. }
  17. [DoesNotReturn]
  18. public static void QueueEmptyException()
  19. {
  20. throw new InvalidOperationException("EmptyQueue");
  21. }
  22. [DoesNotReturn]
  23. public static void ListInitialCapacityException()
  24. {
  25. throw new ArgumentOutOfRangeException();
  26. }
  27. [DoesNotReturn]
  28. public static void IndexMustBeLessException()
  29. {
  30. throw new ArgumentOutOfRangeException("IndexMustBeLess");
  31. }
  32. [DoesNotReturn]
  33. public static void ListSmallCapacity()
  34. {
  35. throw new ArgumentOutOfRangeException("SmallCapacity");
  36. }
  37. [DoesNotReturn]
  38. public static void ListIndexOutOfRange()
  39. {
  40. throw new ArgumentOutOfRangeException("ListIndexOutOfRange");
  41. }
  42. [DoesNotReturn]
  43. public static void ConcurrentOperationsNotSupported()
  44. {
  45. throw new InvalidOperationException("ConcurrentOperationsNotSupported");
  46. }
  47. [DoesNotReturn]
  48. public static void HashSetCapacityOutOfRange()
  49. {
  50. throw new ArgumentOutOfRangeException("HashSetCapacityOutOfRange");
  51. }
  52. [DoesNotReturn]
  53. public static void HashSetEnumFailedVersion()
  54. {
  55. throw new InvalidOperationException("EnumFailedVersion");
  56. }
  57. [DoesNotReturn]
  58. public static void HashSetEnumOpCantHappen()
  59. {
  60. throw new InvalidOperationException("EnumOpCantHappen");
  61. }
  62. [DoesNotReturn]
  63. public static void SortedSetVersionChanged()
  64. {
  65. throw new InvalidOperationException("_version != _tree.version");
  66. }
  67. }
  68. }