docs(discretization/domain): added doxygen comments throughout

This commit is contained in:
2026-10-05 13:22:51 -04:00
parent 54dcd9f3f9
commit 36585a9682
15 changed files with 537 additions and 90 deletions

View File

@@ -1,5 +1,12 @@
#pragma once
/**
* @file results.hpp
* @author Emily M. Boudreaux
*
* @brief File containing the data structures used for representing the results of validating a schema against a mesh.
*/
#include <cstddef>
#include <optional>
#include <string_view>
@@ -11,28 +18,42 @@
// The aggregate result of validating a whole schema against a mesh
namespace serif::discretization::domain::schema::validation {
struct SchemaRelationValidationResult {
std::size_t relationIndex{0};
std::string_view relationName;
relation::validation::RelationValidationResult result;
[[nodiscard]] bool valid() const noexcept;
[[nodiscard]] explicit operator bool() const noexcept;
/**
* @struct SchemaRelationValidationResult
*
* @brief The result of validating a single relation against a mesh.
*/
struct SchemaRelationValidationResult {
std::size_t relationIndex{0}; ///< The index of the relation in the schema's relation list.
std::string_view relationName; ///< The name of the relation being validated.
relation::validation::RelationValidationResult result; ///< The result of validating the relation against the mesh.
[[nodiscard]] bool valid() const noexcept; ///< Check if the relation validation was successful.
[[nodiscard]] explicit operator bool() const noexcept; ///< Check if the relation validation was successful (explicit conversion to bool).
};
/**
* @struct SchemaValidationResult
*
* @brief The result of validating a schema against a mesh.
*/
struct SchemaValidationResult {
std::vector<SchemaRelationValidationResult> relationResults;
std::vector<SchemaRelationValidationResult> relationResults; ///< The results of validating each relation in the schema.
[[nodiscard]] bool valid() const noexcept;
[[nodiscard]] explicit operator bool() const noexcept;
[[nodiscard]] std::size_t relation_count() const noexcept;
[[nodiscard]] std::size_t failed_relation_count() const noexcept;
[[nodiscard]] std::size_t passed_relation_count() const noexcept;
[[nodiscard]] std::optional<std::size_t> first_failed_relation_index() const noexcept;
[[nodiscard]] bool valid() const noexcept; ///< Check if all relations in the schema validation were successful.
[[nodiscard]] explicit operator bool() const noexcept; ///< Check if all relations in the schema validation were successful (explicit conversion to bool).
[[nodiscard]] std::size_t relation_count() const noexcept; ///< Get the total number of relations in the schema.
[[nodiscard]] std::size_t failed_relation_count() const noexcept; ///< Get the number of relations that failed validation.
[[nodiscard]] std::size_t passed_relation_count() const noexcept; ///< Get the number of relations that passed validation.
[[nodiscard]] std::optional<std::size_t> first_failed_relation_index() const noexcept; ///< Get the index of the first failed relation, if any.
};
}
/**
* @brief Specialization of std::formatter for SchemaValidationResult to enable formatting with std::format.
*/
template <>
struct std::formatter<serif::discretization::domain::schema::validation::SchemaValidationResult> {
std::formatter<std::string> string_formatter;