From a786997f304745ce3766a82be06dc6a5d0c2f02c Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 14 Oct 2025 04:35:26 +0200 Subject: feat: scl: major refactors and new version of SCL. Signed-off-by: Amlal El Mahrouss --- dev/examples/allocator_system/allocator_system.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'dev/examples/allocator_system') diff --git a/dev/examples/allocator_system/allocator_system.cc b/dev/examples/allocator_system/allocator_system.cc index c3cd689..169cd97 100644 --- a/dev/examples/allocator_system/allocator_system.cc +++ b/dev/examples/allocator_system/allocator_system.cc @@ -8,10 +8,11 @@ #include #include -struct MyClass +class MyClass final { - int a; - std::string b; +public: + int a{}; + std::string b{}; MyClass() : a(0), b("default") { @@ -31,17 +32,19 @@ struct MyClass int main() { - using Alloc = ocl::standard_allocator_type; - Alloc allocator; + scl::standard_allocator_type allocator; // Test 1: claim() + unclaim() std::cout << "=== Test 1: claim/unclaim ===\n"; + MyClass* raw = allocator.claim(); + std::cout << "raw->a = " << raw->a << ", raw->b = " << raw->b << "\n"; allocator.unclaim(raw); // Manual delete // Test 2: construct() → shared_ptr std::cout << "\n=== Test 2: construct (shared_ptr) ===\n"; + auto ptr = allocator.construct(42, "hello"); std::cout << "ptr->a = " << ptr->a << ", ptr->b = " << ptr->b << "\n"; -- cgit v1.2.3 From 3827ae4e821ff3758d1eaf2dbacc55a22f802731 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 17 Nov 2025 10:31:30 +0100 Subject: feat: fixing merge conflicts. Signed-off-by: Amlal El Mahrouss --- Doxyfile | 4 ++-- README.md | 4 ++-- dev/examples/allocator_system/allocator_system.cc | 2 +- dev/examples/cgi/cgi.cc | 4 ++-- dev/examples/equiv/equiv.cc | 6 +++--- dev/examples/fix/fix.cc | 6 +++--- dev/examples/opt/opt.cc | 4 ++-- dev/examples/tracked_ptr/tracked_ptr.cc | 8 +++---- dev/lib/core/allocator_system.hpp | 10 ++++----- dev/lib/core/error_handler.hpp | 12 +++++------ dev/lib/except/error.hpp | 10 ++++----- dev/lib/fix/fix.hpp | 10 ++++----- dev/lib/io/print.hpp | 10 ++++----- dev/lib/logic/equiv.hpp | 4 ++-- dev/lib/logic/math.hpp | 4 ++-- dev/lib/logic/opt.hpp | 10 ++++----- dev/lib/memory/tracked_ptr.hpp | 4 ++-- dev/lib/net/modem.hpp | 12 +++++------ dev/lib/net/url.hpp | 4 ++-- dev/lib/simd/basic_simd.hpp | 8 +++---- dev/lib/simd/simd.hpp | 8 +++---- dev/lib/tests/hpptest.hpp | 8 +++---- dev/lib/utility/cgi_writer.hpp | 26 +++++++++++------------ dev/lib/utility/chunk_string.hpp | 12 +++++------ dev/lib/utility/crc32.hpp | 10 ++++----- dev/lib/utility/embfs.hpp | 10 ++++----- dev/tests/chunk_string/chunk_test.cc | 2 +- dev/tests/fix_basic/fix_test.cc | 6 +++--- dev/tests/network_basic/net_test.cc | 4 ++-- dev/tests/tracked_ptr_basic/tracked_ptr_test.cc | 8 +++---- dev/tests/tracked_ptr_leak/tracked_ptr_test.cc | 10 ++++----- meta/tex/embfs.tex | 2 +- tools/hpptest.py | 2 +- 33 files changed, 122 insertions(+), 122 deletions(-) (limited to 'dev/examples/allocator_system') diff --git a/Doxyfile b/Doxyfile index af59bc5..a558fb4 100644 --- a/Doxyfile +++ b/Doxyfile @@ -74,7 +74,7 @@ PROJECT_ICON = # entered, it will be relative to the location where Doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ./scl/docs +OUTPUT_DIRECTORY = ./ocl/docs # If the CREATE_SUBDIRS tag is set to YES then Doxygen will create up to 4096 # sub-directories (in 2 levels) under the output directory of each output format @@ -991,7 +991,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = /Volumes/Projects/src/scl +INPUT = /Volumes/Projects/src/ocl # This tag can be used to specify the character encoding of the source files # that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/README.md b/README.md index 20fee1a..0e876d7 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ A C++ library with additional modules for your C++ SDLC. Based on the Open C++ L int main(int argc, char** argv) { - auto opt = scl::opt(scl::eval_eq(50, 50)).try_or_throw("scl::eval_eq, does not match!"); - opt = scl::opt(scl::eval_eq(50, 40)); + auto opt = ocl::opt(ocl::eval_eq(50, 50)).try_or_throw("ocl::eval_eq, does not match!"); + opt = ocl::opt(ocl::eval_eq(50, 40)); opt.try_or_throw("this time it doesn't."); return EXIT_SUCCESS; diff --git a/dev/examples/allocator_system/allocator_system.cc b/dev/examples/allocator_system/allocator_system.cc index 169cd97..b500e30 100644 --- a/dev/examples/allocator_system/allocator_system.cc +++ b/dev/examples/allocator_system/allocator_system.cc @@ -32,7 +32,7 @@ public: int main() { - scl::standard_allocator_type allocator; + ocl::standard_allocator_type allocator; // Test 1: claim() + unclaim() std::cout << "=== Test 1: claim/unclaim ===\n"; diff --git a/dev/examples/cgi/cgi.cc b/dev/examples/cgi/cgi.cc index 6f73eff..692f90c 100644 --- a/dev/examples/cgi/cgi.cc +++ b/dev/examples/cgi/cgi.cc @@ -6,7 +6,7 @@ #include -static scl::basic_chunk_string text_sample = R"( +static ocl::basic_chunk_string text_sample = R"( @@ -68,7 +68,7 @@ static scl::basic_chunk_string text_sample = R"( /* @brief this stub loads a 'index.html' or returns an error message if not found. */ int main(int argc, char** argv) { - scl::cgi::basic_writer<> writer; + ocl::cgi::basic_writer<> writer; writer << text_sample; return 0; diff --git a/dev/examples/equiv/equiv.cc b/dev/examples/equiv/equiv.cc index 9d41afb..12207f4 100644 --- a/dev/examples/equiv/equiv.cc +++ b/dev/examples/equiv/equiv.cc @@ -11,9 +11,9 @@ int main(int argc, char** argv) { std::cout << std::boolalpha; - std::cout << scl::equiv::is_same::value << std::endl; - std::cout << scl::equiv::is_same::value << std::endl; - std::cout << scl::equiv::is_same::value << std::endl; + std::cout << ocl::equiv::is_same::value << std::endl; + std::cout << ocl::equiv::is_same::value << std::endl; + std::cout << ocl::equiv::is_same::value << std::endl; return 0; } diff --git a/dev/examples/fix/fix.cc b/dev/examples/fix/fix.cc index aaac979..ec6668a 100644 --- a/dev/examples/fix/fix.cc +++ b/dev/examples/fix/fix.cc @@ -15,14 +15,14 @@ int main(int argc, char** argv) { constexpr auto default_fix = "8=FIX.4.2|9=65|35=A|49=SERVER|56=CLIENT|34=177|52=20090107-18:15:16|98=0|108=30|10=062|"; - scl::fix::basic_visitor basic_visitor; - scl::fix::basic_range_data fix = basic_visitor.visit(default_fix); + ocl::fix::basic_visitor basic_visitor; + ocl::fix::basic_range_data fix = basic_visitor.visit(default_fix); std::cout << "magic=" << fix.magic_ << std::endl; std::cout << "magic_len=" << fix.magic_len_ << std::endl; std::cout << "is_valid=" << std::boolalpha << fix.is_valid() << std::endl; - scl::fix::must_pass(fix); + ocl::fix::must_pass(fix); for (auto fields : fix.body_) { diff --git a/dev/examples/opt/opt.cc b/dev/examples/opt/opt.cc index eb725c4..8a74fa2 100644 --- a/dev/examples/opt/opt.cc +++ b/dev/examples/opt/opt.cc @@ -26,7 +26,7 @@ static auto do_some(const std::string recv_data, const std::string check_data) const int hash_to_check = do_hash(check_data); /* here we assume this should match opt_hash */ const int opt_hash = do_hash(recv_data); /* we assume that the hash is correct */ - auto opt = scl::opt(scl::eval_eq(hash_to_check, opt_hash)); /* do the compute */ + auto opt = ocl::opt(ocl::eval_eq(hash_to_check, opt_hash)); /* do the compute */ return opt; } @@ -35,7 +35,7 @@ int main(int argc, char** argv) { // ... let's assume we fetch data from network... - scl::io::println("Testing data..."); + ocl::io::println("Testing data..."); auto opt = do_some("Ohio", "Ohio"); opt.try_or_throw("Checksum failed, Ohio isn't Ohio!"); diff --git a/dev/examples/tracked_ptr/tracked_ptr.cc b/dev/examples/tracked_ptr/tracked_ptr.cc index 6b8a859..6e3f4a2 100644 --- a/dev/examples/tracked_ptr/tracked_ptr.cc +++ b/dev/examples/tracked_ptr/tracked_ptr.cc @@ -9,13 +9,13 @@ static void summon_tracked_ptr() { - scl::memory::tracked_ptr ptr = scl::memory::make_tracked(42); + ocl::memory::tracked_ptr ptr = ocl::memory::make_tracked(42); std::cout << ptr.data() << "=" << ptr.manager().allocator().allocated_count_ << std::endl; } static void summon_leak_tracked_ptr() { - scl::memory::tracked_ptr* ptr = new scl::memory::tracked_ptr(42); + ocl::memory::tracked_ptr* ptr = new ocl::memory::tracked_ptr(42); std::cout << ptr->data() << "=" << ptr->manager().allocator().allocated_count_ << std::endl; } @@ -27,7 +27,7 @@ int main(int argc, char** argv) summon_tracked_ptr(); summon_tracked_ptr(); - scl::memory::tracked_ptr ptr; + ocl::memory::tracked_ptr ptr; std::cout << ptr.data() << "=" << ptr.manager().allocator().allocated_count_ << std::endl; @@ -46,7 +46,7 @@ int main(int argc, char** argv) std::cout << "total=" << ptr.manager().allocator().deallocated_count_ << std::endl; std::cout << "leak-detected=" << std::boolalpha << (ptr.manager().allocator().allocated_count_ > ptr.manager().allocator().deallocated_count_) << std::endl; - scl::memory::must_pass(ptr); + ocl::memory::must_pass(ptr); return EXIT_SUCCESS; } diff --git a/dev/lib/core/allocator_system.hpp b/dev/lib/core/allocator_system.hpp index 3ffa02a..6fd0119 100644 --- a/dev/lib/core/allocator_system.hpp +++ b/dev/lib/core/allocator_system.hpp @@ -5,13 +5,13 @@ * Copyright 2025, Amlal El Mahrouss. Licensed under the BSL 1.0 license */ -#ifndef _SCL_ALLOCATOR_SYSTEM_HPP -#define _SCL_ALLOCATOR_SYSTEM_HPP +#ifndef _OCL_ALLOCATOR_SYSTEM_HPP +#define _OCL_ALLOCATOR_SYSTEM_HPP #include #include -namespace scl +namespace ocl { template struct new_op final @@ -69,6 +69,6 @@ namespace scl template using standard_allocator_type = allocator_system, delete_op>; -} // namespace scl +} // namespace ocl -#endif // ifndef _SCL_ALLOCATOR_SYSTEM_HPP +#endif // ifndef _OCL_ALLOCATOR_SYSTEM_HPP diff --git a/dev/lib/core/error_handler.hpp b/dev/lib/core/error_handler.hpp index 449e255..67bf7b4 100644 --- a/dev/lib/core/error_handler.hpp +++ b/dev/lib/core/error_handler.hpp @@ -5,13 +5,13 @@ * Copyright 2025, Amlal El Mahrouss. */ -#ifndef _SCL_ERROR_HANDLER_HPP -#define _SCL_ERROR_HANDLER_HPP +#ifndef _OCL_ERROR_HANDLER_HPP +#define _OCL_ERROR_HANDLER_HPP #include #include -namespace scl +namespace ocl { struct basic_error_handler; @@ -25,12 +25,12 @@ namespace scl virtual void operator()(const std::basic_string& msg) { - scl::io::print(msg); + ocl::io::print(msg); } }; using standard_error_handler = basic_error_handler; using error_handler_type = basic_error_handler; -} // namespace scl +} // namespace ocl -#endif // ifndef _SCL_ERROR_HANDLER_HPP +#endif // ifndef _OCL_ERROR_HANDLER_HPP diff --git a/dev/lib/except/error.hpp b/dev/lib/except/error.hpp index 31b9894..16bf5eb 100644 --- a/dev/lib/except/error.hpp +++ b/dev/lib/except/error.hpp @@ -4,17 +4,17 @@ * Copyright 2023-2025, Amlal El Mahrouss */ -#ifndef _SCL_ERR_HPP -#define _SCL_ERR_HPP +#ifndef _OCL_ERR_HPP +#define _OCL_ERR_HPP #include -namespace scl +namespace ocl { using runtime_error = std::runtime_error; using fix_error = runtime_error; using math_error = runtime_error; using cgi_error = runtime_error; -} // namespace scl +} // namespace ocl -#endif // _SCL_ERR_HPP \ No newline at end of file +#endif // _OCL_ERR_HPP \ No newline at end of file diff --git a/dev/lib/fix/fix.hpp b/dev/lib/fix/fix.hpp index 672b8a1..243d01c 100644 --- a/dev/lib/fix/fix.hpp +++ b/dev/lib/fix/fix.hpp @@ -5,8 +5,8 @@ * Copyright 2025, Amlal El Mahrouss */ -#ifndef _SCL_FIX_PARSER_HPP -#define _SCL_FIX_PARSER_HPP +#ifndef _OCL_FIX_PARSER_HPP +#define _OCL_FIX_PARSER_HPP #include #include @@ -17,7 +17,7 @@ #include #include -namespace scl::fix +namespace ocl::fix { template class basic_visitor; @@ -210,6 +210,6 @@ namespace scl::fix } using fix_tag_type = std::uint32_t; -} // namespace scl::fix +} // namespace ocl::fix -#endif // ifndef _SCL_FIX_PARSER_HPP +#endif // ifndef _OCL_FIX_PARSER_HPP diff --git a/dev/lib/io/print.hpp b/dev/lib/io/print.hpp index 8463b6f..307c06f 100644 --- a/dev/lib/io/print.hpp +++ b/dev/lib/io/print.hpp @@ -5,13 +5,13 @@ * Copyright 2025 */ -#ifndef _SCL_PRINT_HPP -#define _SCL_PRINT_HPP +#ifndef _OCL_PRINT_HPP +#define _OCL_PRINT_HPP #include #include -namespace scl::io +namespace ocl::io { template inline void print(T fmt, Args... other) noexcept @@ -37,6 +37,6 @@ namespace scl::io print(fmt...); print(); } -} // namespace scl::io +} // namespace ocl::io -#endif // ifndef _SCL_PRINT_HPP +#endif // ifndef _OCL_PRINT_HPP diff --git a/dev/lib/logic/equiv.hpp b/dev/lib/logic/equiv.hpp index 05d0f53..5b022f8 100644 --- a/dev/lib/logic/equiv.hpp +++ b/dev/lib/logic/equiv.hpp @@ -8,7 +8,7 @@ #pragma once /// @brief OCL equivalence namespace. -namespace scl::equiv +namespace ocl::equiv { template struct basic_hash_trait @@ -101,4 +101,4 @@ namespace scl::equiv return left_ / right_ == 1; } }; -} // namespace scl::equiv +} // namespace ocl::equiv diff --git a/dev/lib/logic/math.hpp b/dev/lib/logic/math.hpp index 2d00595..e796eae 100644 --- a/dev/lib/logic/math.hpp +++ b/dev/lib/logic/math.hpp @@ -9,7 +9,7 @@ #include -namespace scl +namespace ocl { template struct is_non_boolean_integer final @@ -32,4 +32,4 @@ namespace scl constexpr inline auto not_a_number = NAN; constexpr inline auto positive_infinity = INFINITY; constexpr inline auto negative_infinity = -positive_infinity; -} // namespace scl \ No newline at end of file +} // namespace ocl \ No newline at end of file diff --git a/dev/lib/logic/opt.hpp b/dev/lib/logic/opt.hpp index 4ce999c..137460c 100644 --- a/dev/lib/logic/opt.hpp +++ b/dev/lib/logic/opt.hpp @@ -4,13 +4,13 @@ * Copyright 2023-2025, Amlal El Mahrouss */ -#ifndef _SCL_OPT_HPP -#define _SCL_OPT_HPP +#ifndef _OCL_OPT_HPP +#define _OCL_OPT_HPP #include #include -namespace scl +namespace ocl { enum class return_type { @@ -129,6 +129,6 @@ namespace scl { return return_type::err; } -} // namespace scl +} // namespace ocl -#endif /* ifndef _SCL_OPT_HPP */ +#endif /* ifndef _OCL_OPT_HPP */ diff --git a/dev/lib/memory/tracked_ptr.hpp b/dev/lib/memory/tracked_ptr.hpp index eb33bd0..d2f8450 100644 --- a/dev/lib/memory/tracked_ptr.hpp +++ b/dev/lib/memory/tracked_ptr.hpp @@ -16,7 +16,7 @@ #include #include -namespace scl::memory +namespace ocl::memory { template class tracked_allocator; @@ -232,4 +232,4 @@ namespace scl::memory ::kill(::getpid(), SIGTRAP); } } -} // namespace scl::memory +} // namespace ocl::memory diff --git a/dev/lib/net/modem.hpp b/dev/lib/net/modem.hpp index 6c63399..0e935c7 100644 --- a/dev/lib/net/modem.hpp +++ b/dev/lib/net/modem.hpp @@ -5,8 +5,8 @@ * Copyright 2025, Amlal El Mahrouss */ -#ifndef _SCL_NET_NETWORK_HPP -#define _SCL_NET_NETWORK_HPP +#ifndef _OCL_NET_NETWORK_HPP +#define _OCL_NET_NETWORK_HPP #include #include @@ -14,9 +14,9 @@ #include #include -#define SCL_MODEM_INTERFACE : public scl::net::basic_modem +#define OCL_MODEM_INTERFACE : public ocl::net::basic_modem -namespace scl::net +namespace ocl::net { class basic_modem; @@ -151,6 +151,6 @@ namespace scl::net return true; } }; -} // namespace scl::net +} // namespace ocl::net -#endif // ifndef _SCL_NET_NETWORK_HPP +#endif // ifndef _OCL_NET_NETWORK_HPP diff --git a/dev/lib/net/url.hpp b/dev/lib/net/url.hpp index 52991f2..83ab587 100644 --- a/dev/lib/net/url.hpp +++ b/dev/lib/net/url.hpp @@ -13,7 +13,7 @@ /// @author Amlal El Mahrouss (amlal@nekernel.org) /// @brief Parse URLs (in a non-standard way). -namespace scl::net +namespace ocl::net { template class basic_url; @@ -91,4 +91,4 @@ namespace scl::net return m_ss_.size() > 0 && this->protocol_exists(); } }; -} // namespace scl::net +} // namespace ocl::net diff --git a/dev/lib/simd/basic_simd.hpp b/dev/lib/simd/basic_simd.hpp index d182aaf..f14d977 100644 --- a/dev/lib/simd/basic_simd.hpp +++ b/dev/lib/simd/basic_simd.hpp @@ -1,8 +1,8 @@ /* * File: simd/basic_simd.hpp * Purpose: Basic SIMD backend C++ library. - * Author: Amlal El Mahrouss (founder@snu.systems) - * Copyright 2025, Amlal El Mahrouss, and SNUPowered, licensed under the BSL 1.0 license. + * Author: Amlal El Mahrouss (amlal@nekernel.org) + * Copyright 2025, Amlal El Mahrouss, licensed under the BSL 1.0 license. */ #pragma once @@ -19,7 +19,7 @@ using simd_type = __m256; using simd_type = float32x4_t; #endif -namespace scl::snu::simd +namespace ocl::snu::simd { struct basic_simd_backend final { @@ -44,4 +44,4 @@ namespace scl::snu::simd return "basic_simd_backend"; } }; -} // namespace scl::snu::simd +} // namespace ocl::snu::simd diff --git a/dev/lib/simd/simd.hpp b/dev/lib/simd/simd.hpp index 9234e67..e571b23 100644 --- a/dev/lib/simd/simd.hpp +++ b/dev/lib/simd/simd.hpp @@ -1,8 +1,8 @@ /* * File: simd/simd.hpp * Purpose: SIMD C++ library. - * Author: Amlal El Mahrouss (founder@snu.systems) - * Copyright 2025, Amlal El Mahrouss, and SNUPowered, licensed under the BSL 1.0 license. + * Author: Amlal El Mahrouss (amlal@nekernel.org) + * Copyright 2025, Amlal El Mahrouss, licensed under the BSL 1.0 license. */ #pragma once @@ -12,7 +12,7 @@ /// @author Amlal El Mahrouss /// @brief Basic SIMD processor. -namespace scl::snu::simd +namespace ocl::snu::simd { template class basic_simd_processor @@ -57,4 +57,4 @@ namespace scl::snu::simd return processor_.isa(); } }; -} // namespace scl::snu::simd +} // namespace ocl::snu::simd diff --git a/dev/lib/tests/hpptest.hpp b/dev/lib/tests/hpptest.hpp index 63fc962..f5fa5c2 100644 --- a/dev/lib/tests/hpptest.hpp +++ b/dev/lib/tests/hpptest.hpp @@ -7,15 +7,15 @@ #pragma once -namespace scl::hpptest +namespace ocl::hpptest { typedef bool condition_type; template consteval inline void must_pass() { -#ifdef SCL_HPPTEST - SCL_HPPTEST_ASSERT(expr); +#ifdef OCL_HPPTEST + OCL_HPPTEST_ASSERT(expr); #endif } -} // namespace scl::hpptest +} // namespace ocl::hpptest diff --git a/dev/lib/utility/cgi_writer.hpp b/dev/lib/utility/cgi_writer.hpp index 87354ac..d54d9de 100644 --- a/dev/lib/utility/cgi_writer.hpp +++ b/dev/lib/utility/cgi_writer.hpp @@ -4,15 +4,15 @@ * Copyright 2023-2025, Amlal El Mahrouss. */ -#ifndef _SCL_CGI_WRITER_HPP -#define _SCL_CGI_WRITER_HPP +#ifndef _OCL_CGI_WRITER_HPP +#define _OCL_CGI_WRITER_HPP #include #include #include #include -namespace scl +namespace ocl { namespace cgi { @@ -21,7 +21,7 @@ namespace scl class basic_writer { private: - basic_writer& eval_(const scl::basic_chunk_string& mime, const scl::basic_chunk_string& ss) noexcept + basic_writer& eval_(const ocl::basic_chunk_string& mime, const ocl::basic_chunk_string& ss) noexcept { std::basic_stringstream ss_out; @@ -30,7 +30,7 @@ namespace scl ss_out << std::format("Content-Length: {}\r\n\r\n", ss.str().size()); ss_out << ss.str(); - scl::io::print(ss_out.str()); + ocl::io::print(ss_out.str()); return *this; } @@ -43,37 +43,37 @@ namespace scl basic_writer(const basic_writer&) = default; public: - friend void operator<<(basic_writer& self, const scl::basic_chunk_string& ss_in) + friend void operator<<(basic_writer& self, const ocl::basic_chunk_string& ss_in) { self = self.eval_("text/plain", ss_in); } - basic_writer& binary(const scl::basic_chunk_string& ss_in) + basic_writer& binary(const ocl::basic_chunk_string& ss_in) { return this->eval_("application/octet-stream", ss_in); } - basic_writer& html(const scl::basic_chunk_string& ss_in) + basic_writer& html(const ocl::basic_chunk_string& ss_in) { return this->eval_("text/html", ss_in); } - basic_writer& xml(const scl::basic_chunk_string& ss_in) + basic_writer& xml(const ocl::basic_chunk_string& ss_in) { return this->eval_("application/xml", ss_in); } - basic_writer& json(const scl::basic_chunk_string& ss_in) + basic_writer& json(const ocl::basic_chunk_string& ss_in) { return this->eval_("application/json", ss_in); } - basic_writer& js(const scl::basic_chunk_string& ss_in) + basic_writer& js(const ocl::basic_chunk_string& ss_in) { return this->eval_("text/javascript", ss_in); } }; } // namespace cgi -} // namespace scl +} // namespace ocl -#endif // ifndef _SCL_CGI_WRITER_HPP +#endif // ifndef _OCL_CGI_WRITER_HPP diff --git a/dev/lib/utility/chunk_string.hpp b/dev/lib/utility/chunk_string.hpp index 6778173..4fe5cc2 100644 --- a/dev/lib/utility/chunk_string.hpp +++ b/dev/lib/utility/chunk_string.hpp @@ -5,12 +5,12 @@ * Copyright 2025, Amlal El Mahrouss */ -#ifndef SCL_UTILITY_CHUNK_STRING_HPP -#define SCL_UTILITY_CHUNK_STRING_HPP +#ifndef OCL_UTILITY_CHUNK_STRING_HPP +#define OCL_UTILITY_CHUNK_STRING_HPP #include -namespace scl +namespace ocl { template class basic_chunk_string; @@ -89,7 +89,7 @@ namespace scl void print() noexcept { - scl::io::print(packed_chunks_); + ocl::io::print(packed_chunks_); } }; @@ -98,5 +98,5 @@ namespace scl { fmt.print(); } -} // namespace scl -#endif // ifndef SCL_UTILITY_CHUNK_STRING_HPP +} // namespace ocl +#endif // ifndef OCL_UTILITY_CHUNK_STRING_HPP diff --git a/dev/lib/utility/crc32.hpp b/dev/lib/utility/crc32.hpp index 93347a8..ea09b94 100644 --- a/dev/lib/utility/crc32.hpp +++ b/dev/lib/utility/crc32.hpp @@ -5,8 +5,8 @@ * Copyright 2025, Amlal El Mahrouss. */ -#ifndef _SCL_CRC32_HPP -#define _SCL_CRC32_HPP +#ifndef _OCL_CRC32_HPP +#define _OCL_CRC32_HPP #include #include @@ -15,7 +15,7 @@ /// @brief Crc32 implementation in C++ /// @author Amlal EL Mahrouss (amlal@nekernel.org) -namespace scl::crc32 +namespace ocl::crc32 { namespace detail { @@ -76,6 +76,6 @@ namespace scl::crc32 { return detail::crc32(in.c_str(), in.size()); } -} // namespace scl::crc32 +} // namespace ocl::crc32 -#endif // !_SCL_CRC32_HPP \ No newline at end of file +#endif // !_OCL_CRC32_HPP \ No newline at end of file diff --git a/dev/lib/utility/embfs.hpp b/dev/lib/utility/embfs.hpp index 2738ae7..6da8874 100644 --- a/dev/lib/utility/embfs.hpp +++ b/dev/lib/utility/embfs.hpp @@ -5,8 +5,8 @@ * Copyright 2025, Amlal El Mahrouss. */ -#ifndef _SCL_EMBFS_HPP -#define _SCL_EMBFS_HPP +#ifndef _OCL_EMBFS_HPP +#define _OCL_EMBFS_HPP #include #include @@ -14,7 +14,7 @@ /// @brief A filesystem designed for tiny storage medias. /// @author Amlal EL Mahrouss (amlal@nekernel.org) -namespace scl::embfs +namespace ocl::embfs { namespace traits { @@ -76,6 +76,6 @@ namespace scl::embfs /// @brief Indexed node linear array. typedef embfs_inode embfs_inode_arr_t[_inode_arr_len]; } // namespace traits -} // namespace scl::embfs +} // namespace ocl::embfs -#endif // ifndef _SCL_EMBFS_HPP \ No newline at end of file +#endif // ifndef _OCL_EMBFS_HPP \ No newline at end of file diff --git a/dev/tests/chunk_string/chunk_test.cc b/dev/tests/chunk_string/chunk_test.cc index b24b332..ad3d31b 100644 --- a/dev/tests/chunk_string/chunk_test.cc +++ b/dev/tests/chunk_string/chunk_test.cc @@ -16,7 +16,7 @@ TEST(ChunkTest, BasicChunkUsage) auto start = std::chrono::high_resolution_clock::now(); - scl::basic_chunk_string optimized; + ocl::basic_chunk_string optimized; for (unsigned i = 0; i < iterations; ++i) { diff --git a/dev/tests/fix_basic/fix_test.cc b/dev/tests/fix_basic/fix_test.cc index 5457f21..1c80716 100644 --- a/dev/tests/fix_basic/fix_test.cc +++ b/dev/tests/fix_basic/fix_test.cc @@ -10,9 +10,9 @@ TEST(FIXTest, BasicFIXUsage) { - scl::fix::basic_visitor basic_visitor; - scl::fix::basic_range_data fix = basic_visitor.visit("8=FIX.4.2|9=65|35=A|49=SERVER|56=CLIENT|34=177|52=20090107-18:15:16|98=0|108=30|10=062|"); + ocl::fix::basic_visitor basic_visitor; + ocl::fix::basic_range_data fix = basic_visitor.visit("8=FIX.4.2|9=65|35=A|49=SERVER|56=CLIENT|34=177|52=20090107-18:15:16|98=0|108=30|10=062|"); - EXPECT_EQ(fix.magic_, scl::fix::detail::begin_fix()); + EXPECT_EQ(fix.magic_, ocl::fix::detail::begin_fix()); EXPECT_TRUE(fix.is_valid()); } diff --git a/dev/tests/network_basic/net_test.cc b/dev/tests/network_basic/net_test.cc index 4bd3a9f..61d0b28 100644 --- a/dev/tests/network_basic/net_test.cc +++ b/dev/tests/network_basic/net_test.cc @@ -12,8 +12,8 @@ TEST(NetworkTest, BasicNetworkUsage) { - scl::net::basic_modem modem; - modem.construct(scl::net::basic_modem::local_address_ip4, true); + ocl::net::basic_modem modem; + modem.construct(ocl::net::basic_modem::local_address_ip4, true); EXPECT_TRUE(modem.is_valid()); diff --git a/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc b/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc index decae88..1e97188 100644 --- a/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc +++ b/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc @@ -10,16 +10,16 @@ TEST(TrackedPtrTest, BasicTrackedPtrUsage) { - scl::memory::tracked_ptr ptr = scl::memory::make_tracked(42); + ocl::memory::tracked_ptr ptr = ocl::memory::make_tracked(42); ASSERT_TRUE(ptr); EXPECT_EQ(*ptr, 42); - scl::memory::tracked_ptr ptr2; + ocl::memory::tracked_ptr ptr2; - scl::memory::swap(ptr, ptr2); + ocl::memory::swap(ptr, ptr2); ptr2.reset(); - EXPECT_EQ(scl::memory::tracked_ptr::manager().allocator().allocated_count_, 1); + EXPECT_EQ(ocl::memory::tracked_ptr::manager().allocator().allocated_count_, 1); } \ No newline at end of file diff --git a/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc b/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc index 375fb35..f349f47 100644 --- a/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc +++ b/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc @@ -10,10 +10,10 @@ TEST(TrackedPtrTest, LeakTrackedPtrUsage) { - scl::memory::tracked_ptr* ptr = new scl::memory::tracked_ptr(42); - scl::memory::tracked_ptr* ptr2 = new scl::memory::tracked_ptr(42); - scl::memory::tracked_ptr* ptr3 = new scl::memory::tracked_ptr(42); + ocl::memory::tracked_ptr* ptr = new ocl::memory::tracked_ptr(42); + ocl::memory::tracked_ptr* ptr2 = new ocl::memory::tracked_ptr(42); + ocl::memory::tracked_ptr* ptr3 = new ocl::memory::tracked_ptr(42); - EXPECT_EQ(scl::memory::tracked_ptr::manager().allocator().allocated_count_, 3); - ASSERT_TRUE(scl::memory::tracked_ptr::manager().allocator().deallocated_count_ == 0); + EXPECT_EQ(ocl::memory::tracked_ptr::manager().allocator().allocated_count_, 3); + ASSERT_TRUE(ocl::memory::tracked_ptr::manager().allocator().deallocated_count_ == 0); } \ No newline at end of file diff --git a/meta/tex/embfs.tex b/meta/tex/embfs.tex index 1548ab8..2d5c60e 100644 --- a/meta/tex/embfs.tex +++ b/meta/tex/embfs.tex @@ -37,7 +37,7 @@ The \textbf{Embedded File System (EMBFS)} is a compact and minimal filesystem de \section{Namespace} The EMBFS implementation resides under: \begin{lstlisting} -namespace scl::embfs +namespace ocl::embfs \end{lstlisting} \section{Supported Logical Block Addressing (LBA) Modes} diff --git a/tools/hpptest.py b/tools/hpptest.py index 5bb09bd..dbed143 100755 --- a/tools/hpptest.py +++ b/tools/hpptest.py @@ -5,7 +5,7 @@ import sys, os if __name__ == '__main__': if len(sys.argv) == 3: - ret = os.system(f"clang++ -I./dev/ -I{sys.argv[2]} -std=c++20 -DSCL_HPPTEST '-DSCL_HPPTEST_ASSERT(x)=static_assert(x, #x)' {sys.argv[1]}") + ret = os.system(f"clang++ -I./dev/ -I{sys.argv[2]} -std=c++20 -DOCL_HPPTEST '-DOCL_HPPTEST_ASSERT(x)=static_assert(x, #x)' {sys.argv[1]}") if ret == 0: print("[TEST] HEADER COMPILATION PASSES") -- cgit v1.2.3