1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-07-06 08:11:35 +00:00
openmw/components/settings/values.hpp
elsid 3bad40153c
Define typed settings storage with single time initialization
To make sure loaded settings have valid values doing the check once per loading.
And to make access more efficient.
2023-03-28 20:47:34 +02:00

33 lines
536 B
C++

#ifndef OPENMW_COMPONENTS_SETTINGS_VALUES_H
#define OPENMW_COMPONENTS_SETTINGS_VALUES_H
#include "sanitizerimpl.hpp"
#include "settingvalue.hpp"
namespace Settings
{
class Values
{
public:
static void init();
private:
static Values* sValues;
friend const Values& values();
friend Values& valuesMutable();
};
inline const Values& values()
{
return *Values::sValues;
}
inline Values& valuesMutable()
{
return *Values::sValues;
}
}
#endif