MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / getBoolArgumentValue

Method getBoolArgumentValue

src/measure/OSRunner.cpp:613–632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611 }
612
613 bool OSRunner::getBoolArgumentValue(const std::string& argument_name, const std::map<std::string, OSArgument>& user_arguments) {
614 std::stringstream ss;
615
616 auto it = user_arguments.find(argument_name);
617 if (it != user_arguments.end()) {
618 if (it->second.hasValue()) {
619 return it->second.valueAsBool();
620 } else if (it->second.hasDefaultValue()) {
621 return it->second.defaultValueAsBool();
622 }
623 }
624
625 ss << "No value found for argument '" << argument_name << "'.";
626 if (it != user_arguments.end()) {
627 ss << " Full argument as passed in by user:" << '\n' << it->second;
628 }
629 registerError(ss.str());
630 LOG_AND_THROW(ss.str());
631 return false;
632 }
633
634 boost::optional<bool> OSRunner::getOptionalBoolArgumentValue(const std::string& argument_name,
635 const std::map<std::string, OSArgument>& user_arguments) {

Callers 15

runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
modelOutputRequestsMethod · 0.80
modelOutputRequestsMethod · 0.80
runMethod · 0.80

Calls 7

valueAsBoolMethod · 0.80
hasDefaultValueMethod · 0.80
defaultValueAsBoolMethod · 0.80
findMethod · 0.45
endMethod · 0.45
hasValueMethod · 0.45
strMethod · 0.45

Tested by 1

TEST_FFunction · 0.64