15 #ifndef ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_SETTINGCALLBACKADAPTER_H_ 16 #define ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_SETTINGCALLBACKADAPTER_H_ 32 template <
typename ManagerT>
74 template <
typename ManagerT,
size_t id>
77 ,
public ManagerT::template ObserverType<id>
78 ,
public std::enable_shared_from_this<SettingCallbackAdapter<ManagerT, id>> {
84 using FunctionType = std::function<void(const ValueType&, SettingNotifications)>;
91 static std::shared_ptr<SettingCallbackAdapter> create(
FunctionType callback);
120 template <
typename ManagerT,
size_t id>
124 m_callback(value, notification);
127 template <
typename ManagerT,
size_t id>
131 template <
typename ManagerT,
size_t id>
134 return manager.template addObserver<id>(this->shared_from_this());
137 template <
typename ManagerT,
size_t id>
140 return manager.template removeObserver<id>(this->shared_from_this());
143 template <
typename ManagerT,
size_t id>
147 return std::shared_ptr<SettingCallbackAdapter<ManagerT, id>>(
156 #endif // ALEXA_CLIENT_SDK_SETTINGS_INCLUDE_SETTINGS_SETTINGCALLBACKADAPTER_H_ typename ManagerT::template ValueType< id > ValueType
Setting value type.
Definition: SettingCallbackAdapter.h:81
virtual void removeFromManager(ManagerT &manager)=0
static std::shared_ptr< SettingCallbackAdapter > create(FunctionType callback)
Definition: SettingCallbackAdapter.h:144
Definition: SettingCallbackAdapter.h:75
Definition: SettingCallbackAdapter.h:33
void removeFromManager(ManagerT &manager) override
Definition: SettingCallbackAdapter.h:138
bool addToManager(ManagerT &manager) override
Definition: SettingCallbackAdapter.h:132
std::function< void(const ValueType &, SettingNotifications)> FunctionType
Callback function value type.
Definition: SettingCallbackAdapter.h:84
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
SettingNotifications
Definition: SettingObserverInterface.h:28
virtual ~SettingCallbackAdapterInterface()=default
virtual bool addToManager(ManagerT &manager)=0