- Adjusted Formatting of tests
- Finished map implementation and unit tests TODO: Threading
This commit is contained in:
@@ -27,65 +27,60 @@
|
||||
|
||||
#include <fennec/containers/array.h>
|
||||
|
||||
namespace fennec
|
||||
namespace fennec::detail
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
///
|
||||
/// \brief helper class for generating vectors
|
||||
/// \tparam scalar base scalar type
|
||||
/// \tparam size size of the vector type
|
||||
//
|
||||
// \brief helper class for generating vectors
|
||||
// \tparam scalar base scalar type
|
||||
// \tparam size size of the vector type
|
||||
template<typename scalar, size_t size>
|
||||
struct vector_base_type_helper
|
||||
{
|
||||
///
|
||||
/// \var SizeV
|
||||
/// \brief size of the vector type
|
||||
//
|
||||
// \var SizeV
|
||||
// \brief size of the vector type
|
||||
inline static constexpr size_t SizeV = size;
|
||||
|
||||
|
||||
///
|
||||
/// \brief Base scalar type
|
||||
//
|
||||
// \brief Base scalar type
|
||||
using ScalarT = scalar;
|
||||
|
||||
///
|
||||
/// \brief Base vector type
|
||||
//
|
||||
// \brief Base vector type
|
||||
using VectorT = vec<ScalarT, SizeV>;
|
||||
|
||||
///
|
||||
/// \brief Backing array holding the elements
|
||||
//
|
||||
// \brief Backing array holding the elements
|
||||
using DataT = array<ScalarT, SizeV>;
|
||||
|
||||
///
|
||||
/// \brief Helper for generating a swizzle from a set of indices
|
||||
/// \tparam IndicesV Indices of the vector to pull from
|
||||
//
|
||||
// \brief Helper for generating a swizzle from a set of indices
|
||||
// \tparam IndicesV Indices of the vector to pull from
|
||||
template<size_t...IndicesV> struct SwizzleGen
|
||||
{
|
||||
/// \brief generated swizzle type
|
||||
// \brief generated swizzle type
|
||||
using type = swizzle<VectorT, DataT, ScalarT, IndicesV...>;
|
||||
};
|
||||
|
||||
// Specialization for single component swizzles to decay into a scalar
|
||||
template<size_t IndexV> struct SwizzleGen<IndexV>
|
||||
{
|
||||
/// \brief decayed scalar type
|
||||
// \brief decayed scalar type
|
||||
using type = ScalarT;
|
||||
};
|
||||
|
||||
///
|
||||
/// \brief backing storage type
|
||||
//
|
||||
// \brief backing storage type
|
||||
using StorageT = vector_storage<SizeV, SwizzleGen, DataT>;
|
||||
};
|
||||
|
||||
///
|
||||
/// \brief helper for getting the storage type of the vector constructed with the provided size and scalar type
|
||||
//
|
||||
// \brief helper for getting the storage type of the vector constructed with the provided size and scalar type
|
||||
template<typename ScalarT, size_t SizeV>
|
||||
using vector_base_type = typename vector_base_type_helper<ScalarT, SizeV>::StorageT;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // FENNEC_MATH_VECTOR_BASE_H
|
||||
|
||||
Reference in New Issue
Block a user