4#ifndef MALENA_CONFIGMANAGER_H
5#define MALENA_CONFIGMANAGER_H
16 template<
typename T,
typename =
void>
17 struct has_Strings : std::false_type {};
19 struct has_Strings<T, std::void_t<typename T::Text>> : std::true_type {};
22 template<
typename T,
typename =
void>
23 struct has_Ints : std::false_type {};
25 struct has_Ints<T, std::void_t<typename T::Ints>> : std::true_type {};
28 template<
typename T,
typename =
void>
29 struct has_Floats : std::false_type {};
31 struct has_Floats<T, std::void_t<typename T::Floats>> : std::true_type {};
34 template<
typename T,
typename =
void>
35 struct has_Booleans : std::false_type {};
37 struct has_Booleans<T, std::void_t<typename T::Floats>> : std::true_type {};
91 template<
typename Manifest>
111 template<
typename M = Manifest>
112 static std::enable_if_t<has_Strings<M>::value,
const std::string&>
113 get(
typename M::Text config);
123 template<
typename M = Manifest>
124 static std::enable_if_t<has_Ints<M>::value,
int>
125 get(
typename M::Integers config);
135 template<
typename M = Manifest>
136 static std::enable_if_t<has_Floats<M>::value,
float>
137 get(
typename M::Floats config);
147 template<
typename M = Manifest>
148 static std::enable_if_t<has_Booleans<M>::value,
bool>
149 get(
typename M::Booleans config);
154#include "../../../src/Resources/ConfigManager.tpp"
Manifest-driven accessor for typed configuration values.
static std::enable_if_t< has_Floats< M >::value, float > get(typename M::Floats config)
Retrieve a float config value.
static std::enable_if_t< has_Ints< M >::value, int > get(typename M::Integers config)
Retrieve an integer config value.
static void ensureInitialized()
Ensure the manifest's config values have been registered.
static std::enable_if_t< has_Booleans< M >::value, bool > get(typename M::Booleans config)
Retrieve a boolean config value.
static std::enable_if_t< has_Strings< M >::value, const std::string & > get(typename M::Text config)
Retrieve a string config value.