esp::core::config namespace

Configuration functionality.

Classes

class Configuration
This class holds configuration data in a map of ConfigValues, and also supports nested configurations via a map of smart pointers to this type.
class ConfigValue
This class uses an anonymous tagged union to store values of different types, as well as providing access to the values in a type safe manner.

Enums

enum class ConfigValType { Unknown = ID_UNDEFINED, Boolean, Integer, MagnumRad, Double, MagnumVec2, _storedAsAPointer, MagnumVec3 = _storedAsAPointer, MagnumVec4, MagnumQuat, MagnumMat3, MagnumMat4, _nonTrivialTypes, String = _nonTrivialTypes }
This enum lists every type of value that can be currently stored directly in an esp::core::config::Configuration. All supported types should have entries in this enum class. All pointer-backed types (i.e. data larger than ConfigValue::_data array sizee) should have their enums placed after _storedAsAPointer tag. All non-trivial types should have their enums placed below _nonTrivialTypes tag. Any small, trivially copyable types should be placed before _storedAsAPointer tag.

Functions

void initConfigBindings(pybind11::module& m)
Specify bindings for esp::core::config::Configuration.
auto getNameForStoredType(const ConfigValType& value) -> std::string
Retrieve a string description of the passed ConfigValType enum value.
auto isConfigValTypePointerBased(ConfigValType type) -> bool constexpr
Quick check to see if type is stored as a pointer in the data or not (i.e. the type is trivially copyable or not)
auto isConfigValTypeNonTrivial(ConfigValType type) -> bool constexpr
Quick check to see if type is trivially copyable or not.
template<typename T>
auto configValTypeFor() -> ConfigValType constexpr
Function template to return type enum for specified type. All supported types should have a specialization of this function handling their type to ConfigValType enum tags mapping.
template<>
auto configValTypeFor<bool>() -> ConfigValType constexpr
Returns ConfigValType::Boolean type enum for specified type.
template<>
auto configValTypeFor<int>() -> ConfigValType constexpr
Returns ConfigValType::Integer type enum for specified type.
template<>
auto configValTypeFor<double>() -> ConfigValType constexpr
Returns ConfigValType::Double type enum for specified type.
template<>
auto configValTypeFor<Mn::Vector2>() -> ConfigValType constexpr
Returns ConfigValType::MagnumVec2 type enum for specified type.
template<>
auto configValTypeFor<Mn::Vector3>() -> ConfigValType constexpr
Returns ConfigValType::MagnumVec3 type enum for specified type.
template<>
auto configValTypeFor<Mn::Color3>() -> ConfigValType constexpr
Returns ConfigValType::MagnumVec3 type enum for specified type.
template<>
auto configValTypeFor<Mn::Vector4>() -> ConfigValType constexpr
Returns ConfigValType::MagnumVec4 type enum for specified type.
template<>
auto configValTypeFor<Mn::Color4>() -> ConfigValType constexpr
Returns ConfigValType::MagnumVec4 type enum for specified type.
template<>
auto configValTypeFor<Mn::Matrix3>() -> ConfigValType constexpr
Returns ConfigValType::MagnumMat3 type enum for specified type.
template<>
auto configValTypeFor<Mn::Matrix4>() -> ConfigValType constexpr
Returns ConfigValType::MagnumMat4 type enum for specified type.
template<>
auto configValTypeFor<Mn::Quaternion>() -> ConfigValType constexpr
Returns ConfigValType::MagnumQuat type enum for specified type.
template<>
auto configValTypeFor<Mn::Rad>() -> ConfigValType constexpr
Returns ConfigValType::MagnumRad type enum for specified type.
auto operator<<(Mn::Debug& debug, const ConfigValType& value) -> MAGNUM_EXPORT Mn::Debug&
Stream operator to support display of ConfigValType enum tags.
auto operator<<(Mn::Debug& debug, const ConfigValue& value) -> MAGNUM_EXPORT Mn::Debug&
provide debug stream support for ConfigValue
auto operator<<(Mn::Debug& debug, const Configuration& value) -> MAGNUM_EXPORT Mn::Debug&
provide debug stream support for a Configuration

Variables

int CONFIG_VAL_SIZE constexpr

Enum documentation

enum class esp::core::config::ConfigValType

This enum lists every type of value that can be currently stored directly in an esp::core::config::Configuration. All supported types should have entries in this enum class. All pointer-backed types (i.e. data larger than ConfigValue::_data array sizee) should have their enums placed after _storedAsAPointer tag. All non-trivial types should have their enums placed below _nonTrivialTypes tag. Any small, trivially copyable types should be placed before _storedAsAPointer tag.

Enumerators
Unknown

Unknown type.

Boolean

boolean type

Integer

integer type

MagnumRad

Magnum::Rad angle type.

Double

double type

MagnumVec2

Magnum::Vector2 type.

_storedAsAPointer

MagnumVec3

Magnum::Vector3 type. All types of size greater than _data size must be placed after this marker, either before or after String, depending on if they are trivially copyable or not.

MagnumVec4

Magnum::Vector4 type.

MagnumQuat

Magnum::Quaternion type.

MagnumMat3

Magnum::Matrix3 (3x3) type.

MagnumMat4

Magnum::Matrix4 (4x4) type.

_nonTrivialTypes

String

All enum values of nontrivial types must be added after String .

Function documentation

void esp::core::config::initConfigBindings(pybind11::module& m)

Specify bindings for esp::core::config::Configuration.

std::string esp::core::config::getNameForStoredType(const ConfigValType& value)

Retrieve a string description of the passed ConfigValType enum value.

bool esp::core::config::isConfigValTypePointerBased(ConfigValType type) constexpr

Quick check to see if type is stored as a pointer in the data or not (i.e. the type is trivially copyable or not)

bool esp::core::config::isConfigValTypeNonTrivial(ConfigValType type) constexpr

Quick check to see if type is trivially copyable or not.

template<typename T>
ConfigValType esp::core::config::configValTypeFor() constexpr

Function template to return type enum for specified type. All supported types should have a specialization of this function handling their type to ConfigValType enum tags mapping.

template<>
ConfigValType esp::core::config::configValTypeFor<bool>() constexpr

Returns ConfigValType::Boolean type enum for specified type.

template<>
ConfigValType esp::core::config::configValTypeFor<int>() constexpr

Returns ConfigValType::Integer type enum for specified type.

template<>
ConfigValType esp::core::config::configValTypeFor<double>() constexpr

Returns ConfigValType::Double type enum for specified type.

template<>
ConfigValType esp::core::config::configValTypeFor<Mn::Vector2>() constexpr

Returns ConfigValType::MagnumVec2 type enum for specified type.

template<>
ConfigValType esp::core::config::configValTypeFor<Mn::Vector3>() constexpr

Returns ConfigValType::MagnumVec3 type enum for specified type.

template<>
ConfigValType esp::core::config::configValTypeFor<Mn::Color3>() constexpr

Returns ConfigValType::MagnumVec3 type enum for specified type.

template<>
ConfigValType esp::core::config::configValTypeFor<Mn::Vector4>() constexpr

Returns ConfigValType::MagnumVec4 type enum for specified type.

template<>
ConfigValType esp::core::config::configValTypeFor<Mn::Color4>() constexpr

Returns ConfigValType::MagnumVec4 type enum for specified type.

template<>
ConfigValType esp::core::config::configValTypeFor<Mn::Matrix3>() constexpr

Returns ConfigValType::MagnumMat3 type enum for specified type.

template<>
ConfigValType esp::core::config::configValTypeFor<Mn::Matrix4>() constexpr

Returns ConfigValType::MagnumMat4 type enum for specified type.

template<>
ConfigValType esp::core::config::configValTypeFor<Mn::Quaternion>() constexpr

Returns ConfigValType::MagnumQuat type enum for specified type.

template<>
ConfigValType esp::core::config::configValTypeFor<Mn::Rad>() constexpr

Returns ConfigValType::MagnumRad type enum for specified type.

MAGNUM_EXPORT Mn::Debug& esp::core::config::operator<<(Mn::Debug& debug, const ConfigValType& value)

Stream operator to support display of ConfigValType enum tags.

MAGNUM_EXPORT Mn::Debug& esp::core::config::operator<<(Mn::Debug& debug, const ConfigValue& value)

provide debug stream support for ConfigValue

MAGNUM_EXPORT Mn::Debug& esp::core::config::operator<<(Mn::Debug& debug, const Configuration& value)

provide debug stream support for a Configuration

Variable documentation

int esp::core::config::CONFIG_VAL_SIZE constexpr