From 26fea2ac20986e76cdd8c2dc14cac0d7becbb58d Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 11 Dec 2020 15:29:27 +0100 Subject: [PATCH] Reorganise memory model to make it clear Memory.hpp should be referenced. --- src/Memory/Memory.hpp | 13 ++++++------- src/Memory/{BorrowedPtr.hpp => __BorrowedPtr.hpp} | 6 +++--- ...nalBorrowedPtr.hpp => __OptionalBorrowedPtr.hpp} | 6 +++--- ...ptionalUniquePtr.hpp => __OptionalUniquePtr.hpp} | 0 src/Memory/{ScopedPtr.hpp => __ScopedPtr.hpp} | 6 +++--- src/Memory/{UniquePtr.hpp => __UniquePtr.hpp} | 6 +++--- .../{UniquePtrList.hpp => __UniquePtrList.hpp} | 8 ++++---- tests/UniquePtrListTests.cpp | 2 +- 8 files changed, 23 insertions(+), 24 deletions(-) rename src/Memory/{BorrowedPtr.hpp => __BorrowedPtr.hpp} (97%) rename src/Memory/{OptionalBorrowedPtr.hpp => __OptionalBorrowedPtr.hpp} (96%) rename src/Memory/{OptionalUniquePtr.hpp => __OptionalUniquePtr.hpp} (100%) rename src/Memory/{ScopedPtr.hpp => __ScopedPtr.hpp} (96%) rename src/Memory/{UniquePtr.hpp => __UniquePtr.hpp} (96%) rename src/Memory/{UniquePtrList.hpp => __UniquePtrList.hpp} (97%) diff --git a/src/Memory/Memory.hpp b/src/Memory/Memory.hpp index c38f922..ae3af2c 100644 --- a/src/Memory/Memory.hpp +++ b/src/Memory/Memory.hpp @@ -1,15 +1,14 @@ #ifndef ARBUTILS_MEMORY_HPP #define ARBUTILS_MEMORY_HPP -#include "BorrowedPtr.hpp" -#include "OptionalBorrowedPtr.hpp" -#include "UniquePtr.hpp" -#include "OptionalUniquePtr.hpp" -#include "UniquePtrList.hpp" +#include "__BorrowedPtr.hpp" +#include "__OptionalBorrowedPtr.hpp" +#include "__OptionalUniquePtr.hpp" +#include "__UniquePtr.hpp" +#include "__UniquePtrList.hpp" namespace ArbUt { - template - using OwnedPtr = T*; + template using OwnedPtr = T*; } #endif // ARBUTILS_MEMORY_HPP diff --git a/src/Memory/BorrowedPtr.hpp b/src/Memory/__BorrowedPtr.hpp similarity index 97% rename from src/Memory/BorrowedPtr.hpp rename to src/Memory/__BorrowedPtr.hpp index f4ca895..59be141 100644 --- a/src/Memory/BorrowedPtr.hpp +++ b/src/Memory/__BorrowedPtr.hpp @@ -1,5 +1,5 @@ -#ifndef ARBUTILS_BORROWEDPTR_HPP -#define ARBUTILS_BORROWEDPTR_HPP +#ifndef ARBUTILS___BORROWEDPTR_HPP +#define ARBUTILS___BORROWEDPTR_HPP #include "../Assert.hpp" @@ -98,4 +98,4 @@ namespace std { }; } -#endif // ARBUTILS_BORROWEDPTR_HPP +#endif // ARBUTILS___BORROWEDPTR_HPP diff --git a/src/Memory/OptionalBorrowedPtr.hpp b/src/Memory/__OptionalBorrowedPtr.hpp similarity index 96% rename from src/Memory/OptionalBorrowedPtr.hpp rename to src/Memory/__OptionalBorrowedPtr.hpp index a13331a..95710ce 100644 --- a/src/Memory/OptionalBorrowedPtr.hpp +++ b/src/Memory/__OptionalBorrowedPtr.hpp @@ -1,5 +1,5 @@ -#ifndef ARBUTILS_OPTIONALBORROWEDPTR_HPP -#define ARBUTILS_OPTIONALBORROWEDPTR_HPP +#ifndef ARBUTILS___OPTIONALBORROWEDPTR_HPP +#define ARBUTILS___OPTIONALBORROWEDPTR_HPP #include "../Assert.hpp" @@ -94,4 +94,4 @@ namespace std { }; } -#endif // ARBUTILS_OPTIONALBORROWEDPTR_HPP +#endif // ARBUTILS___OPTIONALBORROWEDPTR_HPP diff --git a/src/Memory/OptionalUniquePtr.hpp b/src/Memory/__OptionalUniquePtr.hpp similarity index 100% rename from src/Memory/OptionalUniquePtr.hpp rename to src/Memory/__OptionalUniquePtr.hpp diff --git a/src/Memory/ScopedPtr.hpp b/src/Memory/__ScopedPtr.hpp similarity index 96% rename from src/Memory/ScopedPtr.hpp rename to src/Memory/__ScopedPtr.hpp index 90188a7..b169121 100644 --- a/src/Memory/ScopedPtr.hpp +++ b/src/Memory/__ScopedPtr.hpp @@ -1,5 +1,5 @@ -#ifndef ARBUTILS_SCOPEDPTR_HPP -#define ARBUTILS_SCOPEDPTR_HPP +#ifndef ARBUTILS___SCOPEDPTR_HPP +#define ARBUTILS___SCOPEDPTR_HPP #include "../Assert.hpp" @@ -73,4 +73,4 @@ namespace std { }; } -#endif // ARBUTILS_SCOPEDPTR_HPP +#endif // ARBUTILS___SCOPEDPTR_HPP diff --git a/src/Memory/UniquePtr.hpp b/src/Memory/__UniquePtr.hpp similarity index 96% rename from src/Memory/UniquePtr.hpp rename to src/Memory/__UniquePtr.hpp index 1888021..4708159 100644 --- a/src/Memory/UniquePtr.hpp +++ b/src/Memory/__UniquePtr.hpp @@ -1,5 +1,5 @@ -#ifndef ARBUTILS_UNIQUEPTR_HPP -#define ARBUTILS_UNIQUEPTR_HPP +#ifndef ARBUTILS___UNIQUEPTR_HPP +#define ARBUTILS___UNIQUEPTR_HPP #include "../Assert.hpp" @@ -76,4 +76,4 @@ namespace std { }; } -#endif // ARBUTILS_UNIQUEPTR_HPP +#endif // ARBUTILS___UNIQUEPTR_HPP diff --git a/src/Memory/UniquePtrList.hpp b/src/Memory/__UniquePtrList.hpp similarity index 97% rename from src/Memory/UniquePtrList.hpp rename to src/Memory/__UniquePtrList.hpp index 8e62177..19056da 100644 --- a/src/Memory/UniquePtrList.hpp +++ b/src/Memory/__UniquePtrList.hpp @@ -1,7 +1,7 @@ -#ifndef ARBUTILS_UNIQUEPTRLIST_HPP -#define ARBUTILS_UNIQUEPTRLIST_HPP +#ifndef ARBUTILS___UNIQUEPTRLIST_HPP +#define ARBUTILS___UNIQUEPTRLIST_HPP -#include "BorrowedPtr.hpp" +#include "__BorrowedPtr.hpp" namespace ArbUt { /// @brief Collection of pointers that is owned by the list. When the list exits scope, the destructor on all @@ -144,4 +144,4 @@ namespace ArbUt { }; } -#endif // ARBUTILS_UNIQUEPTRLIST_HPP +#endif // ARBUTILS___UNIQUEPTRLIST_HPP diff --git a/tests/UniquePtrListTests.cpp b/tests/UniquePtrListTests.cpp index 6faf52c..1b72ac7 100644 --- a/tests/UniquePtrListTests.cpp +++ b/tests/UniquePtrListTests.cpp @@ -1,6 +1,6 @@ #ifdef TESTS_BUILD #include "../extern/doctest.hpp" -#include "../src/Memory/UniquePtrList.hpp" +#include "../src/Memory/__UniquePtrList.hpp" using namespace ArbUt; TEST_CASE("Create Unique Ptr list, append") {