diff --git a/doxy/Doxyfile b/doxy/Doxyfile index 52d9f29..b886496 100644 --- a/doxy/Doxyfile +++ b/doxy/Doxyfile @@ -815,7 +815,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = /home/medusa/Documents/Work/Personal/fennec/doxy/DoxyLayout.xml # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib diff --git a/doxy/Doxyfile.in b/doxy/Doxyfile.in index 5cad430..41f9c09 100644 --- a/doxy/Doxyfile.in +++ b/doxy/Doxyfile.in @@ -815,7 +815,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = @PROJECT_SOURCE_DIR@/doxy/DoxyLayout.xml # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib diff --git a/include/fennec/lang/bits.h b/include/fennec/lang/bits.h index 19c194d..e529e2b 100644 --- a/include/fennec/lang/bits.h +++ b/include/fennec/lang/bits.h @@ -28,10 +28,56 @@ /// /// - #ifndef FENNEC_LANG_BITS_H #define FENNEC_LANG_BITS_H +/// +/// \page fennec_lang_bit_manipulation Bit Manipulation +/// +/// This header contains definitions for manipulating the bits of a provided object or pointer. +/// +/// +///
Syntax +/// Description +/// +///

+/// \ref fennec::bit_cast "ToT bit_cast(const FromT& x)" +///
+/// \copydetails fennec::bit_cast +/// +///

+/// \ref fennec::bit_and "void* bit_and(void* arr, const void* mask, size_t n)" +///
+/// \copydetails fennec::bit_and +/// +///

+/// \ref fennec::bit_and_s "void* bit_and_s(void* arr, size_t n0, const void* mask, size_t n1)" +///
+/// \copydetails fennec::bit_and_s +/// +///

+/// \ref fennec::bit_or "void* bit_or(void* arr, const void* mask, size_t n)" +///
+/// \copydetails fennec::bit_or +/// +///

+/// \ref fennec::bit_or_s "void* bit_or_s(void* arr, size_t n0, const void* mask, size_t n1)" +///
+/// \copydetails fennec::bit_or_s +/// +///

+/// \ref fennec::bit_xor "void* bit_xor(void* arr, const void* mask, size_t n)" +///
+/// \copydetails fennec::bit_xor +/// +///

+/// \ref fennec::bit_xor_s "void* bit_xor_s(void* arr, size_t n0, const void* mask, size_t n1)" +///
+/// \copydetails fennec::bit_xor_s +///
+/// +/// + #include #include #include @@ -40,11 +86,13 @@ namespace fennec { /// -/// \brief perform a bitcast of FromT to ToT +/// \brief Perform a bitcast of FromT to ToT +/// +/// \details Perform a bitcast of FromT to ToT /// \tparam ToT Type to cast to /// \tparam FromT Type of the value /// \param from Value to bit cast -/// \return A value containing a bitwise copy of the input +/// \returns A value containing a bitwise copy of the input template requires(sizeof(ToT) == sizeof(FromT)) constexpr ToT bit_cast(const FromT& from) { @@ -63,11 +111,13 @@ constexpr ToT bit_cast(const FromT& from) /// -/// \brief perform a bit-wise and over an array of bytes +/// \brief Perform a bit-wise and over an array of bytes +/// +/// \details Perform a bitcast of FromT to ToT /// \param arr the array of bytes to modify /// \param mask the mask to and against arr /// \param n the number of bytes -/// \returns the pointer arr +/// \returns the pointer \f$arr\f$ constexpr void* bit_and(void* arr, const void* mask, size_t n) { if (arr == mask) return arr; @@ -84,8 +134,10 @@ constexpr void* bit_and(void* arr, const void* mask, size_t n) } /// -/// \brief safe version of fennec::bit_and -/// \copydoc fennec::bit_and +/// \brief Safe version of fennec::bit_and +/// +/// \details Safe version of fennec::bit_and +/// \copydetails fennec::bit_and /// \param n0 the size of arr in bytes /// \param n1 the size of mask in bytes constexpr void* bit_and_s(void* arr, size_t n0, const void* mask, size_t n1) @@ -96,7 +148,9 @@ constexpr void* bit_and_s(void* arr, size_t n0, const void* mask, size_t n1) /// -/// \brief perform a bit-wise or over an array of bytes +/// \brief Perform a bit-wise or over an array of bytes +/// +/// \details Perform a bit-wise or over an array of bytes /// \param arr the array of bytes to modify /// \param mask the mask to or against arr /// \param n the number of bytes @@ -117,8 +171,10 @@ constexpr void* bit_or(void* arr, const void* mask, size_t n) } /// -/// \brief safe version of fennec::bit_or -/// \copydoc fennec::bit_or +/// \brief Safe version of fennec::bit_or +/// +/// \details Safe version of fennec::bit_or +/// \copydetails fennec::bit_or /// \param n0 the size of arr in bytes /// \param n1 the size of mask in bytes constexpr void* bit_or_s(void* arr, size_t n0, const void* mask, size_t n1) @@ -129,7 +185,9 @@ constexpr void* bit_or_s(void* arr, size_t n0, const void* mask, size_t n1) /// -/// \brief perform a bit-wise or over an array of bytes +/// \brief Perform a bit-wise or over an array of bytes +/// +/// \details Perform a bit-wise or over an array of bytes /// \param arr the array of bytes to modify /// \param mask the mask to or against arr /// \param n the number of bytes @@ -150,8 +208,10 @@ constexpr void* bit_xor(void* arr, const void* mask, size_t n) } /// -/// \brief safe version of fennec::bit_xor -/// \copydoc fennec::bit_xor +/// \brief Safe version of fennec::bit_xor +/// +/// \details Safe version of fennec::bit_xor +/// \copydetails fennec::bit_xor /// \param n0 the size of arr in bytes /// \param n1 the size of mask in bytes constexpr void* bit_xor_s(void* arr, size_t n0, const void* mask, size_t n1) diff --git a/include/fennec/lang/conditional_types.h b/include/fennec/lang/conditional_types.h index a6d89f1..67e7101 100644 --- a/include/fennec/lang/conditional_types.h +++ b/include/fennec/lang/conditional_types.h @@ -32,6 +32,28 @@ #ifndef FENNEC_LANG_CONDITIONAL_TYPES_H #define FENNEC_LANG_CONDITIONAL_TYPES_H +/// +/// \page fennec_lang_conditional_types Conditional Types +/// +/// +///
Syntax +/// Description +/// +///

+/// \ref fennec::conditional "conditional::type"
+/// \ref fennec::conditional_t "conditional_t" +///
+/// \copydetails fennec::conditional +/// +///

+/// \ref fennec::detect "detect, ArgsT...>::type"
+/// \ref fennec::detect_t "detect_t, ArgsT...>" +///
+/// \copydetails fennec::detect +///
+/// +/// + #include #include @@ -44,19 +66,20 @@ namespace fennec /// /// \brief select between two types based on a condition /// -/// \details +/// \details Selects between \p TrueT and \p FalseT based on the boolean value \p b. +/// The chosen type is stored in `conditional::type`. /// \tparam B the value of the condition -/// \tparam T type to use when \f$B == true\f$ -/// \tparam F type to use when \f$B == false\f$ -template +/// \tparam TrueT type to use when \f$B == true\f$ +/// \tparam FalseT type to use when \f$B == false\f$ +template struct conditional; /// /// \brief Shorthand for ```typename conditional::type``` -template +template using conditional_t - = typename conditional::type; + = typename conditional::type; // specialization of fennec::conditional for `true` case @@ -76,8 +99,8 @@ struct conditional /// /// \brief Detect whether `DetectT` is a valid type /// -/// \details The chosen type is stored in `detect::type` and -/// a boolean value is stored in `detect::is_detected` representing whether `DetectT` +/// \details Selects `DetectT` if it exists, otherwise selects `DefaultT` The chosen type is stored in `detect::type` and +/// a boolean value is stored in `detect::is_detected` representing whether `DetectT` is found. /// \tparam DefaultT Default type /// \tparam DetectT Type to detect /// \tparam ArgsT Any template arguments for `DetectT` @@ -102,6 +125,9 @@ struct detect { using type = DetectT; static constexpr bool is_detected = true; + + +// fennec::enable_if =================================================================================================== }; } diff --git a/include/fennec/lang/lang.h b/include/fennec/lang/lang.h index 7533b8b..49de51a 100644 --- a/include/fennec/lang/lang.h +++ b/include/fennec/lang/lang.h @@ -36,7 +36,20 @@ /// /// This library implements the parts of the C++ stdlib that relate to built-in types and metaprogramming. /// -/// \subpage +/// - \subpage fennec_lang_bit_manipulation +/// - \subpage fennec_lang_metaprogramming +/// +/// + +/// +/// \page fennec_lang_metaprogramming Metaprogramming +/// +/// Metaprogramming is a method of obtaining information about the structure of the code at compile time. +/// This includes getting traits of types, such as with \ref fennec::numeric_limits. You may even programmatically +/// enable functions based on the info of the types that the function uses. +/// +/// - \subpage fennec_lang_conditional_types +/// /// /// diff --git a/include/fennec/math/exponential.h b/include/fennec/math/exponential.h index 0e435b8..5fc7357 100644 --- a/include/fennec/math/exponential.h +++ b/include/fennec/math/exponential.h @@ -51,37 +51,37 @@ ///
/// \ref fennec::pow(fennec::genType, fennec::genType) "genFType pow(genFType x, genFType y)" /// -/// \copydoc fennec::pow(fennec::genType, fennec::genType) +/// \copydetails fennec::pow(fennec::genType, fennec::genType) /// ///
/// \ref fennec::exp(fennec::genType)"genFType exp(genFType x)" /// -/// \copydoc fennec::exp(fennec::genType) +/// \copydetails fennec::exp(fennec::genType) /// ///
/// \ref fennec::exp2(fennec::genType) "genFType exp2(genFType x)" /// -/// \copydoc fennec::exp2(fennec::genType) +/// \copydetails fennec::exp2(fennec::genType) /// ///
/// \ref fennec::log(fennec::genType) "genFType log(genFType x)" /// -/// \copydoc fennec::log(fennec::genType) +/// \copydetails fennec::log(fennec::genType) /// ///
/// \ref fennec::log2(fennec::genType) "genFType log2(genFType x)" /// -/// \copydoc fennec::log2(fennec::genType) +/// \copydetails fennec::log2(fennec::genType) /// ///
/// \ref fennec::sqrt(fennec::genType) "genFType sqrt(genFType x)" /// -/// \copydoc fennec::sqrt(fennec::genType) +/// \copydetails fennec::sqrt(fennec::genType) /// ///
/// \ref fennec::inversesqrt(fennec::genType) "genFType inversesqrt(genFType x)" /// -/// \copydoc fennec::inversesqrt(fennec::genType) +/// \copydetails fennec::inversesqrt(fennec::genType) /// /// /// diff --git a/include/fennec/math/math.h b/include/fennec/math/math.h index c01c592..153f87d 100644 --- a/include/fennec/math/math.h +++ b/include/fennec/math/math.h @@ -45,27 +45,43 @@ /// The overarching goal of this math library is to implement the math types and functions of the /// [OpenGL 4.6 Shading Language Specification](https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.pdf). /// -/// \section fennec_math_topics Topics +/// - \subpage fennec_math_topics "Topics" +/// - \ref fennec_math_set_theory +/// - \subpage fennec_math_data_types "Data Types" +/// - \ref fennec_math_scalar +/// - \ref fennec_math_vector +/// - \ref fennec_math_matrix +/// - \subpage fennec_math_functions "Functions" +/// - \ref fennec_math_set_theory +/// - \ref fennec_math_common +/// - \ref fennec_math_exponential +/// - \ref fennec_math_geometric +/// - \ref fennec_math_relational +/// - \ref fennec_math_trigonometric +/// +/// + +/// +/// \page fennec_math_topics Topics /// - \subpage fennec_math_set_theory /// -/// \section fennec_math_data_types Data Types + /// +/// \page fennec_math_data_types Data Types /// - \subpage fennec_math_scalar /// - \subpage fennec_math_vector /// - \subpage fennec_math_matrix /// -/// \section fennec_math_functions Functions + /// +/// \page fennec_math_functions Functions +/// - \subpage fennec_math_set_theory /// - \subpage fennec_math_common /// - \subpage fennec_math_exponential /// - \subpage fennec_math_geometric /// - \subpage fennec_math_relational /// - \subpage fennec_math_trigonometric /// -/// -/// - - /// /// diff --git a/include/fennec/math/relational.h b/include/fennec/math/relational.h index e4909ba..ca3da20 100644 --- a/include/fennec/math/relational.h +++ b/include/fennec/math/relational.h @@ -48,7 +48,7 @@ /// \ref fennec::lessThan "bvec lessThan(ivec x, ivec y)"
/// \ref fennec::lessThan "bvec lessThan(uvec x, uvec y)" /// -/// \copydoc fennec::lessThan +/// \copydetails fennec::lessThan /// ///
/// \ref fennec::lessThanEqual "bvec lessThanEqual(vec x, vec y)"
@@ -56,7 +56,7 @@ /// \ref fennec::lessThanEqual "bvec lessThanEqual(ivec x, ivec y)"
/// \ref fennec::lessThanEqual "bvec lessThanEqual(uvec x, uvec y)" /// -/// \copydoc fennec::lessThanEqual +/// \copydetails fennec::lessThanEqual /// ///
/// \ref fennec::greaterThan "bvec greaterThan(vec x, vec y)"
@@ -64,7 +64,7 @@ /// \ref fennec::greaterThan "bvec greaterThan(ivec x, ivec y)"
/// \ref fennec::greaterThan "bvec greaterThan(uvec x, uvec y)" /// -/// \copydoc fennec::greaterThan +/// \copydetails fennec::greaterThan /// ///
/// \ref fennec::greaterThanEqual "bvec greaterThanEqual(vec x, vec y)"
@@ -72,7 +72,7 @@ /// \ref fennec::greaterThanEqual "bvec greaterThanEqual(ivec x, ivec y)"
/// \ref fennec::greaterThanEqual "bvec greaterThanEqual(uvec x, uvec y)" /// -/// \copydoc fennec::greaterThanEqual +/// \copydetails fennec::greaterThanEqual /// ///
/// \ref fennec::equal "bvec equal(vec x, vec y)"
@@ -80,7 +80,7 @@ /// \ref fennec::equal "bvec equal(ivec x, ivec y)"
/// \ref fennec::equal "bvec equal(uvec x, uvec y)" /// -/// \copydoc fennec::equal +/// \copydetails fennec::equal /// ///
/// \ref fennec::notEqual "bvec notEqual(vec x, vec y)"
@@ -88,22 +88,25 @@ /// \ref fennec::notEqual "bvec notEqual(ivec x, ivec y)"
/// \ref fennec::notEqual "bvec notEqual(uvec x, uvec y)" /// -/// \copydoc fennec::notEqual +/// \copydetails fennec::notEqual /// ///
/// \ref fennec::any "bool any(bvec x)"
/// -/// \copydoc fennec::any +/// \copydetails fennec::any /// ///
/// \ref fennec::all "bool all(bvec x)"
/// -/// \copydoc fennec::all +/// \copydetails fennec::all /// ///
-/// \ref fennec::operator! "bool not(bvec x)"
+/// \ref fennec_vector_not "bool not(bvec x)"
/// -/// \copydoc fennec::operator! +/// \details +/// \returns the component-wise logical complement of \f$x\f$.
+/// \param x the boolean vector to inverse
+/// /// /// /// @@ -199,13 +202,14 @@ constexpr genBType all(const vector& x) { return (x[i] && ...); } /// +/// \anchor fennec_vector_not /// \brief Returns the component-wise logical complement of \f$x\f$. /// /// \details /// \returns the component-wise logical complement of \f$x\f$. /// \param x the boolean vector to inverse template -constexpr genBType operator!(const vector& x) +constexpr genBType operator not(const vector& x) { return vector((!x[i]) ...); } }