Adds documentation, style fixes.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2021-09-25 17:59:06 +02:00
parent 73b2270fca
commit dbf6fbc1db
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
5 changed files with 17 additions and 5 deletions

View File

@ -13,6 +13,7 @@ namespace ArbUt {
using const_iterator = typename std::vector<ValueT>::const_iterator;
public:
/// @brief The type of the value stored in the list.
typedef ValueT type;
List() noexcept : _vector() {}
@ -154,7 +155,11 @@ namespace ArbUt {
/// @return A std::vector representation of the current list.
std::vector<ValueT>& GetStdList() noexcept { return _vector; }
/// @brief Returns a raw pointer to the current list.
/// @return A raw pointer to the current list.
inline const List<ValueT>* GetListPointer() const { return this; }
/// @brief Returns a raw pointer to the current list.
/// @return A raw pointer to the current list.
inline List<ValueT>* GetListPointer() { return this; }
};
}

View File

@ -1,8 +1,8 @@
#ifndef ARBUTILS___BORROWEDPTR_HPP
#define ARBUTILS___BORROWEDPTR_HPP
#include "../Ensure.hpp"
#include <cstddef>
#include "../Ensure.hpp"
namespace ArbUt {
/// @brief A borrowed pointer is used to indicate a pointer that is not owned by its holder. As with all Arbutils

View File

@ -13,6 +13,7 @@ namespace ArbUt {
using const_iterator = typename std::vector<ValueT*>::const_iterator;
public:
/// @brief The type of the value stored in the list.
typedef ValueT* type;
inline OptionalUniquePtrList() noexcept : _vector() {}
@ -145,7 +146,11 @@ namespace ArbUt {
/// @return A std::vector representation of the current list.
std::vector<ValueT*>& GetStdList() noexcept { return _vector; }
/// @brief Returns a raw pointer to the current list.
/// @return A raw pointer to the current list.
inline const OptionalUniquePtrList<ValueT>* GetListPointer() const { return this; }
/// @brief Returns a raw pointer to the current list.
/// @return A raw pointer to the current list.
inline OptionalUniquePtrList<ValueT>* GetListPointer() { return this; }
};
}

View File

@ -14,6 +14,7 @@ namespace ArbUt {
using const_iterator = typename std::vector<ValueT*>::const_iterator;
public:
/// @brief The type of the value stored in the list.
typedef ValueT* type;
inline UniquePtrList() noexcept : _vector() {}
@ -154,7 +155,11 @@ namespace ArbUt {
/// @return A std::vector representation of the current list.
std::vector<ValueT*>& GetStdList() noexcept { return _vector; }
/// @brief Returns a raw pointer to the current list.
/// @return A raw pointer to the current list.
inline const UniquePtrList<ValueT>* GetListPointer() const { return this; }
/// @brief Returns a raw pointer to the current list.
/// @return A raw pointer to the current list.
inline UniquePtrList<ValueT>* GetListPointer() { return this; }
};
}

View File

@ -3,9 +3,6 @@
#include "../src/Memory/Memory.hpp"
using namespace ArbUt;
TEST_CASE("Scoped Pointer deletes child after out of scope") {
auto a = ScopedPtr<uint32_t>(new uint32_t(100));
}
TEST_CASE("Scoped Pointer deletes child after out of scope") { auto a = ScopedPtr<uint32_t>(new uint32_t(100)); }
#endif