IFixedSizePriorityQueue.cs 1.0 KB

123456789101112131415161718192021222324
  1. using System;
  2. namespace Priority_Queue
  3. {
  4. /// <summary>
  5. /// Credit: https://github.com/BlueRaja/High-Speed-Priority-Queue-for-C-Sharp
  6. /// A helper-interface only needed to make writing unit tests a bit easier (hence the 'internal' access modifier)
  7. /// </summary>
  8. internal interface IFixedSizePriorityQueue<TItem, in TPriority> : IPriorityQueue<TItem, TPriority>
  9. where TPriority : IComparable<TPriority>
  10. {
  11. /// <summary>
  12. /// Resize the queue so it can accept more nodes. All currently enqueued nodes are remain.
  13. /// Attempting to decrease the queue size to a size too small to hold the existing nodes results in undefined behavior
  14. /// </summary>
  15. void Resize(int maxNodes);
  16. /// <summary>
  17. /// Returns the maximum number of items that can be enqueued at once in this queue. Once you hit this number (ie. once Count == MaxSize),
  18. /// attempting to enqueue another item will cause undefined behavior.
  19. /// </summary>
  20. int MaxSize { get; }
  21. }
  22. }