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

Method setDomainType

src/measure/OSArgument.cpp:578–607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576 }
577
578 bool OSArgument::setDomainType(const OSDomainType& domainType) {
579 if (domainType != this->domainType()) {
580 // check whether domainType makes sense for type()
581 switch (domainType.value()) {
582 case OSDomainType::Interval:
583 switch (m_type.value()) {
584 case OSArgumentType::Boolean:
585 case OSArgumentType::String:
586 case OSArgumentType::Choice:
587 case OSArgumentType::Path:
588 LOG(Info, "OSDomainType " << domainType.valueName() << " does not make sense for " << "arguments of type " << m_type.valueName()
589 << ", such as " << name() << ".");
590 return false;
591 default:
592 break;
593 }
594 break;
595 case OSDomainType::Enumeration:
596 break;
597 default:
598 OS_ASSERT(false);
599 }
600
601 // if so, change and clear current domain
602 m_domainType = domainType;
603 m_domain.clear();
604 onChange();
605 }
606 return true;
607 }
608
609 bool OSArgument::setDomain(const std::vector<bool>& domain) {
610 bool result(false);

Callers 6

makeBoolArgumentMethod · 0.80
makeDoubleArgumentMethod · 0.80
makeIntegerArgumentMethod · 0.80
makeStringArgumentMethod · 0.80
makeChoiceArgumentMethod · 0.80
makePathArgumentMethod · 0.80

Calls 5

domainTypeMethod · 0.95
nameClass · 0.85
valueNameMethod · 0.80
valueMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected