summaryrefslogtreecommitdiffhomepage
path: root/include/ocl/core/handler.hpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-30 00:42:50 -0500
committerAmlal El Mahrouss <amlal@nekernel.org>2025-11-30 00:42:50 -0500
commite6579534e7c64be652ffeb74be7c977564a3ddab (patch)
tree69b908f5b2d81f477d3cfe39ecc6c01fbdc89657 /include/ocl/core/handler.hpp
parenta8e99f3a783069cf85b626c6cfb2fbe83ae4fd44 (diff)
chore & feat: final library changes to stabilize changes.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/ocl/core/handler.hpp')
-rw-r--r--include/ocl/core/handler.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/ocl/core/handler.hpp b/include/ocl/core/handler.hpp
new file mode 100644
index 0000000..e31f0d4
--- /dev/null
+++ b/include/ocl/core/handler.hpp
@@ -0,0 +1,42 @@
+/*
+ * File: core/handler.hpp
+ * Purpose: Handler container.
+ * Author: Amlal El Mahrouss (amlal@nekernel.org)
+ * Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License.
+ */
+
+#ifndef _OCL_ERROR_HANDLER_HPP
+#define _OCL_ERROR_HANDLER_HPP
+
+#include <core/config.hpp>
+#include <io/print.hpp>
+#include <exception>
+
+namespace ocl
+{
+ struct handler;
+
+ struct handler
+ {
+ private:
+ template <typename T>
+ void handle_impl(T element) {}
+
+ public:
+ using error_type = std::exception;
+
+ explicit handler() = default;
+ virtual ~handler() = default;
+
+ handler& operator=(const handler&) = default;
+ handler(const handler&) = default;
+
+ template <typename T>
+ void operator()(T element)
+ {
+ this->handle_impl<T>(element);
+ }
+ };
+} // namespace ocl
+
+#endif // ifndef _OCL_ERROR_HANDLER_HPP