| 525 | using BeforeModuleDestroyCallback = void(const LinkedStoreKey &Key, |
| 526 | const ModuleInstance *Mod); |
| 527 | void linkStore(StoreManager *Store, std::string_view Name, |
| 528 | BeforeModuleDestroyCallback Callback) { |
| 529 | // Link to the store during registration. |
| 530 | std::unique_lock Lock(Mutex); |
| 531 | LinkedStore.insert_or_assign(LinkedStoreKey{Store, std::string(Name)}, |
| 532 | Callback); |
| 533 | } |
| 534 | |
| 535 | void unlinkStore(StoreManager *Store, std::string_view Name) { |
| 536 | // Unlink a specific (Store, Name) entry. |