runtime.h 25 KB

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