diff --git a/include/openspace/documentation/verifier.h b/include/openspace/documentation/verifier.h index 86b2ed1faa..34089dfb43 100644 --- a/include/openspace/documentation/verifier.h +++ b/include/openspace/documentation/verifier.h @@ -29,6 +29,7 @@ #include #include #include +#include namespace openspace::documentation { @@ -1005,8 +1006,15 @@ struct OrVerifier : public Verifier { * \param values The list of Verifiers that are to be tested * * \pre values must contain at least two values + * + * \todo: The use of the variant to use both raw pointers and shared pointers is + * definitely undesired. At the momement we are not handling the ownership of + * the verifiers very well and this must be cleaned up when doing a pass over + * the entire ownership model of the documentation/verifiers. For now it was + * necessary to make the codegen work in all cases without complications there */ - OrVerifier(const std::vector values); + OrVerifier(const std::vector>> values); /** * Checks whether the \p dictionary contains the \p key and whether this key passes diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp index 2e2e4f00d0..bfc64cd98c 100644 --- a/src/documentation/verifier.cpp +++ b/src/documentation/verifier.cpp @@ -637,10 +637,17 @@ std::string AndVerifier::documentation() const { return ghoul::join(documentations, ", "); } -OrVerifier::OrVerifier(const std::vector values_) { +OrVerifier::OrVerifier( + const std::vector>> values_) +{ ghoul_assert(!values_.empty(), "values must not be empty"); - for (Verifier* v : values_) { - this->values.push_back(std::shared_ptr(v)); + for (const std::variant>& v : values_) { + if (std::holds_alternative(v)) { + this->values.push_back(std::shared_ptr(std::get(v))); + } + else { + this->values.push_back(std::get>(v)); + } } } diff --git a/support/coding/codegen b/support/coding/codegen index 37b4ff6f5a..b4190ea4c1 160000 --- a/support/coding/codegen +++ b/support/coding/codegen @@ -1 +1 @@ -Subproject commit 37b4ff6f5a7d62fdacded6da12ef6d455cda9241 +Subproject commit b4190ea4c1240fcdec14b1bc5a57b8795a85e83b