From 67dfb39e9baaef05c0828c145b98775cc08749c4 Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Tue, 15 Oct 2024 19:49:26 +0300 Subject: [PATCH] Remove the default ConfigSchema --- src/sensesp/ui/config_item.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/sensesp/ui/config_item.h b/src/sensesp/ui/config_item.h index 028c530c8..172451773 100644 --- a/src/sensesp/ui/config_item.h +++ b/src/sensesp/ui/config_item.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "Arduino.h" #include "ArduinoJson.h" @@ -33,23 +34,20 @@ template <> const char* get_schema_type_string(const bool dummy); /** - * @brief Template function to provide a configuration schema for a - * ConfigItemT. + * @brief Provide a configuration schema for a + * ConfigItemT. + * + * For this to work, an overload or a specialization of this function must + * be provided for each type T that is used in a ConfigItemT. * * @tparam T * @param obj * @return const char* */ -template -const String ConfigSchema(const T& obj) { +inline const String ConfigSchema(const std::nullptr_t& obj) { return "null"; } -template -const String ConfigSchema(const std::shared_ptr& obj) { - return ConfigSchema(*obj); -} - template bool ConfigRequiresRestart(const T& obj) { return false; @@ -271,7 +269,6 @@ class ConfigItemT : public ConfigItemBase { String schema = ConfigSchema(*config_object_); return schema; } - }; /**