8#include <ArduinoJson.h>
9#if THINGSBOARD_ENABLE_STL
15#if THINGSBOARD_ENABLE_STL && THINGSBOARD_ENABLE_DYNAMIC
29template<
typename return_type,
typename... argument_types>
33#if THINGSBOARD_ENABLE_STL
34 using function = std::function<return_type(argument_types... arguments)>;
36 using function = return_type (*)(argument_types... arguments);
46 : m_callback(callback)
66 return m_callback(arguments...);
73 m_callback = callback;
General purpose safe callback wrapper. Expects either c-style or c++ style function pointer,...
Definition: Callback.h:30
virtual ~Callback()=default
Virtual default destructor, created to ensure that if a pointer to this class is used and deleted,...
Callback(function callback)
Constructor.
Definition: Callback.h:45
std::function< return_type(argument_types... arguments)> function
Callback signature.
Definition: Callback.h:34
void Set_Callback(function callback)
Sets the callback method that will be called upon data arrival with the given data that was received....
Definition: Callback.h:72
return_type Call_Callback(argument_types const &... arguments) const
Calls the callback that was subscribed, when this class instance was initally created.
Definition: Callback.h:62
Callback()=default
Constructs empty callback, will result in never being called. Internals are simply default constructe...
Custom std::array or std::vector implementation that contains a partial vector-like interface impleme...
Definition: Container.h:29