From 7fbf17c499df4ef1ebd50658e88889b8d2081029 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 21 Dec 2025 18:07:21 +0100 Subject: wip: `crope` and `wrope` types. Signed-off-by: Amlal El Mahrouss --- include/ocl/tproc.hpp | 2 +- include/ocl/tproc/detail/config.hpp | 6 ++-- include/ocl/tproc/rope.hpp | 0 include/ocl/tproc/rope_fwd.hpp | 61 +++++++++++++++++++++++++++++++++++++ test/rope_test/.keep | 0 test/rope_test/crope.test.cpp | 7 +++++ 6 files changed, 72 insertions(+), 4 deletions(-) delete mode 100644 include/ocl/tproc/rope.hpp create mode 100644 include/ocl/tproc/rope_fwd.hpp delete mode 100644 test/rope_test/.keep create mode 100644 test/rope_test/crope.test.cpp diff --git a/include/ocl/tproc.hpp b/include/ocl/tproc.hpp index 84a2851..514eb47 100644 --- a/include/ocl/tproc.hpp +++ b/include/ocl/tproc.hpp @@ -7,6 +7,6 @@ #define OCL_TPROC_HPP #include -#include +#include #endif // OCL_TPROC_HPP diff --git a/include/ocl/tproc/detail/config.hpp b/include/ocl/tproc/detail/config.hpp index 60e5278..9b1d265 100644 --- a/include/ocl/tproc/detail/config.hpp +++ b/include/ocl/tproc/detail/config.hpp @@ -9,12 +9,12 @@ #define __OCL_TPROC_CONFIG #include -#include +#include #include #include namespace ocl { -template class basic_rope; -} +namespace pmr {} +} // namespace ocl #endif // ifndef __OCL_TPROC_CONFIG diff --git a/include/ocl/tproc/rope.hpp b/include/ocl/tproc/rope.hpp deleted file mode 100644 index e69de29..0000000 diff --git a/include/ocl/tproc/rope_fwd.hpp b/include/ocl/tproc/rope_fwd.hpp new file mode 100644 index 0000000..323674f --- /dev/null +++ b/include/ocl/tproc/rope_fwd.hpp @@ -0,0 +1,61 @@ +// Copyright 2025, Amlal El Mahrouss (amlal@nekernel.org) +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// Official repository: https://github.com/ocl-org/tproc + +#ifndef OCL_TPROC_ROPE_FWD_HPP +#define OCL_TPROC_ROPE_FWD_HPP + +#include +#include + +/// \file rope_fwd.hpp +/// \brief Basic forward definitions of the `rope` type. + +namespace ocl { +/// \brief This class implements a rope type for any **CharT** type. +/// \note Specializations are available as `crope` and `wrope`. +/// \author Amlal El Mahrouss +template , + class Allocator = std::allocator> +class basic_rope { +public: + using traits_type = Traits; + using value_type = CharT; + using allocator_type = Allocator; + using size_type = std::allocator_traits::size_type; + using reference = CharT &; + using const_reference = const CharT &; + using pointer = std::allocator_traits::pointer; + using const_pointer = std::allocator_traits::pointer; + + [[nodiscard]] + CharT *begin() { + return nullptr; + } + + [[nodiscard]] + CharT *end() { + return nullptr; + } + + [[nodiscard]] + size_type size() { + return 0UL; + } + + basic_rope() = default; + virtual ~basic_rope() = default; +}; + +#if __cplusplus >= 201811L +#ifdef __cpp_char8_t +using u8rope = basic_rope; +#endif +#endif + +using crope = basic_rope; +using wrope = basic_rope; +} // namespace ocl + +#endif \ No newline at end of file diff --git a/test/rope_test/.keep b/test/rope_test/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/rope_test/crope.test.cpp b/test/rope_test/crope.test.cpp new file mode 100644 index 0000000..869331f --- /dev/null +++ b/test/rope_test/crope.test.cpp @@ -0,0 +1,7 @@ +/* + * File: crope.test.cpp + * Purpose: Char rope test. + * Author: Amlal El Mahrouss (amlal@nekernel.org) + * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License. + */ + -- cgit v1.2.3