Skip to content

Commit 9c00098

Browse files
committed
Remove unnecessary include
1 parent 3f8eda5 commit 9c00098

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/Callback.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
// Local includes.
55
#include "Configuration.h"
6-
#include "Container.h"
76

87
// Library includes.
98
#include <ArduinoJson.h>
@@ -17,22 +16,24 @@
1716
/// @brief Container signature, makes it possible to use the Container name everywhere instead of having to differentiate between C++ STL support or not
1817
template<typename T>
1918
using Container = std::vector<T>;
19+
#else
20+
#include "Container.h"
2021
#endif // THINGSBOARD_ENABLE_STL && THINGSBOARD_ENABLE_DYNAMIC
2122

2223

2324
/// @brief General purpose safe callback wrapper. Expects either c-style or c++ style function pointer,
2425
/// depending on if the C++ STL has been implemented on the given device or not.
2526
/// Simply wraps that function pointer and before calling it ensures it is valid
26-
/// @tparam return_typ Type the given callback method should return
27+
/// @tparam return_type Type the given callback method should return
2728
/// @tparam argument_types Types the given callback method should receive
28-
template<typename return_typ, typename... argument_types>
29+
template<typename return_type, typename... argument_types>
2930
class Callback {
3031
public:
3132
/// @brief Callback signature
3233
#if THINGSBOARD_ENABLE_STL
33-
using function = std::function<return_typ(argument_types... arguments)>;
34+
using function = std::function<return_type(argument_types... arguments)>;
3435
#else
35-
using function = return_typ (*)(argument_types... arguments);
36+
using function = return_type (*)(argument_types... arguments);
3637
#endif // THINGSBOARD_ENABLE_STL
3738

3839
/// @brief Constructs empty callback, will result in never being called. Internals are simply default constructed as nullptr
@@ -58,9 +59,9 @@ class Callback {
5859
/// @param ...arguments Optional additional arguments that are simply formwarded to the subscribed callback if it exists
5960
/// @return Argument returned by the previously subscribed callback or if none or nullptr is subscribed
6061
/// we instead return a defaulted instance of the requested return variable
61-
return_typ Call_Callback(argument_types const &... arguments) const {
62+
return_type Call_Callback(argument_types const &... arguments) const {
6263
if (!m_callback) {
63-
return return_typ();
64+
return return_type();
6465
}
6566
return m_callback(arguments...);
6667
}

0 commit comments

Comments
 (0)