1#ifndef Attribute_Request_Callback_h
2#define Attribute_Request_Callback_h
6#if !THINGSBOARD_ENABLE_DYNAMIC
19#if !THINGSBOARD_ENABLE_DYNAMIC
23template <
size_t MaxAttributes = DEFAULT_ATTRIBUTES_AMOUNT>
26#if THINGSBOARD_ENABLE_DYNAMIC
55 template<
typename... Args>
58 , m_attributes(args...)
60 , m_attribute_key(nullptr)
61 , m_request_timeout(timeout_microseconds, timeout_callback)
81 m_request_id = request_id;
88 return m_attribute_key;
99 m_attribute_key = attribute_key;
123 template<
typename... Args>
125 m_attributes.
assign(args...);
133 return m_request_timeout;
137 CString_Container m_attributes = {};
138 size_t m_request_id = {};
139 char const *m_attribute_key = {};
Client-side or shared attributes request callback wrapper, contains the needed configuration settings...
Definition: Attribute_Request_Callback.h:25
void Set_Request_ID(size_t const &request_id)
Sets the unique request identifier that is connected to the original request.
Definition: Attribute_Request_Callback.h:80
Timeoutable_Request & Get_Request_Timeout()
Gets the request timeout callback.
Definition: Attribute_Request_Callback.h:132
CString_Container const & Get_Attributes() const
Gets all the requested client-side or shared attributes, that will be transformed into the necessary ...
Definition: Attribute_Request_Callback.h:106
Attribute_Request_Callback()=default
Constructs empty callback, will result in never being called. Internals are simply default constructe...
size_t const & Get_Request_ID() const
Gets the unique request identifier that is connected to the original request.
Definition: Attribute_Request_Callback.h:71
void Set_Attribute_Key(char const *attribute_key)
Sets the response key of the json array key-value pair, that we expect the client-side or shared attr...
Definition: Attribute_Request_Callback.h:98
void Set_Attributes(Args const &... args)
Sets all the requested client-side or shared attributes, that will be transformed into the necessary ...
Definition: Attribute_Request_Callback.h:124
Attribute_Request_Callback(function callback, uint64_t const &timeout_microseconds=0U, Callback_Watchdog::function timeout_callback=nullptr, Args const &... args)
Constructs callback, will be called upon client-side or shared attribute request arrival where the gi...
Definition: Attribute_Request_Callback.h:56
~Attribute_Request_Callback() override=default
char const * Get_Attribute_Key() const
Gets the response key of the json array key-value pair, that we expect the client-side or shared attr...
Definition: Attribute_Request_Callback.h:87
General purpose safe callback wrapper. Expects either c-style or c++ style function pointer,...
Definition: Callback.h:30
std::function< void(argument_types... arguments)> function
Callback signature.
Definition: Callback.h:34
Custom std::array or std::vector implementation that contains a partial vector-like interface impleme...
Definition: Container.h:29
void assign(InputIterator const &first, InputIterator const &last)
Copies all elements from the given start to exclusively the given end iterator into the underlying da...
Definition: Container.h:129
General purpose request callback that can timeout if the response to the request is not received in t...
Definition: Timeoutable_Request.h:10