Adds helper functions to the list types.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
54c5422cda
commit
a2b52c5ed5
44
conanfile.py
44
conanfile.py
|
@ -1,44 +0,0 @@
|
||||||
from conans import ConanFile, CMake
|
|
||||||
|
|
||||||
|
|
||||||
class ArbutilsConan(ConanFile):
|
|
||||||
name = "Arbutils"
|
|
||||||
license = "TODO"
|
|
||||||
url = "https://git.p-epsilon.com/Deukhoofd/Arbutils"
|
|
||||||
description = "A helper library for the Epsilon project."
|
|
||||||
settings = "os", "compiler"
|
|
||||||
options = {"shared": [True, False], "staticC": [True, False]}
|
|
||||||
default_options = {"shared": True, "staticC": False}
|
|
||||||
generators = "cmake"
|
|
||||||
exports_sources = "*"
|
|
||||||
compiler = "clang"
|
|
||||||
|
|
||||||
def build(self):
|
|
||||||
cmake = CMake(self)
|
|
||||||
self.output.info("Target OS: %s." % self.settings.os)
|
|
||||||
if self.settings.os == "Windows":
|
|
||||||
self.output.warn("Noticed Windows target, setting Cmake WINDOWS=On.")
|
|
||||||
cmake.definitions["WINDOWS"] = "On"
|
|
||||||
if self.options.shared:
|
|
||||||
self.output.info("Building shared library.")
|
|
||||||
cmake.definitions["SHARED"] = "On"
|
|
||||||
else:
|
|
||||||
self.output.info("Building static library.")
|
|
||||||
|
|
||||||
if self.options.staticC:
|
|
||||||
self.output.info("Linking C libraries statically.")
|
|
||||||
cmake.definitions["STATICC"] = "On"
|
|
||||||
|
|
||||||
cmake.configure()
|
|
||||||
cmake.build()
|
|
||||||
|
|
||||||
def package(self):
|
|
||||||
self.copy("*.hpp", dst="include/Arbutils", src="src")
|
|
||||||
self.copy("*.hxx", dst="include/Arbutils", src="src")
|
|
||||||
self.copy("*.hpp", dst="include/extern", src="extern")
|
|
||||||
self.copy("*.dll", dst="bin", keep_path=False)
|
|
||||||
self.copy("*.so", dst="lib", keep_path=False)
|
|
||||||
self.copy("*.a", dst="lib", keep_path=False)
|
|
||||||
|
|
||||||
def package_info(self):
|
|
||||||
self.cpp_info.libs = ["Arbutils"]
|
|
|
@ -12,6 +12,9 @@ namespace ArbUt {
|
||||||
using const_iterator = typename std::unordered_map<KeyT, ValueT>::const_iterator;
|
using const_iterator = typename std::unordered_map<KeyT, ValueT>::const_iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
typedef KeyT keyType;
|
||||||
|
typedef ValueT valueType;
|
||||||
|
|
||||||
Dictionary() : _map() {}
|
Dictionary() : _map() {}
|
||||||
/// @brief Initialises a dictionary with a certain capacity.
|
/// @brief Initialises a dictionary with a certain capacity.
|
||||||
explicit Dictionary(size_t capacity) : _map(capacity) {}
|
explicit Dictionary(size_t capacity) : _map(capacity) {}
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace ArbUt {
|
||||||
using const_iterator = typename std::vector<ValueT>::const_iterator;
|
using const_iterator = typename std::vector<ValueT>::const_iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
typedef ValueT type;
|
||||||
|
|
||||||
List() noexcept : _vector() {}
|
List() noexcept : _vector() {}
|
||||||
/// @brief Creates a list with a reserved capacity.
|
/// @brief Creates a list with a reserved capacity.
|
||||||
/// @param capacity The number of spaces the list should reserve.
|
/// @param capacity The number of spaces the list should reserve.
|
||||||
|
@ -151,6 +153,8 @@ namespace ArbUt {
|
||||||
/// @brief Returns a std::vector representation of the current list.
|
/// @brief Returns a std::vector representation of the current list.
|
||||||
/// @return A std::vector representation of the current list.
|
/// @return A std::vector representation of the current list.
|
||||||
std::vector<ValueT>& GetStdList() noexcept { return _vector; }
|
std::vector<ValueT>& GetStdList() noexcept { return _vector; }
|
||||||
|
|
||||||
|
inline List<ValueT>* GetListPointer() const { return this; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace ArbUt {
|
||||||
using const_iterator = typename std::vector<ValueT*>::const_iterator;
|
using const_iterator = typename std::vector<ValueT*>::const_iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
typedef ValueT* type;
|
||||||
|
|
||||||
inline OptionalUniquePtrList() noexcept : _vector() {}
|
inline OptionalUniquePtrList() noexcept : _vector() {}
|
||||||
/// @brief Initialises a OptionalUniquePtrList from a std::vector of raw pointers.
|
/// @brief Initialises a OptionalUniquePtrList from a std::vector of raw pointers.
|
||||||
/// @param vec A std::vector of raw pointers.
|
/// @param vec A std::vector of raw pointers.
|
||||||
|
@ -142,6 +144,8 @@ namespace ArbUt {
|
||||||
/// @brief Returns a std::vector representation of the current list.
|
/// @brief Returns a std::vector representation of the current list.
|
||||||
/// @return A std::vector representation of the current list.
|
/// @return A std::vector representation of the current list.
|
||||||
std::vector<ValueT*>& GetStdList() noexcept { return _vector; }
|
std::vector<ValueT*>& GetStdList() noexcept { return _vector; }
|
||||||
|
|
||||||
|
inline OptionalUniquePtrList<ValueT>* GetListPointer() const { return this; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ namespace ArbUt {
|
||||||
using const_iterator = typename std::vector<ValueT*>::const_iterator;
|
using const_iterator = typename std::vector<ValueT*>::const_iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
typedef ValueT* type;
|
||||||
|
|
||||||
inline UniquePtrList() noexcept : _vector() {}
|
inline UniquePtrList() noexcept : _vector() {}
|
||||||
/// @brief Initialises a UniquePtrList from a std::vector of raw pointers.
|
/// @brief Initialises a UniquePtrList from a std::vector of raw pointers.
|
||||||
/// @param vec A std::vector of raw pointers.
|
/// @param vec A std::vector of raw pointers.
|
||||||
|
@ -151,6 +153,8 @@ namespace ArbUt {
|
||||||
/// @brief Returns a std::vector representation of the current list.
|
/// @brief Returns a std::vector representation of the current list.
|
||||||
/// @return A std::vector representation of the current list.
|
/// @return A std::vector representation of the current list.
|
||||||
std::vector<ValueT*>& GetStdList() noexcept { return _vector; }
|
std::vector<ValueT*>& GetStdList() noexcept { return _vector; }
|
||||||
|
|
||||||
|
inline OptionalUniquePtrList<ValueT>* GetListPointer() const { return this; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue