16 #ifndef ALEXA_CLIENT_SDK_CAPABILITYAGENTS_SYSTEM_INCLUDE_SYSTEM_STATEREPORTGENERATOR_H_ 17 #define ALEXA_CLIENT_SDK_CAPABILITYAGENTS_SYSTEM_INCLUDE_SYSTEM_STATEREPORTGENERATOR_H_ 30 namespace capabilityAgents {
42 template <
class SettingsManagerT>
54 template <
class SettingsManagerT>
56 std::shared_ptr<SettingsManagerT> settingManager,
86 template <
class SettingsManagerT, ssize_t
index = SettingsManagerT::NUMBER_OF_SETTINGS - 1>
87 struct StringFunctionWrapper {
96 const std::shared_ptr<SettingsManagerT>& manager,
98 std::vector<std::function<
std::string()>>& reportFunctions);
106 template <
class SettingsManagerT>
107 struct StringFunctionWrapper<SettingsManagerT, -1> {
116 const std::shared_ptr<SettingsManagerT>& manager,
118 std::vector<std::function<
std::string()>>& reportFunctions);
133 std::vector<std::function<std::string()>> m_reportFunctions;
136 template <
class SettingsManagerT>
138 std::shared_ptr<SettingsManagerT> manager,
145 std::vector<std::function<std::string()>> reportFunctions;
146 StringFunctionWrapper<SettingsManagerT> wrapper;
147 wrapper(manager, configurations, reportFunctions);
151 template <
class SettingsManagerT, s
size_t index>
152 void StateReportGenerator::StringFunctionWrapper<SettingsManagerT, index>::operator()(
153 const std::shared_ptr<SettingsManagerT>& settingsManager,
155 std::vector<std::function<
std::string()>>& reportFunctions) {
156 if (std::get<index>(configurations).metadata.hasValue()) {
157 auto metadata = std::get<index>(configurations).metadata.
value();
158 reportFunctions.push_back([settingsManager, metadata] {
159 return generateSettingStateReport(metadata, settingsManager->template getJsonValue<index>());
163 StringFunctionWrapper<SettingsManagerT, index - 1> wrapper;
164 wrapper(settingsManager, configurations, reportFunctions);
167 template <
class SettingsManagerT>
168 void StateReportGenerator::StringFunctionWrapper<SettingsManagerT, -1>::operator()(
169 const std::shared_ptr<SettingsManagerT>& settingsManager,
171 std::vector<std::function<
std::string()>>& reportFunctions) {
179 #endif // ALEXA_CLIENT_SDK_CAPABILITYAGENTS_SYSTEM_INCLUDE_SYSTEM_STATEREPORTGENERATOR_H_ std::vector< std::string > generateReport()
::std::string string
Definition: gtest-port.h:1097
typename settings::SettingsManagerBuilderBase< SettingsManagerT >::SettingConfigurations SettingConfigurations
Definition: StateReportGenerator.h:44
Definition: SettingsManagerBuilderBase.h:35
static avsCommon::utils::Optional< StateReportGenerator > create(std::shared_ptr< SettingsManagerT > settingManager, const SettingConfigurations< SettingsManagerT > &configurations)
Definition: StateReportGenerator.h:137
Definition: Optional.h:32
StateReportGenerator()=default
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
void acsdkError(const LogEntry &entry)
ValueT value() const
Definition: Optional.h:208
Definition: StateReportGenerator.h:38
LogEntry is used to compile the log entry text to log via Logger.
Definition: LogEntry.h:33