cmCTestBinPacker.h 907 B

12345678910111213141516171819202122232425262728293031
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmCTestBinPacker_h
  4. #define cmCTestBinPacker_h
  5. #include <cstddef>
  6. #include <map>
  7. #include <string>
  8. #include <vector>
  9. #include "cmCTestResourceAllocator.h"
  10. struct cmCTestBinPackerAllocation
  11. {
  12. std::size_t ProcessIndex;
  13. int SlotsNeeded;
  14. std::string Id;
  15. bool operator==(const cmCTestBinPackerAllocation& other) const;
  16. bool operator!=(const cmCTestBinPackerAllocation& other) const;
  17. };
  18. bool cmAllocateCTestResourcesRoundRobin(
  19. const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
  20. std::vector<cmCTestBinPackerAllocation>& allocations);
  21. bool cmAllocateCTestResourcesBlock(
  22. const std::map<std::string, cmCTestResourceAllocator::Resource>& resources,
  23. std::vector<cmCTestBinPackerAllocation>& allocations);
  24. #endif