mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 07:00:17 +08:00
Check if storage registry exists
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
524d945e8c
commit
b2c26dde65
@@ -98,6 +98,8 @@ class FileStorage : public Storage {
|
||||
};
|
||||
|
||||
struct EmbeddedStorageRegistry {
|
||||
inline static bool exists = false;
|
||||
|
||||
static EmbeddedStorageRegistry &getInstance() {
|
||||
static EmbeddedStorageRegistry gsr;
|
||||
return gsr;
|
||||
@@ -109,6 +111,13 @@ struct EmbeddedStorageRegistry {
|
||||
|
||||
const BuiltinResourceT *get(const std::string &name) const;
|
||||
|
||||
EmbeddedStorageRegistry() {
|
||||
exists = true;
|
||||
}
|
||||
~EmbeddedStorageRegistry() {
|
||||
exists = false;
|
||||
}
|
||||
|
||||
private:
|
||||
using ResourcesContainer = std::unordered_map<std::string, BuiltinResourceT>;
|
||||
ResourcesContainer resources;
|
||||
|
||||
Reference in New Issue
Block a user