summaryrefslogtreecommitdiff
path: root/src/components/include/utils/callable.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/include/utils/callable.h')
-rw-r--r--src/components/include/utils/callable.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/components/include/utils/callable.h b/src/components/include/utils/callable.h
new file mode 100644
index 0000000000..aff91814bf
--- /dev/null
+++ b/src/components/include/utils/callable.h
@@ -0,0 +1,26 @@
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_CALLABLE_H
+#define SRC_COMPONENTS_INCLUDE_UTILS_CALLABLE_H
+
+#include "utils/macro.h"
+
+namespace utils {
+/**
+ * @brief The Callable class allows
+ * to create functor to call in other context
+ */
+class Callable {
+ public:
+ virtual void operator()() const = 0;
+ virtual ~Callable() {}
+};
+
+/**
+ * @brief The CallNothing class functior that to nothing
+ */
+class CallNothing : public Callable {
+ // Callable interface
+ public:
+ void operator()() const OVERRIDE {}
+};
+} // namespace utils
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_CALLABLE_H