1 #include <Engine/Data/ShaderConfigFactory.hpp>
5 #include <Core/Utils/Log.hpp>
10 namespace ShaderConfigurationFactory {
12 using namespace Core::Utils;
14 static std::map<std::string, ShaderConfiguration> configs;
17 if ( config.getName().empty() ) {
18 LOG( logWARNING ) <<
"Empty name in ShaderConfigurationFactory::addConfiguration call. "
19 "Configuration not added";
23 auto found = configs.insert( { config.getName(), config } );
24 if ( !found.second ) {
25 LOG( logDEBUG ) <<
"Configuration " << config.getName()
26 <<
" already in ShaderConfigurationFactory. "
27 "Configuration not added";
33 auto found = configs.find( configName );
34 if ( found != configs.end() ) {
35 configs.erase( found );
41 Core::Utils::optional<ShaderConfiguration>
getConfiguration(
const std::string& name ) {
43 LOG( logWARNING ) <<
"Empty name in ShaderConfigurationFactory::getConfiguration call.";
47 auto found = configs.find( name );
48 if ( found != configs.end() ) {
return found->second; }
void addConfiguration(const ShaderConfiguration &config)
Core::Utils::optional< ShaderConfiguration > getConfiguration(const std::string &name)
bool removeConfiguration(const std::string &configName)