Skip to content

Commit

Permalink
simplify stormkit.Core module
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthapz committed Feb 8, 2024
1 parent 6fff418 commit e3a8834
Show file tree
Hide file tree
Showing 60 changed files with 1,194 additions and 1,739 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

module;

#include <stormkit/Core/MemoryMacro.hpp>

export module stormkit.Core:Containers.RingBuffer;

import std;

import :Utils.Assert;
import :Utils.Numerics;
import :Utils.Byte;

export namespace stormkit::core {
template<class T>
class RingBuffer {
Expand Down Expand Up @@ -266,4 +253,4 @@ namespace stormkit::core {

return std::launder(std::bit_cast<OutPtr>(addr));
}
} // namespace stormkit::core
} // namespace stormkit::core
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

module;

#include <stormkit/Core/MemoryMacro.hpp>

#include <stormkit/Core/PlatformMacro.hpp>

export module stormkit.Core:Containers.Tree;

import std;

import :Utils.Numerics;
import :Utils.Handle;

export namespace stormkit::core {
class STORMKIT_API TreeNode {
public:
Expand Down Expand Up @@ -507,4 +493,4 @@ namespace stormkit::core {

stream.close();
}
} // namespace stormkit::core
} // namespace stormkit::core
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

export module stormkit.Core:Containers.Utils;

import std;

import :Meta.Traits;
import :Meta.Concepts;

import :Utils.Byte;

export namespace stormkit::core {
template<std::ranges::range T, std::ranges::range... U>
constexpr auto merge(T& output, const U&... ranges) noexcept -> void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

export module stormkit.Core:Hash.Base;

import std;

import :Meta.Concepts;

export namespace stormkit::core {
using Hash32 = std::uint32_t;
using Hash64 = std::uint64_t;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

export module stormkit.Core:Hash.HashMap;

import std;

import ankerl.unordered_dense;

export namespace stormkit::core {
template<class Key,
class T,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

export module stormkit.Core:Hash.StringHash;

import std;

export namespace stormkit::core {
struct StringHash {
using is_transparent = void;
Expand Down Expand Up @@ -81,4 +76,4 @@ namespace stormkit::core {
-> bool {
return a.compare(b) == 0;
}
} // namespace stormkit::core
} // namespace stormkit::core
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

export module stormkit.Core:Meta.Concepts;

import std;

namespace stormkit::core {
namespace details {
template<class T>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

export module stormkit.Core:Meta.Traits;

import std;

import :Meta.Concepts;

export namespace stormkit::core {
template<class T>
struct PureTypeTrait {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

module;

#include <stormkit/Core/PlatformMacro.hpp>

export module stormkit.Core:Parallelism.ThreadPool;

import std;

import :Utils.Algorithms;
import :Utils.Numerics;
import :Parallelism.ThreadUtils;

export namespace stormkit::core {
class STORMKIT_API ThreadPool {
public:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

module;

#include <stormkit/Core/PlatformMacro.hpp>

export module stormkit.Core:Parallelism.ThreadUtils;

import std;

export namespace stormkit::core {
STORMKIT_API auto setCurrentThreadName(std::string_view name) -> void;
STORMKIT_API auto setThreadName(std::thread& thread, std::string_view name) -> void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

module;

#include <climits>
#include <cstdlib>

#include <stormkit/Core/PlatformMacro.hpp>

export module stormkit.Core:String.Encodings;

import std;

import :Utils.AsCast;
import :Utils.Numerics;

export namespace stormkit::core {
auto asciiToUtf16(std::string_view) -> std::u16string;
auto utf16ToAscii(std::u16string_view) -> std::string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

module;

#include "magic_enum.hpp"

export module stormkit.Core:String.Format;

import std;

import :Meta;
import :Utils.Numerics;
import :Utils.Math;

export namespace std {
template<class CharT>
struct formatter<std::byte, CharT>: formatter<int, CharT> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

export module stormkit.Core:String.Operations;

import std;

import :Utils.Numerics;

export namespace stormkit::core {
[[nodiscard]] auto split(std::string_view string, char delim) noexcept
-> std::vector<std::string>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

export module stormkit.Core:Utils.Algorithms;

import std;

import :Meta;

export namespace stormkit::core {
template<std::ranges::input_range Range,
IsUnaryPredicate<class std::remove_cvref_t<Range>::value_type> Predicate>
Expand Down Expand Up @@ -105,4 +98,4 @@ namespace stormkit::core {
if (predicate(elem)) *it++ = lambda(elem);
});
}
} // namespace stormkit::core
} // namespace stormkit::core
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

module;

#include <stormkit/Core/PlatformMacro.hpp>

#include <stormkit/Core/MemoryMacro.hpp>

export module stormkit.Core:Utils.App;

import std;

import :Utils.Numerics;

export namespace stormkit::core {
class STORMKIT_API App {
public:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

module;

#include <stormkit/Core/PlatformMacro.hpp>

export module stormkit.Core:Utils.AsCast;

import std;

import :Utils.Assert;
import :Meta.Concepts;
import :Meta.Traits;

export namespace stormkit::core {
template<IsNotReference To, typename... Args>
[[nodiscard]] constexpr auto is(const std::variant<Args...>& variant) noexcept -> bool;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

module;

#include <stormkit/Core/PlatformMacro.hpp>

#ifndef STORMKIT_ASSERT
#define STORMKIT_ASSERT 1
#endif

export module stormkit.Core:Utils.Assert;

import std;

import :Utils.Descriptors;
import :Utils.Stacktrace;

export namespace stormkit::core {
enum class AssertType {
Assert,
Expand Down Expand Up @@ -99,7 +83,6 @@ namespace stormkit::core {
const std::source_location& location) noexcept {
if constexpr (STORMKIT_ASSERT == 1) {
if (not cond) [[unlikely]] {
auto stderr = getSTDErr();
std::println(stderr,
"[{}] failed in \n"
" > file: {}\n"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

export module stormkit.Core:Utils.Byte;

import std;

import :Meta;
import :Utils.Numerics;

export namespace stormkit::core {
using Byte = std::byte;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

module;

#include <stormkit/Core/PlatformMacro.hpp>

export module stormkit.Core:Utils.DeferInit;

import std;

import :Meta.Traits;
import :Utils.Assert;

export namespace stormkit::core {
template<typename T>
class DeferInit {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
// Copyright (C) 2023 Arthur LAURENT <arthur.laurent4@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level of this distribution

module;

#include <stormkit/Core/PlatformMacro.hpp>

#include <stormkit/Core/MemoryMacro.hpp>

export module stormkit.Core:Utils.DynamicLoader;

import std;

import :Utils.Assert;
import :Utils.Pimpl;

export namespace stormkit::core {
class DynamicLoader;

Expand Down
Loading

0 comments on commit e3a8834

Please sign in to comment.