source.h 846 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <array>
  3. #include <cstddef>
  4. #include <cstdint>
  5. #include <span>
  6. #include "../../../middleware/content/packages/reader/reader.h"
  7. #include "../../../middleware/content/packages/tables/scenario_walk.h"
  8. namespace sunrise::client::content::activity {
  9. namespace packages = sunrise::middleware::content::packages;
  10. /** One buffer per read slot. */
  11. inline constexpr std::size_t kSlotCount =
  12. static_cast<std::size_t>(packages::tables::ReadSlot::count);
  13. /** Lock-owned storage for one scenario walk. */
  14. struct ScenarioSource {
  15. const packages::reader::Source* source{};
  16. /** Caller-owned reader storage. It outlives the scenario so its block cache carries over. */
  17. packages::reader::Scratch* scratch{};
  18. std::array<std::vector<std::byte>, kSlotCount> slots{};
  19. };
  20. } // namespace sunrise::client::content::activity