Radium Engine  1.5.20
Loading...
Searching...
No Matches
VariableSetEnumManagement.cpp
1#include <Core/Containers/VariableSetEnumManagement.hpp>
2
3namespace Ra {
4namespace Core {
5namespace VariableSetEnumManagement {
6
7void setEnumVariable( VariableSet& vs, const std::string& name, const std::string& value ) {
8 auto converterFunc = vs.existsVariable<
9 std::function<void( Core::VariableSet&, const std::string&, const std::string& )>>( name );
10 if ( converterFunc ) { ( *converterFunc )->second( vs, name, value ); }
11 else {
12 LOG( Core::Utils::logWARNING ) << "VariableSet: try to set enum value from string without "
13 "converter, ignored. Variable name: ["
14 << name << "], value: [" << value << "]";
15 }
16}
17
18void setEnumVariable( VariableSet& vs, const std::string& name, const char* value ) {
19 setEnumVariable( vs, name, std::string( value ) );
20}
21
22} // namespace VariableSetEnumManagement
23} // namespace Core
24} // namespace Ra
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3