From 34ae080c65fef96cc35f7b86c1231b01cb4df8f4 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 23 Dec 2025 11:03:20 +0100 Subject: feat: wip: crope implementation in progress. Signed-off-by: Amlal El Mahrouss --- include/ocl/tproc.hpp | 8 ++--- include/ocl/tproc/detail/config.hpp | 2 ++ include/ocl/tproc/detail/rope_fwd.hpp | 60 ++++++++++++++++++++++++++++++++++ include/ocl/tproc/rope.hpp | 11 +++++++ include/ocl/tproc/rope_fwd.hpp | 61 ----------------------------------- 5 files changed, 77 insertions(+), 65 deletions(-) create mode 100644 include/ocl/tproc/detail/rope_fwd.hpp create mode 100644 include/ocl/tproc/rope.hpp delete mode 100644 include/ocl/tproc/rope_fwd.hpp (limited to 'include') diff --git a/include/ocl/tproc.hpp b/include/ocl/tproc.hpp index 514eb47..a23b91c 100644 --- a/include/ocl/tproc.hpp +++ b/include/ocl/tproc.hpp @@ -3,10 +3,10 @@ // 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_HPP -#define OCL_TPROC_HPP +#ifndef __OCL_TPROC_HPP +#define __OCL_TPROC_HPP #include -#include +#include -#endif // OCL_TPROC_HPP +#endif // __OCL_TPROC_HPP diff --git a/include/ocl/tproc/detail/config.hpp b/include/ocl/tproc/detail/config.hpp index 9b1d265..47bd0b2 100644 --- a/include/ocl/tproc/detail/config.hpp +++ b/include/ocl/tproc/detail/config.hpp @@ -14,7 +14,9 @@ #include namespace ocl { + namespace pmr {} + } // namespace ocl #endif // ifndef __OCL_TPROC_CONFIG diff --git a/include/ocl/tproc/detail/rope_fwd.hpp b/include/ocl/tproc/detail/rope_fwd.hpp new file mode 100644 index 0000000..e7dbebb --- /dev/null +++ b/include/ocl/tproc/detail/rope_fwd.hpp @@ -0,0 +1,60 @@ +// 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 final { +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; + + CharT *begin(); + + CharT *end(); + + size_type size(); + + bool empty() const; + + ~basic_rope() = default; + basic_rope(const boost::string_view& in = {}); + +private: + struct impl; + std::unique_ptr impl_; +}; + +#if __cplusplus >= 201811L +#ifdef __cpp_char8_t +using u8rope = basic_rope; +#endif +#endif + +using crope = basic_rope; +using wrope = basic_rope; + +} // namespace ocl + +#endif diff --git a/include/ocl/tproc/rope.hpp b/include/ocl/tproc/rope.hpp new file mode 100644 index 0000000..86f1c5e --- /dev/null +++ b/include/ocl/tproc/rope.hpp @@ -0,0 +1,11 @@ +// 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_HPP +#define __OCL_TPROC_ROPE_HPP + +#include + +#endif // __OCL_TPROC_ROPE_HPP \ No newline at end of file diff --git a/include/ocl/tproc/rope_fwd.hpp b/include/ocl/tproc/rope_fwd.hpp deleted file mode 100644 index 6532d47..0000000 --- a/include/ocl/tproc/rope_fwd.hpp +++ /dev/null @@ -1,61 +0,0 @@ -// 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 -- cgit v1.2.3