From e6579534e7c64be652ffeb74be7c977564a3ddab Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 30 Nov 2025 00:42:50 -0500 Subject: chore & feat: final library changes to stabilize changes. Signed-off-by: Amlal El Mahrouss --- include/ocl/core/handler.hpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 include/ocl/core/handler.hpp (limited to 'include/ocl/core/handler.hpp') 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 +#include +#include + +namespace ocl +{ + struct handler; + + struct handler + { + private: + template + 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 + void operator()(T element) + { + this->handle_impl(element); + } + }; +} // namespace ocl + +#endif // ifndef _OCL_ERROR_HANDLER_HPP -- cgit v1.2.3