Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
145a48a
Thing::Say; User API
Epixu Sep 14, 2024
9f933d1
Reflecting A::UserModule and A::User from the get go
Epixu Sep 16, 2024
d616f88
Properly reflected API; Minor renames
Epixu Sep 24, 2024
63a7d84
Reflecting fundamentals on runtime creation
Epixu Sep 24, 2024
c18dba7
Registering Math verbs and trais on Runtime init
Epixu Sep 25, 2024
6ab907a
Minor changes
Epixu Sep 26, 2024
dda4226
Fixes
Epixu Sep 30, 2024
7c2f1d4
Fixing parenting
Epixu Sep 30, 2024
e70d8c2
Minor improvements
Epixu Oct 1, 2024
229bb04
Fixing asset data access error
Epixu Oct 4, 2024
df698cd
Improved DumpHierarchy
Epixu Oct 4, 2024
e1db05c
Improved logging in release
Epixu Oct 7, 2024
0cff4d8
Improving abstract file readers and writers
Epixu Oct 8, 2024
3e19f1b
Cleaning up A::File::Reader and Writer
Epixu Oct 8, 2024
e7660b3
Bit of code cleanup
Epixu Oct 8, 2024
8d331cb
Maintenance
Epixu Oct 9, 2024
a349cf4
Revert "Maintenance"
Epixu Oct 10, 2024
e2f0fa5
Better take on the maintenancy thingy
Epixu Oct 10, 2024
47d07d1
Set existing parent only if missing
Epixu Oct 10, 2024
b664840
Some detachment reordering; Further Neat substitutions; Testing Neat/…
Epixu Oct 10, 2024
0df2528
Less local construct pointers
Epixu Oct 14, 2024
41326ec
Minor changes
Epixu Oct 15, 2024
0546726
Maintenance; Implementing detachment through Reference routines (WIP)
Epixu Oct 16, 2024
8d47cb5
Proper Thing::Teardown and Asset::Reference; Common verbosity macros
Epixu Oct 16, 2024
69857d1
Maintenance
Epixu Oct 17, 2024
e323bc8
Mostly maintenance
Epixu Oct 17, 2024
7ce100a
Removed verbose logging
Epixu Oct 18, 2024
f31ef8f
Critical leak fix
Epixu Oct 20, 2024
cba5277
Testing TSet for leaks
Epixu Oct 20, 2024
cf2290a
Improved Thing::Say; Improved A::Mind API
Epixu Oct 21, 2024
765eff2
WASM support
Epixu Oct 29, 2024
81fe928
Emscripten builds; Major CMake reduction
Epixu Oct 30, 2024
3091b9c
Typo fix
Epixu Nov 3, 2024
76f0b6f
Updating CI to GCC14, Clang19 and Ubuntu 24.04
Epixu Nov 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 26 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest]
os: [ubuntu-24.04, windows-latest]
build: [Debug, Release]
arch: [x86, x64]
cxx: [g++, clang++-17, ClangCl, v143]
cxx: [g++-14, clang++-19, ClangCl, v143]

exclude:
- os: ubuntu-22.04
- os: ubuntu-24.04
cxx: v143
- os: ubuntu-22.04
- os: ubuntu-24.04
cxx: ClangCl
- os: windows-latest
cxx: g++
cxx: g++-14
- os: windows-latest
cxx: clang++-17
cxx: clang++-19

include:
- cxx: g++
c: gcc
- cxx: clang++-17
c: clang-17
- os: ubuntu-22.04
- cxx: g++-14
c: gcc-14
- cxx: clang++-19
c: clang-19
- os: ubuntu-24.04
arch: x86
cmake_args: "-DCMAKE_CXX_FLAGS=-m32"
- os: ubuntu-22.04
- os: ubuntu-24.04
arch: x64
cmake_args: "-DCMAKE_CXX_FLAGS=-m64"
- os: windows-latest
Expand All @@ -48,21 +48,28 @@ jobs:
- name: Clone
uses: actions/checkout@v4

- if: matrix.os == 'ubuntu-22.04' && matrix.arch == 'x86'
- if: matrix.os == 'ubuntu-24.04' && matrix.arch == 'x86'
name: Prepare Linux for cross-compilation
run: |
sudo apt update
sudo apt install g++-multilib
sudo apt install g++-14-multilib

- if: matrix.cxx == 'clang++-17'
name: Installing Clang 17
- if: matrix.cxx == 'g++-14'
name: Installing G++ 14
run: |
sudo apt update
sudo apt install gcc-14 g++-14

- if: matrix.cxx == 'clang++-19'
name: Installing Clang 19
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
sudo apt-add-repository "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main"
sudo apt update
sudo apt install clang-17
sudo apt install gcc-14 g++-14 # clang-19 needs stdc++14.2 see https://github.com/llvm/llvm-project/issues/102336
sudo apt install clang-19

- if: matrix.os == 'ubuntu-22.04'
- if: matrix.os == 'ubuntu-24.04'
name: Configure (Linux)
run: >
mkdir build && cd build && cmake ..
Expand Down
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ if(PROJECT_IS_TOP_LEVEL OR NOT LANGULUS)
include(LangulusUtilities.cmake)

# Add all Langulus libraries
fetch_langulus_module(Core GIT_TAG 393d95b6ab13fc5846bda8a3044e4ca62f02fd5a)
fetch_langulus_module(Logger GIT_TAG 69626cd4c738195df0929a1cd867317422506e61)
fetch_langulus_module(RTTI GIT_TAG 720e675b1ea114156c309fe44871e03557e0a64f)
fetch_langulus_module(Core GIT_TAG 35756f11d2f9c475f27b094b8d4c82cd453969fc)
fetch_langulus_module(Logger GIT_TAG dafbeb825071ec60d8403254143f75606151a7e6)
fetch_langulus_module(RTTI GIT_TAG fc49750884ac943dff4261ac5b8dfb2c148423d7)
if(LANGULUS_FEATURE_MANAGED_MEMORY)
fetch_langulus_module(Fractalloc GIT_TAG b4917194b18c139969fb9d0a14bf993ee5f2582a)
fetch_langulus_module(Fractalloc GIT_TAG 66408e8557b1bb3c80615909129342bcebd3fb9f)
endif()
fetch_langulus_module(SIMD GIT_TAG 6611cf422e3c8157b88c086f30966afbf4e7dc6c)
fetch_langulus_module(Anyness GIT_TAG 7e433990052d2cf4c1dbd73afdddb1c697d92c56)
fetch_langulus_module(Flow GIT_TAG 4a0b0f349e5a6f543114b9269f96f55adc025a60)
fetch_langulus_module(Math GIT_TAG 1d5612eeccb31b1dc21371977899237330342662)
fetch_langulus_module(SIMD GIT_TAG ead5493049e2800b4c3c02d385c0c6314efac69c)
fetch_langulus_module(Anyness GIT_TAG 46a6513d6bcf3d532e9bf746b50d1299692eb96a)
fetch_langulus_module(Flow GIT_TAG 06000427afccf13016738140d09850f0b8cf837b)
fetch_langulus_module(Math GIT_TAG d25c6d59a8ffd352d94c260d102a53217e12c42d)
endif()

file(GLOB_RECURSE
Expand All @@ -32,7 +32,7 @@ file(GLOB_RECURSE
)

# Build and install Entity library
add_library(LangulusEntity ${LANGULUS_LIBRARY_TYPE}
add_langulus_library(LangulusEntity
$<TARGET_OBJECTS:LangulusLogger>
$<TARGET_OBJECTS:LangulusRTTI>
$<$<BOOL:${LANGULUS_FEATURE_MANAGED_MEMORY}>:$<TARGET_OBJECTS:LangulusFractalloc>>
Expand Down
2 changes: 2 additions & 0 deletions include/Langulus/AI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace Langulus::A
struct Mind : virtual AIUnit {
LANGULUS_BASES(AIUnit);
Mind() : Resolvable {this} {}

virtual Many Interpret(const Langulus::Text&) = 0;
};

} // namespace Langulus::A
37 changes: 18 additions & 19 deletions include/Langulus/Asset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// SPDX-License-Identifier: GPL-3.0-or-later
///
#pragma once
#include "../Entity/Thing.hpp"
#include "IO.hpp"
#include <Flow/Factory.hpp>
#include <Math/LOD.hpp>

Expand All @@ -26,7 +26,10 @@ namespace Langulus::A
Ref<A::Folder> mFolder;

public:
const Ref<A::Folder>& GetFolder() const noexcept;
// @attention never delete stuff from this call! Do it on
// Update() instead
virtual void RequestGarbageCollection() = 0;
auto GetFolder() const noexcept -> const Ref<A::Folder>&;
};


Expand All @@ -43,38 +46,34 @@ namespace Langulus::A

protected:
// Map of lists of generated data
mutable DataListMap mDataListMap;
DataListMap mDataListMap;

public:
Asset() : Resolvable {this} {}

void Detach();

virtual bool Generate(TMeta, Offset = 0) { return true; }

template<CT::TraitBased = Langulus::Trait>
void Commit(auto&&) const;
void Commit(auto&&);

template<CT::TraitBased = Langulus::Trait>
NOD() const Data* GetData(Offset = 0) const noexcept;
NOD() const Data* GetData(TMeta, Offset = 0) const noexcept;

NOD() auto GetData(Offset = 0) noexcept -> Data*;
template<CT::TraitBased = Langulus::Trait>
NOD() const DataList* GetDataList() const noexcept;
NOD() const DataList* GetDataList(TMeta) const noexcept;
NOD() auto GetData(Offset = 0) const noexcept -> Data const*;

NOD() DataListMap const& GetDataListMap() const noexcept;
NOD() auto GetData(TMeta, Offset = 0) noexcept -> Data*;
NOD() auto GetData(TMeta, Offset = 0) const noexcept -> Data const*;

protected:
template<CT::TraitBased = Langulus::Trait>
NOD() Data* GetData(Offset = 0) noexcept;
NOD() Data* GetData(TMeta, Offset = 0) noexcept;

NOD() auto GetDataList() noexcept -> DataList*;
template<CT::TraitBased = Langulus::Trait>
NOD() DataList* GetDataList() noexcept;
NOD() DataList* GetDataList(TMeta) noexcept;
NOD() auto GetDataList() const noexcept -> DataList const*;

NOD() auto GetDataList(TMeta) noexcept -> DataList*;
NOD() auto GetDataList(TMeta) const noexcept -> DataList const*;

NOD() DataListMap& GetDataListMap() noexcept;
NOD() auto GetDataListMap() noexcept -> DataListMap&;
NOD() auto GetDataListMap() const noexcept -> DataListMap const&;
};

} // namespace Langulus::A
Expand Down
30 changes: 12 additions & 18 deletions include/Langulus/Asset.inl
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ namespace Langulus::A
/// Retrieve the asset module's repository folder
/// @return a reference to the folder interface
LANGULUS(INLINED)
const Ref<A::Folder>& AssetModule::GetFolder() const noexcept {
auto AssetModule::GetFolder() const noexcept -> const Ref<A::Folder>& {
return mFolder;
}

/// Get the entire content data map
/// @attention this doesn't generate any data
/// @return a reference to the contents
LANGULUS(INLINED)
Asset::DataListMap const& Asset::GetDataListMap() const noexcept {
auto Asset::GetDataListMap() const noexcept -> DataListMap const& {
return mDataListMap;
}

LANGULUS(INLINED)
Asset::DataListMap& Asset::GetDataListMap() noexcept {
auto Asset::GetDataListMap() noexcept -> DataListMap& {
return mDataListMap;
}

Expand All @@ -37,15 +37,15 @@ namespace Langulus::A
/// @param index - the Nth data associated to the trait
/// @return a pointer to the data entry, or nullptr if none exists
template<CT::TraitBased T> LANGULUS(INLINED)
Asset::Data* Asset::GetData(Offset index) noexcept {
auto Asset::GetData(Offset index) noexcept -> Data* {
TMeta trait;
if constexpr (CT::Trait<T>)
trait = MetaTraitOf<T>();
return GetData(trait, index);
}

template<CT::TraitBased T> LANGULUS(INLINED)
Asset::Data const* Asset::GetData(Offset index) const noexcept {
auto Asset::GetData(Offset index) const noexcept -> Data const* {
return const_cast<Asset*>(this)->GetData<T>(index);
}

Expand All @@ -54,7 +54,7 @@ namespace Langulus::A
/// @param index - the Nth data associated to the trait
/// @return a pointer to the data entry, or nullptr if none exists
LANGULUS(INLINED)
Asset::Data* Asset::GetData(TMeta trait, Offset index) noexcept {
auto Asset::GetData(TMeta trait, Offset index) noexcept -> Data* {
if (not Generate(trait, index))
return nullptr;

Expand All @@ -65,31 +65,31 @@ namespace Langulus::A
}

LANGULUS(INLINED)
Asset::Data const* Asset::GetData(TMeta trait, Offset index) const noexcept {
auto Asset::GetData(TMeta trait, Offset index) const noexcept -> Data const* {
return const_cast<Asset*>(this)->GetData(trait, index);
}

/// Get a data list from the contents
/// @tparam T - the trait to search for
/// @return a pointer to the data list, or nullptr if none exists
template<CT::TraitBased T> LANGULUS(INLINED)
Asset::DataList* Asset::GetDataList() noexcept {
auto Asset::GetDataList() noexcept -> DataList* {
TMeta trait;
if constexpr (CT::Trait<T>)
trait = MetaTraitOf<T>();
return GetDataList(trait);
}

template<CT::TraitBased T> LANGULUS(INLINED)
Asset::DataList const* Asset::GetDataList() const noexcept {
auto Asset::GetDataList() const noexcept -> DataList const* {
return const_cast<Asset*>(this)->GetDataList<T>();
}

/// Get a data list from the contents
/// @param trait - the trait to search for
/// @return a pointer to the data list, or nullptr if none exists
LANGULUS(INLINED)
Asset::DataList* Asset::GetDataList(TMeta trait) noexcept {
auto Asset::GetDataList(TMeta trait) noexcept -> DataList* {
if (not const_cast<Asset*>(this)->Generate(trait))
return nullptr;

Expand All @@ -98,7 +98,7 @@ namespace Langulus::A
}

LANGULUS(INLINED)
const Asset::DataList* Asset::GetDataList(TMeta trait) const noexcept {
auto Asset::GetDataList(TMeta trait) const noexcept -> const DataList* {
return const_cast<Asset*>(this)->GetDataList(trait);
}

Expand All @@ -114,7 +114,7 @@ namespace Langulus::A
/// you don't use factories, and just want some local content
/// representation.
template<CT::TraitBased T> LANGULUS(INLINED)
void Asset::Commit(auto&& content) const {
void Asset::Commit(auto&& content) {
TMeta trait;
if constexpr (CT::Trait<T>)
trait = MetaTraitOf<T>();
Expand All @@ -127,10 +127,4 @@ namespace Langulus::A
mDataListMap.Insert(trait, S::Nest(content));
}

/// Detach the asset
inline void Asset::Detach() {
mDataListMap.Reset();
ProducedFrom::Detach();
}

} // namespace Langulus::A
Loading