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

Method getIntegerArgumentValue

src/measure/OSRunner.cpp:683–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681 }
682
683 int OSRunner::getIntegerArgumentValue(const std::string& argument_name, const std::map<std::string, OSArgument>& user_arguments) {
684 std::stringstream ss;
685
686 auto it = user_arguments.find(argument_name);
687 if (it != user_arguments.end()) {
688 if (it->second.hasValue()) {
689 return it->second.valueAsInteger();
690 } else if (it->second.hasDefaultValue()) {
691 return it->second.defaultValueAsInteger();
692 }
693 }
694
695 ss << "No value found for argument '" << argument_name << "'.";
696 if (it != user_arguments.end()) {
697 ss << " Full argument as passed in by user:" << '\n' << it->second;
698 }
699 registerError(ss.str());
700 LOG_AND_THROW(ss.str());
701 return 0;
702 }
703
704 boost::optional<int> OSRunner::getOptionalIntegerArgumentValue(const std::string& argument_name,
705 const std::map<std::string, OSArgument>& user_arguments) {

Callers 3

runMethod · 0.80
runMethod · 0.80
TEST_FFunction · 0.80

Calls 7

hasDefaultValueMethod · 0.80
defaultValueAsIntegerMethod · 0.80
findMethod · 0.45
endMethod · 0.45
hasValueMethod · 0.45
valueAsIntegerMethod · 0.45
strMethod · 0.45

Tested by 1

TEST_FFunction · 0.64