26#include "quill/LogMacros.h"
34#define STRINGIFY(x) #x
35#define TOSTRING(x) STRINGIFY(x)
39 const std::string defaultDataDir =
TOSTRING(DATA_DIR);
42 const std::string indexFilePath =
m_dataDir +
"/index.yaml";
44 const std::filesystem::path indexFile(indexFilePath);
62 throw std::runtime_error(
"Resource " + name +
" not found");
73 const std::filesystem::path resourceFile(resourcePath);
74 if (!std::filesystem::exists(resourceFile)) {
75 LOG_ERROR(
m_logger,
"Resource file not found: {}", resourceFile.string());
78 LOG_INFO(
m_logger,
"Loading resource: {}", resourceFile.string());
80 LOG_INFO(
m_logger,
"Resource already loaded: {}", name);
serif::config::Config & m_config
const types::Resource & getResource(const std::string &name) const
Gets a resource by name.
serif::config::Config m_resourceConfig
ResourceManager()
Private constructor to prevent instantiation.
std::unordered_map< std::string, types::Resource > m_resources
std::vector< std::string > getAvailableResources() const
Gets a list of available resources.
bool load(const std::string &name)
Loads a resource by name.
bool loadResource(std::string &name)
Loads a resource by name.
Defines a macro for triggering a breakpoint in different compilers and platforms.
Resource createResource(const std::string &type, const std::string &path)
Creates a resource based on the specified type and path.
std::variant< std::unique_ptr< opat::OPAT >, std::unique_ptr< serif::mesh::MeshIO >, std::unique_ptr< serif::eos::EOSio > > Resource
A variant type that can hold different types of resources.
Defines types and functions for managing resources.