mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-06 11:29:55 -05:00
Merge branch 'master' into feature/model-animation
* Resolve conflicts
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include <ghoul/glm.h>
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
#include <variant>
|
||||
|
||||
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<Verifier*> values);
|
||||
OrVerifier(const std::vector<std::variant<Verifier*,
|
||||
std::shared_ptr<Verifier>>> values);
|
||||
|
||||
/**
|
||||
* Checks whether the \p dictionary contains the \p key and whether this key passes
|
||||
|
||||
@@ -637,10 +637,17 @@ std::string AndVerifier::documentation() const {
|
||||
return ghoul::join(documentations, ", ");
|
||||
}
|
||||
|
||||
OrVerifier::OrVerifier(const std::vector<Verifier*> values_) {
|
||||
OrVerifier::OrVerifier(
|
||||
const std::vector<std::variant<Verifier*, std::shared_ptr<Verifier>>> values_)
|
||||
{
|
||||
ghoul_assert(!values_.empty(), "values must not be empty");
|
||||
for (Verifier* v : values_) {
|
||||
this->values.push_back(std::shared_ptr<Verifier>(v));
|
||||
for (const std::variant<Verifier*, std::shared_ptr<Verifier>>& v : values_) {
|
||||
if (std::holds_alternative<Verifier*>(v)) {
|
||||
this->values.push_back(std::shared_ptr<Verifier>(std::get<Verifier*>(v)));
|
||||
}
|
||||
else {
|
||||
this->values.push_back(std::get<std::shared_ptr<Verifier>>(v));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
Submodule support/coding/codegen updated: 37b4ff6f5a...b4190ea4c1
Reference in New Issue
Block a user