- Documentation of containers, core, and format

This commit is contained in:
2025-12-18 00:00:36 -05:00
parent e7503ed92f
commit 9e6f00eb60
57 changed files with 2007 additions and 805 deletions

View File

@@ -30,54 +30,55 @@
namespace fennec::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
using type = swizzle<VectorT, DataT, ScalarT, IndicesV...>;
};
// Specialization for single component swizzles to decay into a scalar
///
/// \tparam IndicesV Indices of the vector to pull from
template<size_t IndexV> struct SwizzleGen<IndexV>
{
// \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;