runtime.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. #pragma once
  2. #include <array>
  3. #include <cstddef>
  4. #include <cstdint>
  5. #include <span>
  6. #include <string_view>
  7. #include "abilities/definition.h"
  8. #include "collectibles/collectible_catalog.h"
  9. #include "constants/definition.h"
  10. #include "definition.h"
  11. #include "hash_names/definition.h"
  12. #include "inventory/buckets/definition.h"
  13. #include "items/details/definition.h"
  14. #include "items/item_catalog.h"
  15. #include "items/socket_plugs/definition.h"
  16. #include "material_requirements/material_requirement_catalog.h"
  17. #include "progressions/definition.h"
  18. #include "scenarios/definition.h"
  19. #include "socket_entry_buckets/definition.h"
  20. #include "socket_entry_lists/definition.h"
  21. #include "spawn_sets/definition.h"
  22. #include "vendors/definition.h"
  23. namespace sunrise::state::build_data {
  24. /**
  25. * Loads the one build-data cache next to the module, when there is one.
  26. * Once a snapshot is on disk, later replacements are refused until State restarts. A failed first
  27. * commit withdraws that publication and restores nothing. Keep readers out until this returns.
  28. * @param module Loaded Sunrise DLL module, or null to turn off disk saving.
  29. * @param configuredEquipmentHash Hash of the authored equipment. Not a secret.
  30. * @return True when the cache is missing, stale, or passes every check.
  31. */
  32. [[nodiscard]] bool initialize(void* module, std::uint64_t configuredEquipmentHash) noexcept;
  33. /** Clears all cached build mappings and persistence paths. */
  34. void shutdown() noexcept;
  35. /** @return True when named package mappings are complete in State. */
  36. [[nodiscard]] bool named_catalog_ready() noexcept;
  37. /**
  38. * Marks the already-filled named catalog complete, and saves once all data is ready.
  39. * Call only while named readiness is false. A failed first commit withdraws the target and does
  40. * not restore an earlier ready catalog.
  41. * @return True when the catalog is nonempty and any needed cache write succeeds.
  42. */
  43. [[nodiscard]] bool publish_named_catalog() noexcept;
  44. /** @return True when the whole item definition table is in State. */
  45. [[nodiscard]] bool item_definitions_ready() noexcept;
  46. /** @return Dense item-definition row count, read under the lock. */
  47. [[nodiscard]] std::size_t item_definition_count() noexcept;
  48. /**
  49. * Publishes the whole installed-build item definition table in one step.
  50. * Call only while item readiness is false. A failed first commit withdraws the target and does
  51. * not restore an earlier ready table.
  52. * @param definitions Dense native-index mappings extracted from the running client.
  53. * @return True when the mappings pass the checks and any needed cache write succeeds.
  54. */
  55. [[nodiscard]] bool
  56. publish_item_definitions(std::span<const items::Definition> definitions) noexcept;
  57. /**
  58. * Finds one authored item hash inside its expected inventory bucket.
  59. * @param definitionHash Authored item definition hash.
  60. * @param bucketId Expected inventory bucket id.
  61. * @param definition Receives the one matching native definition.
  62. * @return True when the item data is ready and exactly one mapping matches.
  63. */
  64. [[nodiscard]] bool find_item_definition(std::uint32_t definitionHash,
  65. std::uint8_t bucketId,
  66. items::Definition& definition) noexcept;
  67. /**
  68. * Finds an authored base-item or plug hash without storing a native index in settings.
  69. * @param definitionHash Authored item or plug definition hash.
  70. * @param definition Receives the one matching installed-build mapping.
  71. * @return True when the item data is ready and exactly one native row matches.
  72. */
  73. [[nodiscard]] bool find_item_definition_hash(std::uint32_t definitionHash,
  74. items::Definition& definition) noexcept;
  75. /**
  76. * Finds one installed item by the native dense definition index used by Collections requests.
  77. * @param definitionIndex Native item-definition row index.
  78. * @param definition Receives the exact installed mapping.
  79. * @return True when the complete table is ready and contains the requested row.
  80. */
  81. [[nodiscard]] bool find_item_definition_index(std::uint16_t definitionIndex,
  82. items::Definition& definition) noexcept;
  83. /** @return True when the whole dense collectible definition table is in State. */
  84. [[nodiscard]] bool collectible_definitions_ready() noexcept;
  85. /**
  86. * Publishes the installed collectible ordinal-to-item table in one step.
  87. * @param definitions Complete dense rows extracted from the investment root's collectible table.
  88. * @return True when the rows pass the checks and any needed cache write succeeds.
  89. */
  90. [[nodiscard]] bool
  91. publish_collectible_definitions(std::span<const collectibles::Definition> definitions) noexcept;
  92. /**
  93. * Resolves the native 15-bit collectible index carried by a Collections acquire request.
  94. * @param collectibleIndex Native collectible row ordinal.
  95. * @param itemDefinitionIndex Receives the installed item-definition row, or the unavailable
  96. * sentinel on failure.
  97. * @return True when both the complete table and an item link exist for this collectible.
  98. */
  99. [[nodiscard]] bool
  100. find_collectible_item_definition_index(std::uint16_t collectibleIndex,
  101. std::uint16_t& itemDefinitionIndex) noexcept;
  102. /** Finds one complete installed collectible row, including its acquisition material set. */
  103. [[nodiscard]] bool find_collectible_definition(std::uint16_t collectibleIndex,
  104. collectibles::Definition& definition) noexcept;
  105. /** @return True when every installed material-requirement set is available by native ordinal. */
  106. [[nodiscard]] bool material_requirement_sets_ready() noexcept;
  107. /** Publishes the complete dense native material-requirement table. */
  108. [[nodiscard]] bool publish_material_requirement_sets(
  109. std::span<const material_requirements::Definition> definitions) noexcept;
  110. /** Resolves one authored material-requirement set without embedding any prices in code. */
  111. [[nodiscard]] bool
  112. find_material_requirement_set(std::uint16_t requirementSetIndex,
  113. material_requirements::Definition& definition) noexcept;
  114. /** @return True when a complete configured-detail domain, empty or not, is published. */
  115. [[nodiscard]] bool configured_item_details_ready() noexcept;
  116. /**
  117. * Publishes configured item details. An empty domain is a complete one.
  118. * Call only while detail readiness is false. A failed first commit withdraws the target and does
  119. * not restore an earlier ready domain.
  120. * @param definitions Complete installed-build details for configured authored items.
  121. * @return True when the links pass the checks and any needed cache write succeeds.
  122. */
  123. [[nodiscard]] bool
  124. publish_configured_item_details(std::span<const items::details::Definition> definitions) noexcept;
  125. /**
  126. * Finds one configured item detail by native definition index.
  127. * @param definitionIndex Native installed-build item index.
  128. * @param definition Receives the matching configured detail.
  129. * @return True when the detail data is ready and holds that row.
  130. */
  131. [[nodiscard]] bool find_configured_item_detail(std::uint16_t definitionIndex,
  132. items::details::Definition& definition) noexcept;
  133. /** @return True when the exact installed ordinary-socket plug relation is in State. */
  134. [[nodiscard]] bool socket_plug_rules_ready() noexcept;
  135. /**
  136. * Publishes exact per-item, per-lane plug pools extracted from the installed packages.
  137. * @param rules Strictly item/lane-ordered rules.
  138. * @param pools Deduplicated contiguous pool ranges, beginning with the empty pool.
  139. * @param members Flat sorted plug-definition indices.
  140. * @return True when the relation and its item/detail links validate and any cache write succeeds.
  141. */
  142. [[nodiscard]] bool
  143. publish_socket_plug_rules(std::span<const items::socket_plugs::Rule> rules,
  144. std::span<const items::socket_plugs::Pool> pools,
  145. std::span<const items::socket_plugs::Member> members) noexcept;
  146. /**
  147. * Answers whether one installed plug definition is valid for one exact ordinary socket lane.
  148. * Missing or malformed relations fail closed.
  149. */
  150. [[nodiscard]] bool is_socket_plug_allowed(std::uint16_t itemDefinitionIndex,
  151. std::uint8_t lane,
  152. std::uint16_t plugDefinitionIndex) noexcept;
  153. /**
  154. * Walks every plug one exact ordinary socket lane accepts. Missing relations fail closed.
  155. * @return True when the lane has a pool and the visitor saw every member.
  156. */
  157. [[nodiscard]] bool visit_socket_plug_pool(std::uint16_t itemDefinitionIndex,
  158. std::uint8_t lane,
  159. items::socket_plugs::MemberVisitor visitor,
  160. void* context) noexcept;
  161. /** @return True when one plug definition occurs in any installed ordinary-socket plug pool. */
  162. [[nodiscard]] bool is_socket_plug_pooled(std::uint16_t plugDefinitionIndex) noexcept;
  163. /**
  164. * Answers whether one profile definition needs an item-instance resident so the native socket
  165. * action route can materialize it. Only stackable installed socket plugs in the supported mod and
  166. * shader profile buckets qualify; currency/material/intrinsic rows do not.
  167. */
  168. [[nodiscard]] bool is_profile_action_source(std::uint16_t itemDefinitionIndex,
  169. std::uint8_t bucketId) noexcept;
  170. /**
  171. * Answers whether applying one plug spends a stack the account has to hold.
  172. * @param itemDefinitionIndex Installed plug-definition row.
  173. * @param bucketId Installed profile bucket the plug belongs to.
  174. * @return True only for a shader Collections can grant. An ornament stays owned once applied,
  175. * and a socket's default plug belongs to no stack at all.
  176. */
  177. [[nodiscard]] bool is_consumed_on_apply(std::uint16_t itemDefinitionIndex,
  178. std::uint8_t bucketId) noexcept;
  179. /** @return True when the whole progression definition table is in State. */
  180. [[nodiscard]] bool progression_definitions_ready() noexcept;
  181. /**
  182. * Publishes the whole progression definition table in one step.
  183. * @param definitions Dense rows in native definition order.
  184. * @return True when the rows pass the checks and any needed cache write succeeds.
  185. */
  186. [[nodiscard]] bool
  187. publish_progression_definitions(std::span<const progressions::Definition> definitions) noexcept;
  188. /**
  189. * Lists the definition index each slot of one scope's progression array carries.
  190. * @param scope Replicated object owning the array.
  191. * @param output Slot storage, one entry per slot the array holds.
  192. * @param count Receives the number of keyed slots.
  193. * @return True when the table is ready and every keyed slot fits.
  194. */
  195. [[nodiscard]] bool find_progression_slots(progressions::Scope scope,
  196. std::span<std::uint16_t> output,
  197. std::size_t& count) noexcept;
  198. /** @return True when a complete ability bucket domain, empty or not, is published. */
  199. [[nodiscard]] bool ability_buckets_ready() noexcept;
  200. /**
  201. * Publishes the ability buckets every configured subclass and ability selection publishes.
  202. * @param definitions Complete rows, or an empty complete domain.
  203. * @return True when the rows pass the checks and any needed cache write succeeds.
  204. */
  205. [[nodiscard]] bool
  206. publish_ability_buckets(std::span<const abilities::Definition> definitions) noexcept;
  207. /**
  208. * Finds the buckets one subclass publishes under one ability selection.
  209. * @param socketEntryListIndex Native socket-entry-list index of the subclass.
  210. * @param selection The character's 5 selected socket entries.
  211. * @param definition Receives the matching row.
  212. * @return True when the domain is ready and holds that exact key.
  213. */
  214. [[nodiscard]] bool find_ability_buckets(std::uint16_t socketEntryListIndex,
  215. const abilities::Selection& selection,
  216. abilities::Definition& definition) noexcept;
  217. /**
  218. * Drops the published ability bucket domain so the next investment refresh slice rebuilds it.
  219. * A committed subclass ability-entry change makes the published rows stale for their character,
  220. * since they were keyed by the selection in place when the domain was first built.
  221. */
  222. void invalidate_ability_buckets() noexcept;
  223. /**
  224. * @return True when at least one socket-entry list's resolved bucket destinations are published.
  225. * Never part of the on-disk content cache: it is small and cheap to recompute, so a warm boot that
  226. * skips re-extraction must not leave it empty for the whole session.
  227. */
  228. [[nodiscard]] bool socket_entry_buckets_ready() noexcept;
  229. /**
  230. * Publishes every socket-entry list's resolved per-entry ability-bucket destinations.
  231. * A derived cache of static content, so unlike the ability buckets above it never needs
  232. * invalidating: a subclass's entry table does not change after content extraction.
  233. * @param definitions Complete rows, one per socket-entry list that carries a super lane.
  234. * @return True when the rows pass the checks.
  235. */
  236. [[nodiscard]] bool publish_socket_entry_buckets(
  237. std::span<const socket_entry_buckets::Definition> definitions) noexcept;
  238. /**
  239. * Finds which of the 12 semantic ability buckets one socket entry resolves to.
  240. * @param socketEntryListIndex Native socket-entry-list index of the subclass.
  241. * @param entryIndex The entry to look up.
  242. * @param bucket Receives the resolved destination, or the no-destination sentinel.
  243. * @return True when the list's row is published and the entry index is in range.
  244. */
  245. [[nodiscard]] bool find_socket_entry_bucket(std::uint16_t socketEntryListIndex,
  246. std::uint8_t entryIndex,
  247. std::uint8_t& bucket) noexcept;
  248. /** @return True when the installed investment constants are in State. */
  249. [[nodiscard]] bool investment_constants_ready() noexcept;
  250. /**
  251. * Publishes the stat rows read from the installed investment constants blob.
  252. * @param value Constants extracted from the blob.
  253. * @return True when the row is extracted and any needed cache write succeeds.
  254. */
  255. [[nodiscard]] bool
  256. publish_investment_constants(const constants::InvestmentConstants& value) noexcept;
  257. /**
  258. * Reads the published investment constants.
  259. * @param value Receives the published stat rows.
  260. * @return True when the constants are in State.
  261. */
  262. [[nodiscard]] bool find_investment_constants(constants::InvestmentConstants& value) noexcept;
  263. /** @return True when the whole inventory-bucket descriptor table is in State. */
  264. [[nodiscard]] bool inventory_bucket_descriptors_ready() noexcept;
  265. /**
  266. * Publishes the whole inventory-bucket routing table in one step.
  267. * Call only while bucket readiness is false. A failed first commit withdraws the target and does
  268. * not restore an earlier ready table.
  269. * @param descriptors Installed-build bucket descriptors.
  270. * @return True when the descriptors pass the checks and any needed cache write succeeds.
  271. */
  272. [[nodiscard]] bool publish_inventory_bucket_descriptors(
  273. std::span<const inventory::buckets::Descriptor> descriptors) noexcept;
  274. /**
  275. * Finds one inventory-bucket descriptor by native bucket id.
  276. * @param bucketId Native inventory-bucket id.
  277. * @param descriptor Receives the matching routing descriptor.
  278. * @return True when the bucket data is ready and holds that row.
  279. */
  280. [[nodiscard]] bool
  281. find_inventory_bucket_descriptor(std::uint8_t bucketId,
  282. inventory::buckets::Descriptor& descriptor) noexcept;
  283. /** @return True when the whole dense socket-entry-list table is in State. */
  284. [[nodiscard]] bool socket_entry_lists_ready() noexcept;
  285. /** @return Dense socket-entry-list row count, read under the lock. */
  286. [[nodiscard]] std::size_t socket_entry_list_count() noexcept;
  287. /**
  288. * Publishes the whole dense socket-entry-list table in one step.
  289. * Call only while socket-list readiness is false. A failed first commit withdraws the target and
  290. * does not restore an earlier ready table.
  291. * @param definitions Installed-build socket-entry-list definitions.
  292. * @param entryTables Per-entry inputs for the lists that carry a super lane.
  293. * @return True when the rows pass the checks and any needed cache write succeeds.
  294. */
  295. [[nodiscard]] bool
  296. publish_socket_entry_lists(std::span<const socket_entry_lists::Definition> definitions,
  297. std::span<const socket_entry_lists::EntryTable> entryTables) noexcept;
  298. /**
  299. * Finds one list's per-entry selection inputs.
  300. * @param definitionIndex Native socket-entry-list index.
  301. * @param table Receives the matching row.
  302. * @return True when a table is kept for that list.
  303. */
  304. [[nodiscard]] bool find_socket_entry_table(std::uint16_t definitionIndex,
  305. socket_entry_lists::EntryTable& table) noexcept;
  306. /**
  307. * Finds one socket-entry-list definition by native definition index.
  308. * @param definitionIndex Native socket-entry-list index.
  309. * @param definition Receives the matching installed-build row.
  310. * @return True when the socket-list data is ready and holds that row.
  311. */
  312. [[nodiscard]] bool find_socket_entry_list(std::uint16_t definitionIndex,
  313. socket_entry_lists::Definition& definition) noexcept;
  314. /** Number of subclass items every character class ships in this build. */
  315. inline constexpr std::size_t kSubclassGroupSize = 3;
  316. /**
  317. * Finds the 2 other subclasses that share one character class with a known member.
  318. * The installed manifest lists every subclass item as one dense run per class, in native
  319. * definition-index order, so the run holding a known member gives every other member.
  320. * @param memberDefinitionIndex Native item-definition index of one subclass in the class.
  321. * @param group Receives the 3 member indices, in native definition-index order.
  322. * @return True when every subclass item was found and `memberDefinitionIndex` is one of them.
  323. */
  324. [[nodiscard]] bool
  325. find_subclass_group(std::uint16_t memberDefinitionIndex,
  326. std::array<std::uint16_t, kSubclassGroupSize>& group) noexcept;
  327. /** @return True when a complete destination-layout domain, empty or not, is published. */
  328. [[nodiscard]] bool scenario_layouts_ready() noexcept;
  329. /**
  330. * Publishes the extracted destination layouts and their roster groups in one step.
  331. * @param definitions Complete rows swept from the installed packages.
  332. * @param groups Complete roster groups the same sweep reached.
  333. * @return True when the rows pass the checks and any needed cache write succeeds.
  334. */
  335. [[nodiscard]] bool
  336. publish_scenario_layouts(std::span<const scenarios::Definition> definitions,
  337. std::span<const scenarios::RosterGroup> groups) noexcept;
  338. /**
  339. * Copies one roster group by the table index a destination row carries.
  340. * @param index Roster table index.
  341. * @param group Receives the group.
  342. * @return True when the domain is ready and the index is inside its table.
  343. */
  344. [[nodiscard]] bool find_roster_group(std::size_t index, scenarios::RosterGroup& group) noexcept;
  345. /** @return Number of published destination layouts, read under the lock. */
  346. [[nodiscard]] std::size_t scenario_layout_count() noexcept;
  347. /**
  348. * Copies every published destination layout.
  349. * @param output Caller-owned fixed row storage.
  350. * @param count Receives the copied row count.
  351. * @return True when the domain is ready and output can hold every row.
  352. */
  353. [[nodiscard]] bool snapshot_scenario_layouts(std::span<scenarios::Definition> output,
  354. std::size_t& count) noexcept;
  355. /** @return True when a complete bubble-name table, empty or not, is published. */
  356. [[nodiscard]] bool hash_names_ready() noexcept;
  357. /**
  358. * Publishes the resolved bubble names in one step.
  359. * @param names Complete rows in ascending hash order, or an empty complete table.
  360. * @return True when the rows pass the checks and any needed cache write succeeds.
  361. */
  362. [[nodiscard]] bool publish_hash_names(std::span<const hash_names::Name> names) noexcept;
  363. /**
  364. * Finds one bubble's internal name by its hash.
  365. * @param hash Bubble name hash from a destination layout.
  366. * @param name Receives the matching row.
  367. * @return True when the table is ready and holds that exact hash.
  368. */
  369. [[nodiscard]] bool find_hash_name(std::uint32_t hash, hash_names::Name& name) noexcept;
  370. /** @return True when a complete spawn-set catalog, empty or not, is published. */
  371. [[nodiscard]] bool spawn_sets_ready() noexcept;
  372. /**
  373. * Publishes the spawn-set catalog extracted from the installed packages, in one step.
  374. * @param stems Complete stem rows in ascending name order, or an empty complete catalog.
  375. * @param nameHashes Complete flat bank in stem then hash order.
  376. * @param points Complete point bank in extraction order, which may be empty.
  377. * @return True when the rows pass the checks and any needed cache write succeeds.
  378. */
  379. [[nodiscard]] bool publish_spawn_sets(std::span<const spawn_sets::Stem> stems,
  380. std::span<const spawn_sets::NameHash> nameHashes,
  381. std::span<const spawn_sets::Point> points) noexcept;
  382. /**
  383. * Finds the spawn point of one map-package stem nearest a world position.
  384. * @param stem Normalized stem a destination row carries.
  385. * @param position World position to measure from.
  386. * @param point Receives the nearest point and the set it belongs to.
  387. * @param distance Receives the distance to it, in world units.
  388. * @return True when the catalog is ready, holds the stem, and the stem owns a point.
  389. */
  390. [[nodiscard]] bool
  391. find_nearest_spawn_point(std::string_view stem,
  392. const std::array<float, spawn_sets::kPositionComponents>& position,
  393. spawn_sets::Point& point,
  394. float& distance) noexcept;
  395. /**
  396. * Copies the whole flat spawn-name hash bank.
  397. * @param output Caller-owned fixed row storage.
  398. * @param count Receives the copied row count.
  399. * @return True when the catalog is ready and output can hold every row.
  400. */
  401. [[nodiscard]] bool snapshot_spawn_name_hashes(std::span<spawn_sets::NameHash> output,
  402. std::size_t& count) noexcept;
  403. /**
  404. * Finds the spawn sets one map-package stem declares.
  405. * @param stem Normalized stem a destination row carries.
  406. * @param output Caller-owned fixed row storage.
  407. * @param count Receives the copied row count.
  408. * @return True when the catalog is ready, holds the stem, and the range fits.
  409. */
  410. [[nodiscard]] bool find_spawn_sets(std::string_view stem,
  411. std::span<spawn_sets::NameHash> output,
  412. std::size_t& count) noexcept;
  413. /**
  414. * Finds one destination's bubble layout by package name.
  415. * @param name Package name the client's selection carried.
  416. * @param definition Receives the matching row.
  417. * @return True when the domain is ready and holds that exact name.
  418. */
  419. [[nodiscard]] bool find_scenario_layout(std::string_view name,
  420. scenarios::Definition& definition) noexcept;
  421. /** @return True when the installed vendor index is in State. */
  422. [[nodiscard]] bool vendor_catalog_ready() noexcept;
  423. /**
  424. * Publishes the vendor index and every extracted vendor definition in one step.
  425. * @param index Complete index rows in ascending index order.
  426. * @param definitions Extracted definitions in ascending index order, which may be empty.
  427. * @param saleRows Complete flat sale bank in definition then row order.
  428. * @param installedRows Complete flat installed bank in definition then row order.
  429. * @return True when the rows pass the checks and any needed cache write succeeds.
  430. */
  431. [[nodiscard]] bool
  432. publish_vendor_catalog(std::span<const vendors::IndexEntry> index,
  433. std::span<const vendors::Definition> definitions,
  434. std::span<const vendors::SaleRow> saleRows,
  435. std::span<const vendors::InstalledRow> installedRows) noexcept;
  436. /**
  437. * Finds one vendor's index row, which carries the index the wire uses.
  438. * @param definitionHash Vendor definition hash.
  439. * @param entry Receives the matching row.
  440. * @return True when the catalog is ready and exactly one row carries the hash.
  441. */
  442. [[nodiscard]] bool find_vendor_index(std::uint32_t definitionHash,
  443. vendors::IndexEntry& entry) noexcept;
  444. /**
  445. * Finds one extracted vendor definition.
  446. * @param definitionHash Vendor definition hash.
  447. * @param definition Receives the matching definition.
  448. * @return True when the catalog is ready and holds that definition.
  449. */
  450. [[nodiscard]] bool find_vendor_definition(std::uint32_t definitionHash,
  451. vendors::Definition& definition) noexcept;
  452. /** @return True only when every domain is ready and any needed cache write succeeds. */
  453. [[nodiscard]] bool persist() noexcept;
  454. } // namespace sunrise::state::build_data