From 20750c86aa75f9b33195bf0584feea3e25768138 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 20 Nov 2020 17:18:36 +0100 Subject: [PATCH] [chore] add a workflow for cppcheck and fix all cppcheck issues Suppress a few errors [chore] Pass std::string by const-ref: deal with the case where it's the first argument only ``` exts = [".hpp", "_Impl.hpp", ".cpp"] found_diffs = {} for file in files: found_diffs[file] = {} for ext in exts: try: with open(f"../{file}{ext}", 'r') as f: content = f.read() except FileNotFoundError: continue lines = content.splitlines() new_lines = [] has_diff = False for line in lines: if '(std::string ' in line: if not ext in found_diffs[file]: found_diffs[file][ext] = 1 else: found_diffs[file][ext] += 1 print(f"{file}{ext}, {line}") has_diff = True new_lines.append(line.replace('std::string', 'const std::string&')) else: new_lines.append(line) if has_diff: with open(f"../{file}{ext}", 'w') as f: f.write("\n".join(new_lines) + "\n") ``` Manually fix the rest of `passedByValue`cppcheck Correct a funcArgNamesDifferent and a typo in arg in Curves in french, independant... not independent like in enligsh, so pardon my french! Fix the funcArgNamesDifferent ScheduleTypeLimits: cannot pass const std::string& since string is mutated. Fix a lot more warnings, mostly missingOverride Fix a invalidPrintfArgType_sint warning by using fmt instead of sprintf (faster anyways) Fix a few more add a few more global suppressions False positives for Intersection: `[src/utilities/geometry/Intersection.cpp:158]:(warning),[constStatement],Found suspicious operator '>'` Fix a few more things Fix 60 cppcheck warnings in RoofGeometry_Details.hpp Fix isomodel noConstructor Fix last warnings in isomodel delete the copy/assignment operators for OutFiles instread of runtime error suppress something that was never implemented TODO: review please : Ignore a warning about RubyInterpreter::evalString that could be static Fix a few more warnings in ThreeJS cppcheck seems to be chocking on the gtest macros for these core tests, so ignore Not sure if it's really a problem, please double check `Using iterator to local container 'ws' that may be invalid.` I'm specifically excluding the nano folder from cppcheck (`-i src/nano`) yet cppcheck still reports a warning, so excluding it Ignore some false warnings about const Fix more More, almost there! Minor changes A bit more, almooooost Almost final tweaks, I have functional changes to Date::Date(std::string) to make clang-format touched files Update gitignore Suppress last one Tweak cppcheck: print progress to screen, and output problems to the file. 3>&1 1>&2 2>&3 is how you swap stderr and stdout, because tee can only accept stdout. --- .github/workflows/cppcheck.yml | 7 +- .gitignore | 2 + ci/colorize_cppcheck_results.py | 148 +++++++++ src/airflow/contam/PrjReader.hpp | 2 +- src/cli/RubyInterpreter.hpp | 2 + .../GenerateIddFactoryOutFiles.cpp | 1 + .../GenerateIddFactoryOutFiles.hpp | 10 +- src/generateiddfactory/IddFileFactoryData.cpp | 6 +- src/generateiddfactory/IddFileFactoryData.hpp | 4 +- src/isomodel/Building.hpp | 14 +- src/isomodel/Cooling.hpp | 12 +- src/isomodel/EpwData.cpp | 6 +- src/isomodel/Heating.hpp | 22 +- src/isomodel/Lighting.hpp | 8 +- src/isomodel/Location.hpp | 2 +- src/isomodel/Population.hpp | 14 +- src/isomodel/SimModel.cpp | 33 ++- src/isomodel/SimModel.hpp | 4 + src/isomodel/SolarRadiation.cpp | 8 + src/isomodel/Structure.hpp | 12 +- src/isomodel/TimeFrame.hpp | 2 +- src/isomodel/UserModel.cpp | 16 +- src/isomodel/UserModel.hpp | 264 ++++++++--------- src/isomodel/Ventilation.hpp | 16 +- ...irflowNetworkConstantPressureDrop_Impl.hpp | 4 +- src/model/AirflowNetworkCrack_Impl.hpp | 4 +- .../AirflowNetworkDetailedOpening_Impl.hpp | 4 +- .../AirflowNetworkDistributionLinkage.hpp | 4 +- ...AirflowNetworkDistributionLinkage_Impl.hpp | 4 +- .../AirflowNetworkDistributionNode_Impl.hpp | 4 +- .../AirflowNetworkDuctViewFactors_Impl.hpp | 5 +- src/model/AirflowNetworkDuct_Impl.hpp | 8 +- ...irflowNetworkEffectiveLeakageArea_Impl.hpp | 4 +- src/model/AirflowNetworkExternalNode_Impl.hpp | 4 +- .../AirflowNetworkHorizontalOpening_Impl.hpp | 4 +- src/model/AirflowNetworkLeakageRatio_Impl.hpp | 4 +- src/model/AirflowNetworkLinkage.cpp | 2 +- ...NetworkOccupantVentilationControl_Impl.hpp | 6 +- .../AirflowNetworkOutdoorAirflow_Impl.hpp | 4 +- ...owNetworkReferenceCrackConditions_Impl.hpp | 4 +- .../AirflowNetworkSimpleOpening_Impl.hpp | 4 +- .../AirflowNetworkSimulationControl_Impl.hpp | 16 +- src/model/AirflowNetworkSurface.cpp | 4 +- src/model/AirflowNetworkSurface.hpp | 6 +- src/model/AirflowNetworkSurface_Impl.hpp | 12 +- .../AirflowNetworkZoneExhaustFan_Impl.hpp | 4 +- src/model/AirflowNetworkZone_Impl.hpp | 16 +- src/model/Blind.cpp | 4 +- src/model/Blind.hpp | 2 +- src/model/Blind_Impl.hpp | 2 +- src/model/BoilerSteam.cpp | 6 +- src/model/BoilerSteam.hpp | 4 +- src/model/BoilerSteam_Impl.hpp | 4 +- ...lWaterHeatingAirToWaterHeatPumpWrapped.cpp | 4 +- ...lWaterHeatingAirToWaterHeatPumpWrapped.hpp | 2 +- ...rHeatingAirToWaterHeatPumpWrapped_Impl.hpp | 12 +- src/model/Connection.cpp | 2 +- src/model/ControllerWaterCoil.cpp | 8 +- src/model/ControllerWaterCoil.hpp | 4 +- src/model/ControllerWaterCoil_Impl.hpp | 4 +- src/model/CoolingTowerSingleSpeed.cpp | 26 +- src/model/CoolingTowerSingleSpeed.hpp | 12 +- src/model/CoolingTowerSingleSpeed_Impl.hpp | 8 +- src/model/CoolingTowerTwoSpeed.cpp | 12 +- src/model/CoolingTowerTwoSpeed.hpp | 8 +- src/model/CoolingTowerTwoSpeed_Impl.hpp | 4 +- src/model/CurveBicubic.cpp | 20 +- src/model/CurveBicubic.hpp | 6 +- src/model/CurveBicubic_Impl.hpp | 8 +- src/model/CurveBiquadratic.cpp | 20 +- src/model/CurveBiquadratic.hpp | 6 +- src/model/CurveBiquadratic_Impl.hpp | 8 +- src/model/CurveCubic.cpp | 14 +- src/model/CurveCubic.hpp | 4 +- src/model/CurveCubic_Impl.hpp | 6 +- src/model/CurveDoubleExponentialDecay.cpp | 14 +- src/model/CurveDoubleExponentialDecay.hpp | 4 +- .../CurveDoubleExponentialDecay_Impl.hpp | 6 +- src/model/CurveExponent.cpp | 14 +- src/model/CurveExponent.hpp | 4 +- src/model/CurveExponent_Impl.hpp | 6 +- src/model/CurveExponentialDecay.cpp | 14 +- src/model/CurveExponentialDecay.hpp | 4 +- src/model/CurveExponentialDecay_Impl.hpp | 6 +- src/model/CurveExponentialSkewNormal.cpp | 14 +- src/model/CurveExponentialSkewNormal.hpp | 4 +- src/model/CurveExponentialSkewNormal_Impl.hpp | 6 +- src/model/CurveFanPressureRise.cpp | 8 +- src/model/CurveFanPressureRise_Impl.hpp | 2 +- src/model/CurveFunctionalPressureDrop.cpp | 2 +- .../CurveFunctionalPressureDrop_Impl.hpp | 2 +- src/model/CurveLinear.cpp | 14 +- src/model/CurveLinear.hpp | 4 +- src/model/CurveLinear_Impl.hpp | 6 +- src/model/CurveQuadratic.cpp | 14 +- src/model/CurveQuadratic.hpp | 4 +- src/model/CurveQuadraticLinear.cpp | 20 +- src/model/CurveQuadraticLinear.hpp | 6 +- src/model/CurveQuadraticLinear_Impl.hpp | 8 +- src/model/CurveQuadratic_Impl.hpp | 6 +- src/model/CurveQuartic.cpp | 14 +- src/model/CurveQuartic.hpp | 4 +- src/model/CurveQuartic_Impl.hpp | 6 +- src/model/CurveRectangularHyperbola1.cpp | 14 +- src/model/CurveRectangularHyperbola1.hpp | 4 +- src/model/CurveRectangularHyperbola1_Impl.hpp | 6 +- src/model/CurveRectangularHyperbola2.cpp | 14 +- src/model/CurveRectangularHyperbola2.hpp | 4 +- src/model/CurveRectangularHyperbola2_Impl.hpp | 6 +- src/model/CurveSigmoid.cpp | 14 +- src/model/CurveSigmoid.hpp | 4 +- src/model/CurveSigmoid_Impl.hpp | 6 +- src/model/CurveTriquadratic.cpp | 26 +- src/model/CurveTriquadratic.hpp | 8 +- src/model/CurveTriquadratic_Impl.hpp | 10 +- src/model/DaylightingControl.cpp | 4 +- src/model/DaylightingControl.hpp | 2 +- src/model/DaylightingControl_Impl.hpp | 4 +- src/model/DesignDay.cpp | 16 +- src/model/DesignDay.hpp | 12 +- src/model/DesignDay_Impl.hpp | 8 +- src/model/DesignSpecificationOutdoorAir.cpp | 4 +- src/model/DesignSpecificationOutdoorAir.hpp | 2 +- .../DesignSpecificationOutdoorAir_Impl.hpp | 2 +- src/model/Duct.cpp | 2 +- ...lectricEquipmentITEAirCooledDefinition.cpp | 6 +- ...lectricEquipmentITEAirCooledDefinition.hpp | 5 +- src/model/ElectricLoadCenterTransformer.cpp | 3 +- ...yManagementSystemProgramCallingManager.cpp | 3 +- ...aporativeCoolerIndirectResearchSpecial.cpp | 2 +- src/model/EvaporativeFluidCoolerTwoSpeed.cpp | 14 +- src/model/EvaporativeFluidCoolerTwoSpeed.hpp | 8 +- .../EvaporativeFluidCoolerTwoSpeed_Impl.hpp | 6 +- src/model/ExternalInterfaceActuator_Impl.hpp | 4 +- ...ionalMockupUnitExportFromVariable_Impl.hpp | 4 +- ...ctionalMockupUnitExportToActuator_Impl.hpp | 4 +- ...ctionalMockupUnitExportToVariable_Impl.hpp | 4 +- ...nalInterfaceFunctionalMockupUnitImport.cpp | 4 +- ...nalInterfaceFunctionalMockupUnitImport.hpp | 2 +- ...ionalMockupUnitImportFromVariable_Impl.hpp | 4 +- ...ctionalMockupUnitImportToActuator_Impl.hpp | 4 +- ...ctionalMockupUnitImportToVariable_Impl.hpp | 4 +- ...terfaceFunctionalMockupUnitImport_Impl.hpp | 6 +- src/model/ExternalInterfaceVariable_Impl.hpp | 4 +- src/model/ExternalInterface_Impl.hpp | 4 +- src/model/FluidCoolerSingleSpeed.cpp | 4 +- src/model/FluidCoolerSingleSpeed.hpp | 2 +- src/model/FluidCoolerSingleSpeed_Impl.hpp | 2 +- src/model/FluidCoolerTwoSpeed.cpp | 4 +- src/model/FluidCoolerTwoSpeed.hpp | 2 +- src/model/FluidCoolerTwoSpeed_Impl.hpp | 2 +- src/model/GenericModelObject.cpp | 2 +- .../GroundHeatExchangerHorizontalTrench.cpp | 4 +- .../GroundHeatExchangerHorizontalTrench.hpp | 2 +- ...oundHeatExchangerHorizontalTrench_Impl.hpp | 2 +- src/model/HeaderedPumpsConstantSpeed.cpp | 2 +- src/model/HeaderedPumpsVariableSpeed.cpp | 2 +- src/model/MasslessOpaqueMaterial.cpp | 6 +- src/model/MasslessOpaqueMaterial.hpp | 4 +- src/model/MasslessOpaqueMaterial_Impl.hpp | 4 +- ...yMoisturePenetrationDepthSettings_Impl.hpp | 6 +- src/model/ModelExtensibleGroup.cpp | 2 +- src/model/PeopleDefinition.cpp | 4 +- src/model/PeopleDefinition.hpp | 2 +- src/model/PeopleDefinition_Impl.hpp | 2 +- ...tovoltaicPerformanceEquivalentOneDiode.cpp | 4 +- ...tovoltaicPerformanceEquivalentOneDiode.hpp | 2 +- ...taicPerformanceEquivalentOneDiode_Impl.hpp | 2 +- src/model/PipeIndoor.cpp | 4 +- src/model/PipeIndoor.hpp | 2 +- src/model/PipeIndoor_Impl.hpp | 2 +- src/model/PlantComponentTemperatureSource.cpp | 4 +- src/model/PlantComponentTemperatureSource.hpp | 2 +- .../PlantComponentTemperatureSource_Impl.hpp | 2 +- src/model/PumpConstantSpeed.cpp | 8 +- src/model/PumpConstantSpeed.hpp | 2 +- src/model/PumpConstantSpeed_Impl.hpp | 4 +- src/model/PumpVariableSpeed.cpp | 10 +- src/model/PumpVariableSpeed.hpp | 6 +- src/model/PumpVariableSpeed_Impl.hpp | 4 +- src/model/RadianceParameters.cpp | 22 +- src/model/RadianceParameters.hpp | 2 +- src/model/RadianceParameters_Impl.hpp | 4 +- .../RefrigerationCondenserWaterCooled.cpp | 8 +- .../RefrigerationCondenserWaterCooled.hpp | 4 +- ...RefrigerationCondenserWaterCooled_Impl.hpp | 4 +- src/model/RoofVegetation.cpp | 2 +- src/model/RoofVegetation.hpp | 8 +- src/model/ScheduleTypeLimits.cpp | 8 +- src/model/ScheduleTypeLimits.hpp | 6 +- src/model/ScheduleTypeLimits_Impl.hpp | 4 +- src/model/Screen.cpp | 8 +- src/model/Screen.hpp | 4 +- src/model/Screen_Impl.hpp | 4 +- .../SetpointManagerSingleZoneCooling.cpp | 4 +- .../SetpointManagerSingleZoneHeating.cpp | 4 +- .../SetpointManagerWarmestTemperatureFlow.cpp | 4 +- .../SetpointManagerWarmestTemperatureFlow.hpp | 2 +- ...ointManagerWarmestTemperatureFlow_Impl.hpp | 2 +- src/model/Shade.cpp | 4 +- src/model/Shade.hpp | 10 +- src/model/Shade_Impl.hpp | 12 +- src/model/SizingPlant.cpp | 14 +- src/model/SizingPlant.hpp | 8 +- src/model/SizingPlant_Impl.hpp | 8 +- .../SolarCollectorPerformanceFlatPlate.cpp | 8 +- .../SolarCollectorPerformanceFlatPlate.hpp | 4 +- ...olarCollectorPerformanceFlatPlate_Impl.hpp | 4 +- ...torPerformanceIntegralCollectorStorage.cpp | 4 +- ...torPerformanceIntegralCollectorStorage.hpp | 2 +- ...rformanceIntegralCollectorStorage_Impl.hpp | 2 +- ...orPerformancePhotovoltaicThermalSimple.hpp | 2 +- src/model/StandardGlazing.cpp | 7 +- src/model/StandardGlazing.hpp | 4 +- src/model/StandardGlazing_Impl.hpp | 6 +- src/model/StandardOpaqueMaterial.cpp | 8 +- src/model/StandardOpaqueMaterial.hpp | 4 +- src/model/StandardOpaqueMaterial_Impl.hpp | 2 +- src/model/TableMultiVariableLookup.cpp | 42 +-- src/model/TableMultiVariableLookup.hpp | 20 +- src/model/TableMultiVariableLookup_Impl.hpp | 24 +- .../ThermalStorageChilledWaterStratified.cpp | 14 +- .../ThermalStorageChilledWaterStratified.hpp | 8 +- ...rmalStorageChilledWaterStratified_Impl.hpp | 6 +- .../UnitarySystemPerformanceMultispeed.cpp | 15 +- .../UnitarySystemPerformanceMultispeed.hpp | 10 +- ...nitarySystemPerformanceMultispeed_Impl.hpp | 7 +- src/model/WaterUseEquipmentDefinition.cpp | 4 +- src/model/WaterUseEquipmentDefinition.hpp | 2 +- .../WaterUseEquipmentDefinition_Impl.hpp | 2 +- src/model/WindowPropertyFrameAndDivider.cpp | 36 +-- src/model/WindowPropertyFrameAndDivider.hpp | 2 +- .../WindowPropertyFrameAndDivider_Impl.hpp | 2 +- ...HVACEnergyRecoveryVentilatorController.cpp | 8 +- ...HVACEnergyRecoveryVentilatorController.hpp | 4 +- ...nergyRecoveryVentilatorController_Impl.hpp | 4 +- src/model/ZoneHVACIdealLoadsAirSystem.cpp | 42 +-- src/model/ZoneHVACIdealLoadsAirSystem.hpp | 14 +- .../ZoneHVACIdealLoadsAirSystem_Impl.hpp | 14 +- src/nano/nano_observer.hpp | 1 + src/radiance/AnnualIlluminanceMap.cpp | 4 +- src/radiance/AnnualIlluminanceMap.hpp | 2 +- src/utilities/bcl/BCL.cpp | 17 +- src/utilities/bcl/BCLMeasure.cpp | 31 +- src/utilities/bcl/BCLMeasure.hpp | 4 +- src/utilities/bcl/BCLMeasureArgument.cpp | 3 +- src/utilities/bcl/BCLMeasureOutput.cpp | 7 +- src/utilities/bcl/BCLXML.cpp | 40 ++- src/utilities/bcl/LocalBCL.cpp | 91 +++--- src/utilities/bcl/LocalBCL.hpp | 9 +- src/utilities/bcl/RemoteBCL.cpp | 27 +- src/utilities/bcl/RemoteBCL.hpp | 12 +- src/utilities/core/Compare.cpp | 2 +- src/utilities/core/Compare.hpp | 2 +- src/utilities/core/FileLogSink.cpp | 4 +- src/utilities/core/FilesystemHelpers.hpp | 4 +- src/utilities/core/LogMessage.hpp | 2 +- src/utilities/core/LogSink.cpp | 4 +- src/utilities/core/LogSink.hpp | 4 +- src/utilities/core/LogSink_Impl.hpp | 6 +- src/utilities/core/Path.cpp | 1 + src/utilities/core/String.cpp | 6 +- src/utilities/core/String.hpp | 2 +- src/utilities/core/StringHelpers.hpp | 2 +- src/utilities/core/System.cpp | 2 + .../test/ApplicationPathHelpers_GTest.cpp | 6 +- src/utilities/core/test/Finder_GTest.cpp | 2 + src/utilities/core/test/Logger_GTest.cpp | 1 + src/utilities/core/test/Optional_GTest.cpp | 1 + src/utilities/core/test/System_GTest.cpp | 1 + .../core/test/UpdateManager_GTest.cpp | 1 + src/utilities/data/Attribute.hpp | 4 +- src/utilities/data/CalibrationResult.hpp | 1 + src/utilities/data/Matrix.cpp | 2 +- src/utilities/data/Test/TimeSeries_GTest.cpp | 22 +- src/utilities/data/TimeSeries.cpp | 2 +- src/utilities/data/TimeSeries.hpp | 2 +- src/utilities/filetypes/CSVFile.cpp | 4 +- src/utilities/filetypes/CSVFile.hpp | 6 + src/utilities/filetypes/CSVFile_Impl.hpp | 7 +- src/utilities/filetypes/EpwFile.hpp | 3 +- src/utilities/filetypes/RunOptions.cpp | 8 +- src/utilities/filetypes/WorkflowJSON_Impl.hpp | 3 +- src/utilities/filetypes/WorkflowStep.cpp | 22 +- src/utilities/filetypes/WorkflowStep.hpp | 6 +- .../filetypes/WorkflowStepResult.cpp | 5 +- .../filetypes/WorkflowStepResult.hpp | 2 +- .../filetypes/WorkflowStepResult_Impl.hpp | 2 +- src/utilities/filetypes/WorkflowStep_Impl.hpp | 2 +- .../filetypes/test/CSVFile_GTest.cpp | 4 +- .../filetypes/test/WorkflowJSON_GTest.cpp | 4 +- src/utilities/geometry/BoundingBox.cpp | 2 +- src/utilities/geometry/BoundingBox.hpp | 2 +- src/utilities/geometry/FloorplanJS.cpp | 35 ++- src/utilities/geometry/FloorplanJS.hpp | 16 +- src/utilities/geometry/Geometry.cpp | 8 +- src/utilities/geometry/Intersection.cpp | 9 + src/utilities/geometry/Plane.cpp | 17 +- src/utilities/geometry/PointLatLon.cpp | 4 +- .../geometry/RoofGeometry_Details.hpp | 280 ++++++++---------- .../geometry/Test/Intersection_GTest.cpp | 2 - src/utilities/geometry/Test/Plane_GTest.cpp | 1 + src/utilities/geometry/Test/ThreeJS_GTest.cpp | 1 + src/utilities/geometry/ThreeJS.cpp | 10 +- src/utilities/geometry/ThreeJS.hpp | 22 +- src/utilities/geometry/Transformation.cpp | 4 +- src/utilities/idd/IddEnums.hpp | 1 + src/utilities/idd/IddFieldProperties.cpp | 14 +- src/utilities/idd/IddFile.hpp | 1 + src/utilities/idd/IddObject.cpp | 2 +- src/utilities/idd/Test/IddEnums_GTest.cpp | 2 + src/utilities/idd/Test/IddFactory_GTest.cpp | 2 + src/utilities/idd/Test/IddFile_GTest.cpp | 2 + src/utilities/idf/ImfFile.cpp | 7 +- src/utilities/idf/ImfFile.hpp | 1 + src/utilities/idf/ValidityEnums.hpp | 1 + src/utilities/idf/WorkspaceWatcher.cpp | 4 +- src/utilities/sql/SqlFile.cpp | 12 +- src/utilities/sql/SqlFile.hpp | 6 +- src/utilities/sql/SqlFileDataDictionary.hpp | 4 +- .../sql/Test/IlluminanceMap_GTest.cpp | 2 +- .../sql/Test/SqlFileTimeSeriesQuery_GTest.cpp | 2 +- src/utilities/time/DateTime.cpp | 20 +- src/utilities/units/IddUnitString.cpp | 4 +- src/utilities/units/IddUnitString.hpp | 4 +- src/utilities/units/Quantity.cpp | 2 + src/utilities/units/QuantityConverter.cpp | 4 +- src/utilities/units/QuantityRegex.cpp | 4 +- src/utilities/units/Unit.hpp | 4 + .../units/test/QuantityConverter_GTest.cpp | 1 + .../units/test/UnitFactory_GTest.cpp | 4 +- 331 files changed, 1594 insertions(+), 1405 deletions(-) create mode 100755 ci/colorize_cppcheck_results.py diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index 91e8d51f70a..0c9747bbc93 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -37,12 +37,15 @@ jobs: --inline-suppr \ --inconclusive \ --template='[{file}:{line}]:({severity}),[{id}],{message}' \ - --force -q -j $(nproc) \ + -j $(nproc) \ + --force \ -i src/cli/test \ -i src/airflow/contam \ -i src/polypartition \ -i src/nano \ - ./src 2>&1 | tee cppcheck.txt + ./src \ + 3>&1 1>&2 2>&3 | tee cppcheck.txt + - name: Parse and colorize cppcheck shell: bash diff --git a/.gitignore b/.gitignore index 3b867d38cf2..23f03d3d558 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ developer/msvc/Visualizers/all_concat.natvis *.sublime-projet *.cache .clangd/ +cppcheck.txt* +clang_format.patch diff --git a/ci/colorize_cppcheck_results.py b/ci/colorize_cppcheck_results.py new file mode 100755 index 00000000000..0c52f9a156e --- /dev/null +++ b/ci/colorize_cppcheck_results.py @@ -0,0 +1,148 @@ +import re +from collections import Counter + + +def colorize(lines): + def bold(s): + return '\x1b[1m{}\x1b[0m'.format(s) + + def red(s): + return '\x1b[31m{}\x1b[0m'.format(s) + + def green(s): + return '\x1b[32m{}\x1b[0m'.format(s) + + def yellow(s): + return '\x1b[33m{}\x1b[0m'.format(s) + + def blue(s): + return '\x1b[34m{}\x1b[0m'.format(s) + + def magenta(s): # purple + return '\x1b[35m{}\x1b[0m'.format(s) + + def cyan(s): + return '\x1b[36m{}\x1b[0m'.format(s) + + def format_severity(txt, severity): + """ + http://cppcheck.sourceforge.net/devinfo/doxyoutput/classSeverity.html + enum: + none, error, warning, style, performance, + portability, information, debug + """ + if severity == "none": + return txt + if severity == "error": + return red(txt) + if severity == "warning": + return yellow(txt) + if severity == 'style': + return blue(txt) + if severity == "performance": + return cyan(txt) + if severity == "portability": + return magenta(txt) + if severity == "information": + return green(txt) + if severity == "debug": + return txt + + return txt + + re_message = re.compile(r'\[(?P.*):(?P.*?)\]:' + r'\((?P.*?)\),\[(?P.*?)\],' + r'(?P.*)') + + colored_lines = [] + matched_messages = [] + + colored_lines = [] + matched_messages = [] + + for line in lines: + m = re_message.match(line) + if m: + d = m.groupdict() + matched_messages.append(d) + else: + colored_lines.append(red(line)) + + severity_order = ['error', 'warning', 'performance', 'portability', + 'style', 'information', 'debug', 'none'] + + counter = Counter(d['severity'] for d in matched_messages) + summary_line = "\n\n==========================================\n" + summary_line += " {}:\n".format(bold(red("CPPCHECK Summary"))) + summary_line += "------------------------------------------" + + for severity in severity_order: + n_severity = counter[severity] + summary_line += "\n * " + if n_severity: + summary_line += format_severity(n_severity, severity) + else: + # summary_line += green("No {}(s)".format(severity)) + summary_line += green("No") + summary_line += " {}(s)".format(format_severity(severity, severity)) + + summary_line += "\n==========================================\n\n" + + n_errors = counter['error'] + # if n_errors: + # summary_line += red("{} Errors".format(n_errors)) + # else: + # summary_line = green("No Errors") + + n_warnings = counter['warning'] + # if n_warnings: + # summary_line += yellow("{} Warnings".format(n_warnings)) + # else: + # summary_line = green("No Warnings") + + n_styles = counter['style'] + n_performances = counter['performance'] + n_portabilities = counter['portability'] + # n_informations = counter['information'] + + # n_debugs = counter['debug'] + + # Start by sorting by filename + matched_messages.sort(key=lambda d: d['file']) + matched_messages.sort(key=lambda d: severity_order.index(d['severity'])) + + # Now sort by the severity we cared about + for d in matched_messages: + + f = d['file'] + line = d['line'] + severity = d['severity'] + iid = d['id'] + message = d['message'] + + colored_lines.append( + "[{f}:{line}]:({severity}),[{i}],{message}" + .format(f=magenta(f), # format_severity(f, severity), + line=green(line), + severity=format_severity(severity, severity), + i=bold(iid), + message=message)) + + return (colored_lines, summary_line, n_errors, n_warnings, + n_performances, n_portabilities, n_styles) + + +if __name__ == '__main__': + with open('cppcheck.txt', 'r') as f: + content = f.read() + + lines = content.splitlines() + (colored_lines, summary_line, n_errors, n_warnings, + n_performances, n_portabilities, n_styles) = colorize(lines) + print(summary_line) + # sys.stdout.writelines(colored_lines) + print("\n".join(colored_lines)) + n_tot = (n_errors + n_warnings + n_performances + + n_portabilities + n_styles) + if n_tot > 0: + exit(1) diff --git a/src/airflow/contam/PrjReader.hpp b/src/airflow/contam/PrjReader.hpp index 1c4cf77cace..8294e34ee41 100644 --- a/src/airflow/contam/PrjReader.hpp +++ b/src/airflow/contam/PrjReader.hpp @@ -58,7 +58,7 @@ namespace contam { void skipSection(); std::string readSection(); - int lineNumber() { + int lineNumber() const { return m_lineNumber; } diff --git a/src/cli/RubyInterpreter.hpp b/src/cli/RubyInterpreter.hpp index f739f0f8ebd..1fe8f78b14c 100644 --- a/src/cli/RubyInterpreter.hpp +++ b/src/cli/RubyInterpreter.hpp @@ -756,6 +756,8 @@ class RubyInterpreter // evaluate a ruby statement with no return value. If a ruby exception is raised // the description is translated into a C++ exception, which is thrown as an openstudio::RubyException. + // TODO: should this be static? + // cppcheck-suppress functionStatic void evalString(const std::string& t_str) { VALUE val = rb_str_new2(t_str.c_str()); diff --git a/src/generateiddfactory/GenerateIddFactoryOutFiles.cpp b/src/generateiddfactory/GenerateIddFactoryOutFiles.cpp index 10dbe5140f0..90377d2d8a3 100644 --- a/src/generateiddfactory/GenerateIddFactoryOutFiles.cpp +++ b/src/generateiddfactory/GenerateIddFactoryOutFiles.cpp @@ -55,6 +55,7 @@ std::string IddFactoryOutFile::finalize(const std::string& oldChecksum) { // ETH@20111122 Always copy for now. CMake/build process can't yet handle "sometimes generated" // files. bool copyFile = true; // (newChecksum != oldChecksum); + // cppcheck-suppress knownConditionTrueFalse if (copyFile) { if (openstudio::filesystem::exists(finalPath)) { openstudio::filesystem::remove(finalPath); diff --git a/src/generateiddfactory/GenerateIddFactoryOutFiles.hpp b/src/generateiddfactory/GenerateIddFactoryOutFiles.hpp index 5b868aa4c00..1dc4a79745d 100644 --- a/src/generateiddfactory/GenerateIddFactoryOutFiles.hpp +++ b/src/generateiddfactory/GenerateIddFactoryOutFiles.hpp @@ -49,13 +49,9 @@ struct IddFactoryOutFile IddFactoryOutFile(const std::string& filename, const openstudio::path& outPath, const std::string& outFileHeader); - IddFactoryOutFile(const IddFactoryOutFile& other) { - throw std::runtime_error("Cannot copy IddFactoryOutFiles."); - } - - IddFactoryOutFile operator=(const IddFactoryOutFile& other) { - throw std::runtime_error("Cannot copy IddFactoryOutFiles."); - } + // Prevent copy and assignment + IddFactoryOutFile(const IddFactoryOutFile&) = delete; + IddFactoryOutFile operator=(const IddFactoryOutFile&) = delete; std::string finalize(const std::string& oldChecksum); }; diff --git a/src/generateiddfactory/IddFileFactoryData.cpp b/src/generateiddfactory/IddFileFactoryData.cpp index 21553e4ccb0..2e34c037563 100644 --- a/src/generateiddfactory/IddFileFactoryData.cpp +++ b/src/generateiddfactory/IddFileFactoryData.cpp @@ -345,6 +345,8 @@ void IddFileFactoryData::parseFile(const path& outPath, const std::string& outFi << std::endl; } assert(!fieldNames.empty()); + // cppcheck 1.x chokes on this, 2.3 doesn't, but ignore it in case someone has an older version + // cppcheck-suppress containerOutOfBounds fieldName = fieldNames.back(); // strip out numbers and transfer from fieldNames to extensibleFieldNames fieldName = boost::regex_replace(fieldName, boost::regex("\\s?[0-9]+"), ""); @@ -402,7 +404,7 @@ IddFileFactoryData::FileNameRemovedObjectsPair IddFileFactoryData::includedFile( return m_includedFiles[index]; } -std::string IddFileFactoryData::m_convertName(const std::string& originalName) const { +std::string IddFileFactoryData::m_convertName(const std::string& originalName) { std::string result(originalName); boost::trim(result); result = boost::regex_replace(result, boost::regex("^100 ?%"), "All"); @@ -416,7 +418,7 @@ std::string IddFileFactoryData::m_convertName(const std::string& originalName) c return result; } -std::string IddFileFactoryData::m_readyLineForOutput(const std::string& line) const { +std::string IddFileFactoryData::m_readyLineForOutput(const std::string& line) { std::string result(line); result = boost::regex_replace(result, boost::regex("\\\\"), "\\\\\\\\"); result = boost::regex_replace(result, boost::regex("\""), "\\\\\""); diff --git a/src/generateiddfactory/IddFileFactoryData.hpp b/src/generateiddfactory/IddFileFactoryData.hpp index fd0df55f023..2a38e61e62f 100644 --- a/src/generateiddfactory/IddFileFactoryData.hpp +++ b/src/generateiddfactory/IddFileFactoryData.hpp @@ -73,8 +73,8 @@ class IddFileFactoryData std::vector m_objectNames; // first is cleaned version std::vector m_includedFiles; - std::string m_convertName(const std::string& originalName) const; - std::string m_readyLineForOutput(const std::string& line) const; + static std::string m_convertName(const std::string& originalName); + static std::string m_readyLineForOutput(const std::string& line); }; typedef std::vector IddFileFactoryDataVector; diff --git a/src/isomodel/Building.hpp b/src/isomodel/Building.hpp index db28375d1dd..4eaee296929 100644 --- a/src/isomodel/Building.hpp +++ b/src/isomodel/Building.hpp @@ -80,13 +80,13 @@ namespace isomodel { } private: - double _lightingOccupancySensor; - double _constantIllumination; - double _electricApplianceHeatGainOccupied; - double _electricApplianceHeatGainUnoccupied; - double _gasApplianceHeatGainOccupied; - double _gasApplianceHeatGainUnoccupied; - double _buildingEnergyManagement; + double _lightingOccupancySensor = 0; + double _constantIllumination = 0; + double _electricApplianceHeatGainOccupied = 0; + double _electricApplianceHeatGainUnoccupied = 0; + double _gasApplianceHeatGainOccupied = 0; + double _gasApplianceHeatGainUnoccupied = 0; + double _buildingEnergyManagement = 0; }; } // namespace isomodel diff --git a/src/isomodel/Cooling.hpp b/src/isomodel/Cooling.hpp index 98b71137a47..4eace801b4b 100644 --- a/src/isomodel/Cooling.hpp +++ b/src/isomodel/Cooling.hpp @@ -74,12 +74,12 @@ namespace isomodel { } private: - double _temperatureSetPointOccupied; - double _temperatureSetPointUnoccupied; - double _cOP; - double _partialLoadValue; - double _hvacLossFactor; - double _pumpControlReduction; + double _temperatureSetPointOccupied = 0; + double _temperatureSetPointUnoccupied = 0; + double _cOP = 0; + double _partialLoadValue = 0; + double _hvacLossFactor = 0; + double _pumpControlReduction = 0; }; } // namespace isomodel diff --git a/src/isomodel/EpwData.cpp b/src/isomodel/EpwData.cpp index c04c35ec254..7e5908c4404 100644 --- a/src/isomodel/EpwData.cpp +++ b/src/isomodel/EpwData.cpp @@ -170,9 +170,9 @@ namespace isomodel { return sstream.str(); } - void EpwData::loadData(const openstudio::path& fn) { + void EpwData::loadData(const openstudio::path& t_path) { // Array was fully initialized in constructor - std::ifstream myfile(openstudio::toSystemFilename(fn)); + std::ifstream myfile(openstudio::toSystemFilename(t_path)); if (myfile.is_open()) { size_t i = 0; size_t row = 0; @@ -188,7 +188,7 @@ namespace isomodel { } myfile.close(); } else { - throw std::runtime_error("Unable to open weather file: " + openstudio::toString(fn)); + throw std::runtime_error("Unable to open weather file: " + openstudio::toString(t_path)); } } } // namespace isomodel diff --git a/src/isomodel/Heating.hpp b/src/isomodel/Heating.hpp index 0ca10627b77..ecef087a7e6 100644 --- a/src/isomodel/Heating.hpp +++ b/src/isomodel/Heating.hpp @@ -104,17 +104,17 @@ namespace isomodel { } private: - double _temperatureSetPointOccupied; - double _temperatureSetPointUnoccupied; - double _hvacLossFactor; - double _efficiency; - double _energyType; - double _pumpControlReduction; - double _hotWaterDemand; - double _hotWaterDistributionEfficiency; - double _hotWaterSystemEfficiency; - double _hotWaterEnergyType; - double _hotcoldWasteFactor; + double _temperatureSetPointOccupied = 0; + double _temperatureSetPointUnoccupied = 0; + double _hvacLossFactor = 0; + double _efficiency = 0; + double _energyType = 0; + double _pumpControlReduction = 0; + double _hotWaterDemand = 0; + double _hotWaterDistributionEfficiency = 0; + double _hotWaterSystemEfficiency = 0; + double _hotWaterEnergyType = 0; + double _hotcoldWasteFactor = 0; }; } // namespace isomodel diff --git a/src/isomodel/Lighting.hpp b/src/isomodel/Lighting.hpp index 46b6884d74d..9af635945c4 100644 --- a/src/isomodel/Lighting.hpp +++ b/src/isomodel/Lighting.hpp @@ -62,10 +62,10 @@ namespace isomodel { } private: - double _powerDensityOccupied; - double _powerDensityUnoccupied; - double _dimmingFraction; - double _exteriorEnergy; + double _powerDensityOccupied = 0; + double _powerDensityUnoccupied = 0; + double _dimmingFraction = 0; + double _exteriorEnergy = 0; }; } // namespace isomodel diff --git a/src/isomodel/Location.hpp b/src/isomodel/Location.hpp index 3834f1e6a71..b4aeaf83e92 100644 --- a/src/isomodel/Location.hpp +++ b/src/isomodel/Location.hpp @@ -52,7 +52,7 @@ namespace isomodel { } private: - double _terrain; + double _terrain = 0; std::shared_ptr _weather; }; diff --git a/src/isomodel/Population.hpp b/src/isomodel/Population.hpp index cd5901cff99..2488285c186 100644 --- a/src/isomodel/Population.hpp +++ b/src/isomodel/Population.hpp @@ -80,13 +80,13 @@ namespace isomodel { } private: - double _hoursEnd; - double _hoursStart; - double _daysEnd; - double _daysStart; - double _densityOccupied; - double _densityUnoccupied; - double _heatGainPerPerson; + double _hoursEnd = 0; + double _hoursStart = 0; + double _daysEnd = 0; + double _daysStart = 0; + double _densityOccupied = 0; + double _densityUnoccupied = 0; + double _heatGainPerPerson = 0; }; } // namespace isomodel diff --git a/src/isomodel/SimModel.cpp b/src/isomodel/SimModel.cpp index 45ec76d0ade..85834089bbe 100644 --- a/src/isomodel/SimModel.cpp +++ b/src/isomodel/SimModel.cpp @@ -40,15 +40,15 @@ namespace openstudio { namespace isomodel { double ISOResults::totalEnergyUse() const { - double sum = 0; + double result = 0; std::vector fuelTypes = openstudio::EndUses::fuelTypes(); for (const auto& monthlyResult : monthlyResults) { for (const auto& fuelType : fuelTypes) { - sum += monthlyResult.getEndUseByFuelType(fuelType); + result += monthlyResult.getEndUseByFuelType(fuelType); } } - return sum; + return result; } void SimModel::printVector(const char* vecName, const Vector& vec) { @@ -338,8 +338,9 @@ namespace isomodel { Matrix m_mhEgh = location->weather()->mhEgh(); Matrix m_mhdbt = location->weather()->mhdbt(); - Vector v_Tdbt_Day = prod(m_mhdbt, clockHourOccupied); - v_Tdbt_Day /= sum(clockHourOccupied); + // TODO: unreadVariable + // Vector v_Tdbt_Day = prod(m_mhdbt, clockHourOccupied); + // v_Tdbt_Day /= sum(clockHourOccupied); v_Tdbt_nt = prod(m_mhdbt, clockHourUnoccupied); v_Tdbt_nt /= sum(clockHourUnoccupied); @@ -386,8 +387,9 @@ frac_Pgh_wke_nt=v_Wgh_wke_nt./v_Wgh_tot; %frac_Egh_unocc_weekend_night */ Vector v_frac_hrs_sun_down = Vector(12); Vector v_frac_hrs_sun_up = Vector(12); - Vector v_sun_up_time = Vector(12); - Vector v_sun_down_time = Vector(12); + // TODO: unreadVariable + // Vector v_sun_up_time = Vector(12); + // Vector v_sun_down_time = Vector(12); for (int i = 0; i < 12; i++) { v_frac_hrs_sun_up[i] = 0; v_frac_hrs_sun_down[i] = 0; @@ -1122,11 +1124,11 @@ if T_ht_ctrl_flag ==1 % if the HVAC heating controls are turned on.*/ } } for (size_t i = 0; i < v_Th_wke_avg.size(); i++) { - double sum = 0; + double thisSum = 0; for (size_t j = 0; j < M_Tb.size2(); j++) { - sum += M_Tb(i, j); + thisSum += M_Tb(i, j); } - v_Th_wke_avg[i] = sum / M_Tb.size2(); + v_Th_wke_avg[i] = thisSum / M_Tb.size2(); } for (size_t j = 0; j < M_Tb.size1(); j++) { v_Th_wk_nt[j] = M_Tb(j, 1); @@ -1208,11 +1210,11 @@ if T_cl_ctrl_flag ==1 % if the HVAC cooling controls are on } for (size_t i = 0; i < v_Th_wke_avg.size(); i++) { - double sum = 0; + double thisSum = 0; for (size_t j = 0; j < M_Td.size2(); j++) { - sum += M_Td(i, j); + thisSum += M_Td(i, j); } - v_Tc_wke_avg[i] = sum / M_Td.size2(); + v_Tc_wke_avg[i] = thisSum / M_Td.size2(); } for (size_t j = 0; j < M_Td.size1(); j++) { v_Tc_wk_nt[j] = M_Td(j, 1); @@ -1715,12 +1717,16 @@ v_Qloss_cl_dist = v_Qneed_cl*(1-eta_dist_cl)/eta_dist_cl; %losses from HVAC coo zero(v_Qht_DH); zero(v_Qcl_sys); zero(v_Qcool_DC); + // TODO: always true right now + // cppcheck-suppress knownConditionTrueFalse if (DH_YesNo == 1) { v_Qht_DH = sum(v_Qneed_ht, v_Qloss_ht_dist); } else { v_Qht_sys = div(sum(v_Qloss_ht_dist, v_Qneed_ht), heating->efficiency() + std::numeric_limits::min()); } + // TODO: always true right now + // cppcheck-suppress knownConditionTrueFalse if (DC_YesNo == 1) { v_Qcool_DC = sum(v_Qneed_cl, v_Qloss_cl_dist); } else { @@ -1754,6 +1760,7 @@ end printVector("v_Qcl_DC_elec", v_Qcl_DC_elec); printVector("v_Qcl_DC_abs", v_Qcl_DC_abs); + // cppcheck-suppress invalidFunctionArg Vector v_Qht_DH_total = div(mult(v_Qht_DH, 1 - n_frac_DH_free), n_eta_DH_sys * n_eta_DH_network); v_Qcl_elec_tot = sum(v_Qcl_sys, v_Qcl_DC_elec); v_Qcl_gas_tot = v_Qcl_DC_abs; diff --git a/src/isomodel/SimModel.hpp b/src/isomodel/SimModel.hpp index b84d9c878ec..5f315f4fe57 100644 --- a/src/isomodel/SimModel.hpp +++ b/src/isomodel/SimModel.hpp @@ -157,7 +157,11 @@ namespace isomodel { void hvac(const Vector& v_Qneed_ht, const Vector& v_Qneed_cl, double Qneed_ht_yr, double Qneed_cl_yr, Vector& v_Qelec_ht, Vector& v_Qgas_ht, Vector& v_Qcl_elec_tot, Vector& v_Qcl_gas_tot) const; void pump(const Vector& v_Qneed_ht, const Vector& v_Qneed_cl, double Qneed_ht_yr, double Qneed_cl_yr, Vector& v_Q_pump_tot) const; + + // TODO: Not implemented yet + // cppcheck-suppress functionStatic void energyGeneration() const; + void heatedWater(Vector& v_Q_dhw_elec, Vector& v_Q_dhw_gas) const; ISOResults outputGeneration(const Vector& v_Qelec_ht, const Vector& v_Qcl_elec_tot, const Vector& v_Q_illum_tot, const Vector& v_Q_illum_ext_tot, diff --git a/src/isomodel/SolarRadiation.cpp b/src/isomodel/SolarRadiation.cpp index d4f8cc20658..f57ef8ad1b2 100644 --- a/src/isomodel/SolarRadiation.cpp +++ b/src/isomodel/SolarRadiation.cpp @@ -187,10 +187,15 @@ namespace isomodel { cnt = 0; } //accumulate data into bins + // cppcheck-suppress negativeContainerIndex m_monthlyDryBulbTemp[midx] += vecDBT[i]; + // cppcheck-suppress negativeContainerIndex m_monthlyDewPointTemp[midx] += vecDPT[i]; + // cppcheck-suppress negativeContainerIndex m_monthlyRelativeHumidity[midx] += vecRH[i]; + // cppcheck-suppress negativeContainerIndex m_monthlyGlobalHorizontalRadiation[midx] += vecEGH[i]; + // cppcheck-suppress negativeContainerIndex m_monthlyWindspeed[midx] += vecWSPD[i]; //std::stringstream ss; @@ -201,8 +206,11 @@ namespace isomodel { //LOG(Trace, "solarRad / eglobe " << ss.str()); int h = m_frame.Hour[i] - 1; + // cppcheck-suppress negativeContainerIndex m_hourlyDryBulbTemp[midx][h] += vecDBT[i]; + // cppcheck-suppress negativeContainerIndex m_hourlyDewPointTemp[midx][h] += vecDPT[i]; + // cppcheck-suppress negativeContainerIndex m_hourlyGlobalHorizontalRadiation[midx][h] += vecEGH[i]; } //final month average diff --git a/src/isomodel/Structure.hpp b/src/isomodel/Structure.hpp index cb929ff17aa..243525d57f6 100644 --- a/src/isomodel/Structure.hpp +++ b/src/isomodel/Structure.hpp @@ -123,20 +123,20 @@ namespace isomodel { } private: - double _floorArea; + double _floorArea = 0; Vector _wallArea; Vector _windowArea; Vector _wallUniform; Vector _windowUniform; Vector _wallThermalEmissivity; Vector _wallSolarAbsorbtion; - double _windowShadingDevice; + double _windowShadingDevice = 0; Vector _windowNormalIncidenceSolarEnergyTransmittance; Vector _windowShadingCorrectionFactor; - double _interiorHeatCapacity; - double _wallHeatCapacity; - double _buildingHeight; - double _infiltrationRate; + double _interiorHeatCapacity = 0; + double _wallHeatCapacity = 0; + double _buildingHeight = 0; + double _infiltrationRate = 0; }; } // namespace isomodel diff --git a/src/isomodel/TimeFrame.hpp b/src/isomodel/TimeFrame.hpp index ff63d236afb..9a523461258 100644 --- a/src/isomodel/TimeFrame.hpp +++ b/src/isomodel/TimeFrame.hpp @@ -40,7 +40,7 @@ namespace isomodel { TimeFrame(); - int monthLength(int month); + static int monthLength(int month); int YTD[TIMESLICES], Hour[TIMESLICES], Day[TIMESLICES], Month[TIMESLICES]; }; } // namespace isomodel diff --git a/src/isomodel/UserModel.cpp b/src/isomodel/UserModel.cpp index e310046caae..cb5324347b3 100644 --- a/src/isomodel/UserModel.cpp +++ b/src/isomodel/UserModel.cpp @@ -560,9 +560,9 @@ namespace isomodel { LOG(Error, "Unknown Attribute: " << attributeName << " = " << attributeValue); } } - void UserModel::loadBuilding(const openstudio::path& buildingFile) { + void UserModel::loadBuilding(const openstudio::path& t_buildingFile) { string line; - ifstream inputFile(openstudio::toSystemFilename(buildingFile)); + ifstream inputFile(openstudio::toSystemFilename(t_buildingFile)); if (inputFile.is_open()) { while (inputFile.good()) { getline(inputFile, line); @@ -571,7 +571,7 @@ namespace isomodel { } inputFile.close(); } else { - LOG(Error, "Unable to open file" << openstudio::toString(buildingFile)); + LOG(Error, "Unable to open file" << openstudio::toString(t_buildingFile)); } } int UserModel::weatherState(const std::string& header) { @@ -627,15 +627,15 @@ namespace isomodel { return wdata; } - void UserModel::load(const openstudio::path& buildingFile) { - _dataFile = buildingFile; + void UserModel::load(const openstudio::path& t_buildingFile) { + _dataFile = t_buildingFile; _valid = true; - if (!openstudio::filesystem::exists(buildingFile)) { - LOG(Error, "ISO Model File Not Found: " << openstudio::toString(buildingFile)); + if (!openstudio::filesystem::exists(t_buildingFile)) { + LOG(Error, "ISO Model File Not Found: " << openstudio::toString(t_buildingFile)); _valid = false; return; } - loadBuilding(buildingFile); + loadBuilding(t_buildingFile); _weather = loadWeather(); } diff --git a/src/isomodel/UserModel.hpp b/src/isomodel/UserModel.hpp index dd28dbef5f2..c3f4721acdd 100644 --- a/src/isomodel/UserModel.hpp +++ b/src/isomodel/UserModel.hpp @@ -884,158 +884,158 @@ namespace isomodel { REGISTER_LOGGER("openstudio.isomodel.UserModel"); std::shared_ptr _weather; - bool _valid; - double _terrainClass; - double _floorArea; - double _buildingHeight; - double _buildingOccupancyFrom; - double _buildingOccupancyTo; - double _equivFullLoadOccupancyFrom; - double _equivFullLoadOccupancyTo; - double _peopleDensityOccupied; - double _peopleDensityUnoccupied; - double _heatingOccupiedSetpoint; - double _heatingUnoccupiedSetpoint; - double _coolingOccupiedSetpoint; - double _coolingUnoccupiedSetpoint; - double _elecPowerAppliancesOccupied; - double _elecPowerAppliancesUnoccupied; - double _gasPowerAppliancesOccupied; - double _gasPowerAppliancesUnoccupied; - double _lightingPowerIntensityOccupied; - double _lightingPowerIntensityUnoccupied; - double _exteriorLightingPower; - double _daylightSensorSystem; - double _lightingOccupancySensorSystem; - double _constantIlluminationControl; - double _coolingSystemCOP; - double _coolingSystemIPLVToCOPRatio; - double _heatingEnergyCarrier; - double _heatingSystemEfficiency; - double _ventilationType; - double _freshAirFlowRate; - double _supplyExhaustRate; - double _heatRecovery; - double _exhaustAirRecirculation; - double _buildingAirLeakage; - double _dhwDemand; - double _dhwEfficiency; - double _dhwDistributionSystem; - double _dhwEnergyCarrier; - double _bemType; - double _interiorHeatCapacity; - double _specificFanPower; - double _fanFlowControlFactor; - double _roofSHGC; + bool _valid = true; + double _terrainClass = 0; + double _floorArea = 0; + double _buildingHeight = 0; + double _buildingOccupancyFrom = 0; + double _buildingOccupancyTo = 0; + double _equivFullLoadOccupancyFrom = 0; + double _equivFullLoadOccupancyTo = 0; + double _peopleDensityOccupied = 0; + double _peopleDensityUnoccupied = 0; + double _heatingOccupiedSetpoint = 0; + double _heatingUnoccupiedSetpoint = 0; + double _coolingOccupiedSetpoint = 0; + double _coolingUnoccupiedSetpoint = 0; + double _elecPowerAppliancesOccupied = 0; + double _elecPowerAppliancesUnoccupied = 0; + double _gasPowerAppliancesOccupied = 0; + double _gasPowerAppliancesUnoccupied = 0; + double _lightingPowerIntensityOccupied = 0; + double _lightingPowerIntensityUnoccupied = 0; + double _exteriorLightingPower = 0; + double _daylightSensorSystem = 0; + double _lightingOccupancySensorSystem = 0; + double _constantIlluminationControl = 0; + double _coolingSystemCOP = 0; + double _coolingSystemIPLVToCOPRatio = 0; + double _heatingEnergyCarrier = 0; + double _heatingSystemEfficiency = 0; + double _ventilationType = 0; + double _freshAirFlowRate = 0; + double _supplyExhaustRate = 0; + double _heatRecovery = 0; + double _exhaustAirRecirculation = 0; + double _buildingAirLeakage = 0; + double _dhwDemand = 0; + double _dhwEfficiency = 0; + double _dhwDistributionSystem = 0; + double _dhwEnergyCarrier = 0; + double _bemType = 0; + double _interiorHeatCapacity = 0; + double _specificFanPower = 0; + double _fanFlowControlFactor = 0; + double _roofSHGC = 0; /* Area */ - double _wallAreaS; - double _wallAreaSE; - double _wallAreaE; - double _wallAreaNE; - double _wallAreaN; - double _wallAreaNW; - double _wallAreaW; - double _wallAreaSW; - double _roofArea; + double _wallAreaS = 0; + double _wallAreaSE = 0; + double _wallAreaE = 0; + double _wallAreaNE = 0; + double _wallAreaN = 0; + double _wallAreaNW = 0; + double _wallAreaW = 0; + double _wallAreaSW = 0; + double _roofArea = 0; /* UValue */ - double _wallUvalueS; - double _wallUvalueSE; - double _wallUvalueE; - double _wallUvalueNE; - double _wallUvalueN; - double _wallUvalueNW; - double _wallUvalueW; - double _wallUvalueSW; - double _roofUValue; + double _wallUvalueS = 0; + double _wallUvalueSE = 0; + double _wallUvalueE = 0; + double _wallUvalueNE = 0; + double _wallUvalueN = 0; + double _wallUvalueNW = 0; + double _wallUvalueW = 0; + double _wallUvalueSW = 0; + double _roofUValue = 0; /* SolarAbsorption */ - double _wallSolarAbsorptionS; - double _wallSolarAbsorptionSE; - double _wallSolarAbsorptionE; - double _wallSolarAbsorptionNE; - double _wallSolarAbsorptionN; - double _wallSolarAbsorptionNW; - double _wallSolarAbsorptionW; - double _wallSolarAbsorptionSW; - double _roofSolarAbsorption; + double _wallSolarAbsorptionS = 0; + double _wallSolarAbsorptionSE = 0; + double _wallSolarAbsorptionE = 0; + double _wallSolarAbsorptionNE = 0; + double _wallSolarAbsorptionN = 0; + double _wallSolarAbsorptionNW = 0; + double _wallSolarAbsorptionW = 0; + double _wallSolarAbsorptionSW = 0; + double _roofSolarAbsorption = 0; /* ThermalEmissivity */ - double _wallThermalEmissivityS; - double _wallThermalEmissivitySE; - double _wallThermalEmissivityE; - double _wallThermalEmissivityNE; - double _wallThermalEmissivityN; - double _wallThermalEmissivityNW; - double _wallThermalEmissivityW; - double _wallThermalEmissivitySW; - double _roofThermalEmissivity; + double _wallThermalEmissivityS = 0; + double _wallThermalEmissivitySE = 0; + double _wallThermalEmissivityE = 0; + double _wallThermalEmissivityNE = 0; + double _wallThermalEmissivityN = 0; + double _wallThermalEmissivityNW = 0; + double _wallThermalEmissivityW = 0; + double _wallThermalEmissivitySW = 0; + double _roofThermalEmissivity = 0; - double _windowAreaS; - double _windowAreaSE; - double _windowAreaE; - double _windowAreaNE; - double _windowAreaN; - double _windowAreaNW; - double _windowAreaW; - double _windowAreaSW; - double _skylightArea; + double _windowAreaS = 0; + double _windowAreaSE = 0; + double _windowAreaE = 0; + double _windowAreaNE = 0; + double _windowAreaN = 0; + double _windowAreaNW = 0; + double _windowAreaW = 0; + double _windowAreaSW = 0; + double _skylightArea = 0; - double _windowUvalueS; - double _windowUvalueSE; - double _windowUvalueE; - double _windowUvalueNE; - double _windowUvalueN; - double _windowUvalueNW; - double _windowUvalueW; - double _windowUvalueSW; - double _skylightUvalue; + double _windowUvalueS = 0; + double _windowUvalueSE = 0; + double _windowUvalueE = 0; + double _windowUvalueNE = 0; + double _windowUvalueN = 0; + double _windowUvalueNW = 0; + double _windowUvalueW = 0; + double _windowUvalueSW = 0; + double _skylightUvalue = 0; - double _windowSHGCS; - double _windowSHGCSE; - double _windowSHGCE; - double _windowSHGCNE; - double _windowSHGCN; - double _windowSHGCNW; - double _windowSHGCW; - double _windowSHGCSW; - double _skylightSHGC; + double _windowSHGCS = 0; + double _windowSHGCSE = 0; + double _windowSHGCE = 0; + double _windowSHGCNE = 0; + double _windowSHGCN = 0; + double _windowSHGCNW = 0; + double _windowSHGCW = 0; + double _windowSHGCSW = 0; + double _skylightSHGC = 0; - double _windowSCFS; - double _windowSCFSE; - double _windowSCFE; - double _windowSCFNE; - double _windowSCFN; - double _windowSCFNW; - double _windowSCFW; - double _windowSCFSW; + double _windowSCFS = 0; + double _windowSCFSE = 0; + double _windowSCFE = 0; + double _windowSCFNE = 0; + double _windowSCFN = 0; + double _windowSCFNW = 0; + double _windowSCFW = 0; + double _windowSCFSW = 0; - double _windowSDFS; - double _windowSDFSE; - double _windowSDFE; - double _windowSDFNE; - double _windowSDFN; - double _windowSDFNW; - double _windowSDFW; - double _windowSDFSW; + double _windowSDFS = 0; + double _windowSDFSE = 0; + double _windowSDFE = 0; + double _windowSDFNE = 0; + double _windowSDFN = 0; + double _windowSDFNW = 0; + double _windowSDFW = 0; + double _windowSDFSW = 0; - double _exteriorHeatCapacity; - double _infiltration; - double _hvacWasteFactor; - double _hvacHeatingLossFactor; - double _hvacCoolingLossFactor; - double _dhwDistributionEfficiency; - double _heatingPumpControl; - double _coolingPumpControl; - double _heatGainPerPerson; + double _exteriorHeatCapacity = 0; + double _infiltration = 0; + double _hvacWasteFactor = 0; + double _hvacHeatingLossFactor = 0; + double _hvacCoolingLossFactor = 0; + double _dhwDistributionEfficiency = 0; + double _heatingPumpControl = 0; + double _coolingPumpControl = 0; + double _heatGainPerPerson = 0; openstudio::path _weatherFilePath; openstudio::path _dataFile; void parseLine(const std::string& line); void loadBuilding(const openstudio::path& t_buildingFile); - int weatherState(const std::string& header); + static int weatherState(const std::string& header); }; } // namespace isomodel diff --git a/src/isomodel/Ventilation.hpp b/src/isomodel/Ventilation.hpp index 508e971aa0d..a59d352eeae 100644 --- a/src/isomodel/Ventilation.hpp +++ b/src/isomodel/Ventilation.hpp @@ -86,14 +86,14 @@ namespace isomodel { } private: - double _supplyRate; - double _supplyDifference; - double _heatRecoveryEfficiency; - double _exhaustAirRecirculated; - double _type; - double _fanPower; - double _fanControlFactor; - double _wasteFactor; + double _supplyRate = 0; + double _supplyDifference = 0; + double _heatRecoveryEfficiency = 0; + double _exhaustAirRecirculated = 0; + double _type = 0; + double _fanPower = 0; + double _fanControlFactor = 0; + double _wasteFactor = 0; }; } // namespace isomodel } // namespace openstudio diff --git a/src/model/AirflowNetworkConstantPressureDrop_Impl.hpp b/src/model/AirflowNetworkConstantPressureDrop_Impl.hpp index 1e2eddebff6..66b82979123 100644 --- a/src/model/AirflowNetworkConstantPressureDrop_Impl.hpp +++ b/src/model/AirflowNetworkConstantPressureDrop_Impl.hpp @@ -57,9 +57,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkCrack_Impl.hpp b/src/model/AirflowNetworkCrack_Impl.hpp index 3590f777c3a..a2ef71a04c9 100644 --- a/src/model/AirflowNetworkCrack_Impl.hpp +++ b/src/model/AirflowNetworkCrack_Impl.hpp @@ -59,9 +59,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkDetailedOpening_Impl.hpp b/src/model/AirflowNetworkDetailedOpening_Impl.hpp index b57ffabcb36..211338672c4 100644 --- a/src/model/AirflowNetworkDetailedOpening_Impl.hpp +++ b/src/model/AirflowNetworkDetailedOpening_Impl.hpp @@ -60,9 +60,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkDistributionLinkage.hpp b/src/model/AirflowNetworkDistributionLinkage.hpp index 2b100be8b7b..120861812ef 100644 --- a/src/model/AirflowNetworkDistributionLinkage.hpp +++ b/src/model/AirflowNetworkDistributionLinkage.hpp @@ -84,9 +84,9 @@ namespace model { /** @name Setters */ //@{ - bool setNode1(const AirflowNetworkNode& airflowNetworkNodeAndZone); + bool setNode1(const AirflowNetworkNode& airflowNetworkNode); - bool setNode2(const AirflowNetworkNode& airflowNetworkNodeAndZone); + bool setNode2(const AirflowNetworkNode& airflowNetworkNode); bool setComponent(const AirflowNetworkComponent& airflowNetworkComponent); diff --git a/src/model/AirflowNetworkDistributionLinkage_Impl.hpp b/src/model/AirflowNetworkDistributionLinkage_Impl.hpp index 83667a538d2..eced06dca57 100644 --- a/src/model/AirflowNetworkDistributionLinkage_Impl.hpp +++ b/src/model/AirflowNetworkDistributionLinkage_Impl.hpp @@ -63,9 +63,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkDistributionNode_Impl.hpp b/src/model/AirflowNetworkDistributionNode_Impl.hpp index f714f422313..3cf4d7a86c3 100644 --- a/src/model/AirflowNetworkDistributionNode_Impl.hpp +++ b/src/model/AirflowNetworkDistributionNode_Impl.hpp @@ -60,9 +60,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkDuctViewFactors_Impl.hpp b/src/model/AirflowNetworkDuctViewFactors_Impl.hpp index 1cf8b5b921a..c7845fd1a37 100644 --- a/src/model/AirflowNetworkDuctViewFactors_Impl.hpp +++ b/src/model/AirflowNetworkDuctViewFactors_Impl.hpp @@ -38,6 +38,7 @@ namespace model { // Foward declaration class AirflowNetworkLinkage; + class PlanarSurface; class ViewFactorData; namespace detail { @@ -61,9 +62,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkDuct_Impl.hpp b/src/model/AirflowNetworkDuct_Impl.hpp index d3d8e7ed37f..deaada746ad 100644 --- a/src/model/AirflowNetworkDuct_Impl.hpp +++ b/src/model/AirflowNetworkDuct_Impl.hpp @@ -57,9 +57,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ @@ -117,11 +117,11 @@ namespace model { void resetDuctWallHeatTransmittanceCoefficient(); - bool setInsideConvectionCoefficient(double overallHeatTransmittanceCoefficientfromAirtoAir); + bool setInsideConvectionCoefficient(double coefficient); void resetInsideConvectionCoefficient(); - bool setOutsideConvectionCoefficient(double overallHeatTransmittanceCoefficientfromAirtoAir); + bool setOutsideConvectionCoefficient(double coefficient); void resetOutsideConvectionCoefficient(); diff --git a/src/model/AirflowNetworkEffectiveLeakageArea_Impl.hpp b/src/model/AirflowNetworkEffectiveLeakageArea_Impl.hpp index c1180e02c36..14de0daf532 100644 --- a/src/model/AirflowNetworkEffectiveLeakageArea_Impl.hpp +++ b/src/model/AirflowNetworkEffectiveLeakageArea_Impl.hpp @@ -57,9 +57,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkExternalNode_Impl.hpp b/src/model/AirflowNetworkExternalNode_Impl.hpp index d12f8b4d07e..60c92f0dba7 100644 --- a/src/model/AirflowNetworkExternalNode_Impl.hpp +++ b/src/model/AirflowNetworkExternalNode_Impl.hpp @@ -60,9 +60,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkHorizontalOpening_Impl.hpp b/src/model/AirflowNetworkHorizontalOpening_Impl.hpp index 4cb35135821..f6b0a960d25 100644 --- a/src/model/AirflowNetworkHorizontalOpening_Impl.hpp +++ b/src/model/AirflowNetworkHorizontalOpening_Impl.hpp @@ -57,9 +57,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkLeakageRatio_Impl.hpp b/src/model/AirflowNetworkLeakageRatio_Impl.hpp index 2970e06307a..f8c7ba187e5 100644 --- a/src/model/AirflowNetworkLeakageRatio_Impl.hpp +++ b/src/model/AirflowNetworkLeakageRatio_Impl.hpp @@ -57,9 +57,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkLinkage.cpp b/src/model/AirflowNetworkLinkage.cpp index 054cb7efd88..e3cf9d398ed 100644 --- a/src/model/AirflowNetworkLinkage.cpp +++ b/src/model/AirflowNetworkLinkage.cpp @@ -54,7 +54,7 @@ namespace model { OS_ASSERT(getImpl()); } - AirflowNetworkLinkage::AirflowNetworkLinkage(std::shared_ptr p) : ModelObject(p) {} + AirflowNetworkLinkage::AirflowNetworkLinkage(std::shared_ptr impl) : ModelObject(impl) {} } // namespace model diff --git a/src/model/AirflowNetworkOccupantVentilationControl_Impl.hpp b/src/model/AirflowNetworkOccupantVentilationControl_Impl.hpp index cbde00d49b7..dafb5e730e2 100644 --- a/src/model/AirflowNetworkOccupantVentilationControl_Impl.hpp +++ b/src/model/AirflowNetworkOccupantVentilationControl_Impl.hpp @@ -61,11 +61,11 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; - virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const; + virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkOutdoorAirflow_Impl.hpp b/src/model/AirflowNetworkOutdoorAirflow_Impl.hpp index 956cd5b465d..ce62b009b5d 100644 --- a/src/model/AirflowNetworkOutdoorAirflow_Impl.hpp +++ b/src/model/AirflowNetworkOutdoorAirflow_Impl.hpp @@ -61,9 +61,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkReferenceCrackConditions_Impl.hpp b/src/model/AirflowNetworkReferenceCrackConditions_Impl.hpp index a222e83982a..07102e7bbe6 100644 --- a/src/model/AirflowNetworkReferenceCrackConditions_Impl.hpp +++ b/src/model/AirflowNetworkReferenceCrackConditions_Impl.hpp @@ -57,9 +57,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkSimpleOpening_Impl.hpp b/src/model/AirflowNetworkSimpleOpening_Impl.hpp index 13fc9f10477..24158c93d18 100644 --- a/src/model/AirflowNetworkSimpleOpening_Impl.hpp +++ b/src/model/AirflowNetworkSimpleOpening_Impl.hpp @@ -58,9 +58,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkSimulationControl_Impl.hpp b/src/model/AirflowNetworkSimulationControl_Impl.hpp index 6eec5ba9270..11ecde3d56b 100644 --- a/src/model/AirflowNetworkSimulationControl_Impl.hpp +++ b/src/model/AirflowNetworkSimulationControl_Impl.hpp @@ -57,22 +57,26 @@ namespace model { virtual ~AirflowNetworkSimulationControl_Impl(); //@} - /** @name Getters */ + /** @name Virtual Methods */ //@{ // return the parent object in the hierarchy - virtual boost::optional parent() const; + virtual boost::optional parent() const override; // return any children objects in the hierarchy - virtual std::vector children() const; + virtual std::vector children() const override; /// get a vector of allowable children types - virtual std::vector allowableChildTypes() const; + virtual std::vector allowableChildTypes() const override; // Get all output variable names that could be associated with this object. - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; + + virtual IddObjectType iddObjectType() const override; - virtual IddObjectType iddObjectType() const; + //@} + /** @name Getters */ + //@{ boost::optional airflowNetworkControl() const; bool isAirflowNetworkControlDefaulted() const; diff --git a/src/model/AirflowNetworkSurface.cpp b/src/model/AirflowNetworkSurface.cpp index 8d69912bad6..09c5fce95e8 100644 --- a/src/model/AirflowNetworkSurface.cpp +++ b/src/model/AirflowNetworkSurface.cpp @@ -234,7 +234,7 @@ namespace model { OS_ASSERT(result); } - bool AirflowNetworkSurface_Impl::setVentilationControlMode(std::string ventilationControlMode) { + bool AirflowNetworkSurface_Impl::setVentilationControlMode(const std::string& ventilationControlMode) { bool result = setString(OS_AirflowNetworkSurfaceFields::VentilationControlMode, ventilationControlMode); return result; } @@ -518,7 +518,7 @@ AirflowNetworkSurface::AirflowNetworkSurface(const Model& model, const SubSurfac getImpl()->resetWindowDoorOpeningFactorOrCrackFactor(); } - bool AirflowNetworkSurface::setVentilationControlMode(std::string ventilationControlMode) { + bool AirflowNetworkSurface::setVentilationControlMode(const std::string& ventilationControlMode) { return getImpl()->setVentilationControlMode(ventilationControlMode); } diff --git a/src/model/AirflowNetworkSurface.hpp b/src/model/AirflowNetworkSurface.hpp index 0d5630a3641..9ae38f663c9 100644 --- a/src/model/AirflowNetworkSurface.hpp +++ b/src/model/AirflowNetworkSurface.hpp @@ -144,7 +144,7 @@ namespace model { /** Resets the opening factor/crack factor. */ void resetWindowDoorOpeningFactorOrCrackFactor(); /** Sets the ventilation control mode. */ - bool setVentilationControlMode(std::string ventilationControlMode); + bool setVentilationControlMode(const std::string& ventilationControlMode); /** Resets the ventilation control mode. */ void resetVentilationControlMode(); @@ -202,8 +202,8 @@ namespace model { AirflowNetworkSurface(const Model& model, const Handle& compHandle, const Handle& surfHandle); - bool setSurface(const Surface& surface); - bool setSurface(const SubSurface& surface); + bool setSurface(const Surface& surfAndSubSurf); + bool setSurface(const SubSurface& surfAndSubSurf); void resetSurface(); friend class detail::Surface_Impl; diff --git a/src/model/AirflowNetworkSurface_Impl.hpp b/src/model/AirflowNetworkSurface_Impl.hpp index acb911c0a05..c7049c857f8 100644 --- a/src/model/AirflowNetworkSurface_Impl.hpp +++ b/src/model/AirflowNetworkSurface_Impl.hpp @@ -63,11 +63,13 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; - virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const; + virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const override; + + virtual bool setParent(ParentObject& surfAndSubSurf) override; //@} /** @name Getters */ @@ -131,7 +133,7 @@ namespace model { void resetWindowDoorOpeningFactorOrCrackFactor(); - bool setVentilationControlMode(std::string ventilationControlMode); + bool setVentilationControlMode(const std::string& ventilationControlMode); void resetVentilationControlMode(); @@ -175,8 +177,6 @@ namespace model { /** @name Other */ //@{ - bool setParent(ParentObject& surfAndSubSurf); - //@} protected: private: diff --git a/src/model/AirflowNetworkZoneExhaustFan_Impl.hpp b/src/model/AirflowNetworkZoneExhaustFan_Impl.hpp index 74cea0ef599..9c086263585 100644 --- a/src/model/AirflowNetworkZoneExhaustFan_Impl.hpp +++ b/src/model/AirflowNetworkZoneExhaustFan_Impl.hpp @@ -60,9 +60,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/AirflowNetworkZone_Impl.hpp b/src/model/AirflowNetworkZone_Impl.hpp index a774e0d4f77..708b8b79b04 100644 --- a/src/model/AirflowNetworkZone_Impl.hpp +++ b/src/model/AirflowNetworkZone_Impl.hpp @@ -37,7 +37,6 @@ namespace openstudio { namespace model { - // TODO: Check the following class names against object getters and setters. class ThermalZone; class Schedule; class AirflowNetworkOccupantVentilationControl; @@ -63,24 +62,22 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; - virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const; + virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const override; //@} /** @name Getters */ //@{ - // TODO: Check return type. From object lists, some candidates are: ThermalZone. ThermalZone thermalZone() const; std::string ventilationControlMode() const; bool isVentilationControlModeDefaulted() const; - // TODO: Check return type. From object lists, some candidates are: Schedule. boost::optional ventilationControlZoneTemperatureSetpointSchedule() const; double minimumVentingOpenFactor() const; @@ -103,7 +100,6 @@ namespace model { bool isIndoorandOutdoorEnthalpyDifferenceUpperLimitforMinimumVentingOpenFactorDefaulted() const; - // TODO: Check return type. From object lists, some candidates are: Schedule. boost::optional ventingAvailabilitySchedule() const; std::string singleSidedWindPressureCoefficientAlgorithm() const; @@ -114,14 +110,12 @@ namespace model { bool isFacadeWidthDefaulted() const; - // TODO: Check return type. From object lists, some candidates are: AirflowNetworkOccupantVentilationControl. boost::optional occupantVentilationControl() const; //@} /** @name Setters */ //@{ - // TODO: Check argument type. From object lists, some candidates are: ThermalZone. bool setThermalZone(const ThermalZone& thermalZone); void resetThermalZone(); @@ -130,7 +124,6 @@ namespace model { void resetVentilationControlMode(); - // TODO: Check argument type. From object lists, some candidates are: Schedule. // Note Schedules are passed by reference, not const reference. bool setVentilationControlZoneTemperatureSetpointSchedule(Schedule& schedule); @@ -160,7 +153,6 @@ namespace model { void resetIndoorandOutdoorEnthalpyDifferenceUpperLimitforMinimumVentingOpenFactor(); - // TODO: Check argument type. From object lists, some candidates are: Schedule. // Note Schedules are passed by reference, not const reference. bool setVentingAvailabilitySchedule(Schedule& schedule); @@ -174,7 +166,6 @@ namespace model { void resetFacadeWidth(); - // TODO: Check argument type. From object lists, some candidates are: AirflowNetworkOccupantVentilationControl. bool setOccupantVentilationControl(const AirflowNetworkOccupantVentilationControl& airflowNetworkOccupantVentilationControl); void resetOccupantVentilationControl(); @@ -188,7 +179,6 @@ namespace model { private: REGISTER_LOGGER("openstudio.model.AirflowNetworkZone"); - // TODO: Check the return types of these methods. // Optional getters for use by methods like children() so can remove() if the constructor fails. // There are other ways for the public versions of these getters to fail--perhaps all required // objects should be returned as boost::optionals diff --git a/src/model/Blind.cpp b/src/model/Blind.cpp index c0bd9ac32ae..9ec8617d629 100644 --- a/src/model/Blind.cpp +++ b/src/model/Blind.cpp @@ -310,7 +310,7 @@ namespace model { return isEmpty(OS_WindowMaterial_BlindFields::MaximumSlatAngle); } - bool Blind_Impl::setSlatOrientation(std::string slatOrientation) { + bool Blind_Impl::setSlatOrientation(const std::string& slatOrientation) { bool result = setString(OS_WindowMaterial_BlindFields::SlatOrientation, slatOrientation); return result; } @@ -801,7 +801,7 @@ namespace model { return getImpl()->isMaximumSlatAngleDefaulted(); } - bool Blind::setSlatOrientation(std::string slatOrientation) { + bool Blind::setSlatOrientation(const std::string& slatOrientation) { return getImpl()->setSlatOrientation(slatOrientation); } diff --git a/src/model/Blind.hpp b/src/model/Blind.hpp index 5e17792f318..467be4186b8 100644 --- a/src/model/Blind.hpp +++ b/src/model/Blind.hpp @@ -163,7 +163,7 @@ namespace model { /** @name Setters */ //@{ - bool setSlatOrientation(std::string slatOrientation); + bool setSlatOrientation(const std::string& slatOrientation); void resetSlatOrientation(); diff --git a/src/model/Blind_Impl.hpp b/src/model/Blind_Impl.hpp index 29d1d41ea97..c8f3f504803 100644 --- a/src/model/Blind_Impl.hpp +++ b/src/model/Blind_Impl.hpp @@ -169,7 +169,7 @@ namespace model { /** Set thickness to value (m). For now is equivalent to setting slat thickness. */ virtual bool setThickness(double value) override; - bool setSlatOrientation(std::string slatOrientation); + bool setSlatOrientation(const std::string& slatOrientation); void resetSlatOrientation(); diff --git a/src/model/BoilerSteam.cpp b/src/model/BoilerSteam.cpp index 1f74fac1652..d3d8471120c 100644 --- a/src/model/BoilerSteam.cpp +++ b/src/model/BoilerSteam.cpp @@ -159,7 +159,7 @@ namespace model { return isEmpty(OS_Boiler_SteamFields::SizingFactor); } - bool BoilerSteam_Impl::setFuelType(std::string fuelType) { + bool BoilerSteam_Impl::setFuelType(const std::string& fuelType) { bool result = setString(OS_Boiler_SteamFields::FuelType, fuelType); return result; } @@ -486,7 +486,7 @@ namespace model { return getImpl()->isSizingFactorDefaulted(); } - bool BoilerSteam::setFuelType(std::string fuelType) { + bool BoilerSteam::setFuelType(const std::string& fuelType) { return getImpl()->setFuelType(fuelType); } @@ -602,4 +602,4 @@ namespace model { } } // namespace model -} // namespace openstudio \ No newline at end of file +} // namespace openstudio diff --git a/src/model/BoilerSteam.hpp b/src/model/BoilerSteam.hpp index 8b772683efa..dd2c67e3cf1 100644 --- a/src/model/BoilerSteam.hpp +++ b/src/model/BoilerSteam.hpp @@ -60,7 +60,7 @@ namespace model { //@{ std::string fuelType() const; - bool setFuelType(std::string fuelType); + bool setFuelType(const std::string& fuelType); boost::optional maximumOperatingPressure() const; bool setMaximumOperatingPressure(double maximumOperatingPressure); @@ -146,4 +146,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_BOILERSTEAM_HPP \ No newline at end of file +#endif // MODEL_BOILERSTEAM_HPP diff --git a/src/model/BoilerSteam_Impl.hpp b/src/model/BoilerSteam_Impl.hpp index 3ce5ac5c8c8..63be9ede141 100644 --- a/src/model/BoilerSteam_Impl.hpp +++ b/src/model/BoilerSteam_Impl.hpp @@ -114,7 +114,7 @@ namespace model { /** @name Setters */ //@{ - bool setFuelType(std::string fuelType); + bool setFuelType(const std::string& fuelType); bool setMaximumOperatingPressure(boost::optional maximumOperatingPressure); @@ -181,4 +181,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_BOILERSTEAM_IMPL_HPP \ No newline at end of file +#endif // MODEL_BOILERSTEAM_IMPL_HPP diff --git a/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped.cpp b/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped.cpp index 1bcbd6e6eed..5372220bc19 100644 --- a/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped.cpp +++ b/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped.cpp @@ -269,7 +269,7 @@ namespace model { } bool CoilWaterHeatingAirToWaterHeatPumpWrapped_Impl::setEvaporatorAirTemperatureTypeforCurveObjects( - std::string evaporatorAirTemperatureTypeforCurveObjects) { + const std::string& evaporatorAirTemperatureTypeforCurveObjects) { bool result = setString(OS_Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::EvaporatorAirTemperatureTypeforCurveObjects, evaporatorAirTemperatureTypeforCurveObjects); return result; @@ -546,7 +546,7 @@ namespace model { } bool CoilWaterHeatingAirToWaterHeatPumpWrapped::setEvaporatorAirTemperatureTypeforCurveObjects( - std::string evaporatorAirTemperatureTypeforCurveObjects) { + const std::string& evaporatorAirTemperatureTypeforCurveObjects) { return getImpl()->setEvaporatorAirTemperatureTypeforCurveObjects( evaporatorAirTemperatureTypeforCurveObjects); } diff --git a/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped.hpp b/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped.hpp index 20ff81d42ba..9985cfd1532 100644 --- a/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped.hpp +++ b/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped.hpp @@ -125,7 +125,7 @@ namespace model { bool setMaximumAmbientTemperatureforCrankcaseHeaterOperation(double maximumAmbientTemperatureforCrankcaseHeaterOperation); - bool setEvaporatorAirTemperatureTypeforCurveObjects(std::string evaporatorAirTemperatureTypeforCurveObjects); + bool setEvaporatorAirTemperatureTypeforCurveObjects(const std::string& evaporatorAirTemperatureTypeforCurveObjects); bool setHeatingCapacityFunctionofTemperatureCurve(const Curve& curve); diff --git a/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped_Impl.hpp b/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped_Impl.hpp index 1f23545b050..dc48aa1bad1 100644 --- a/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped_Impl.hpp +++ b/src/model/CoilWaterHeatingAirToWaterHeatPumpWrapped_Impl.hpp @@ -127,17 +127,17 @@ namespace model { bool setMaximumAmbientTemperatureforCrankcaseHeaterOperation(double maximumAmbientTemperatureforCrankcaseHeaterOperation); - bool setEvaporatorAirTemperatureTypeforCurveObjects(std::string evaporatorAirTemperatureTypeforCurveObjects); + bool setEvaporatorAirTemperatureTypeforCurveObjects(const std::string& evaporatorAirTemperatureTypeforCurveObjects); - bool setHeatingCapacityFunctionofTemperatureCurve(const Curve& biquadraticCubicCurves); + bool setHeatingCapacityFunctionofTemperatureCurve(const Curve& curve); - bool setHeatingCapacityFunctionofAirFlowFractionCurve(const Curve& quadraticCubicCurves); + bool setHeatingCapacityFunctionofAirFlowFractionCurve(const Curve& curve); - bool setHeatingCOPFunctionofTemperatureCurve(const Curve& biquadraticCubicCurves); + bool setHeatingCOPFunctionofTemperatureCurve(const Curve& curve); - bool setHeatingCOPFunctionofAirFlowFractionCurve(const Curve& quadraticCubicCurves); + bool setHeatingCOPFunctionofAirFlowFractionCurve(const Curve& curve); - bool setPartLoadFractionCorrelationCurve(const Curve& quadraticCubicCurves); + bool setPartLoadFractionCorrelationCurve(const Curve& curve); //@} /** @name Other */ diff --git a/src/model/Connection.cpp b/src/model/Connection.cpp index 438c8bb5a6d..f068af70a3a 100644 --- a/src/model/Connection.cpp +++ b/src/model/Connection.cpp @@ -115,7 +115,7 @@ namespace model { OS_ASSERT(getImpl()); } - Connection::Connection(std::shared_ptr p) : ModelObject(std::move(p)) {} + Connection::Connection(std::shared_ptr impl) : ModelObject(std::move(impl)) {} OptionalModelObject Connection::sourceObject() const { return getImpl()->sourceObject(); diff --git a/src/model/ControllerWaterCoil.cpp b/src/model/ControllerWaterCoil.cpp index 37d25ec5b8b..ee5f120d35f 100644 --- a/src/model/ControllerWaterCoil.cpp +++ b/src/model/ControllerWaterCoil.cpp @@ -224,11 +224,11 @@ namespace model { return this->getObject().getModelObjectTarget(OS_Controller_WaterCoilFields::ActuatorNodeName); } - bool ControllerWaterCoil_Impl::setSensorNode(Node& node) { + bool ControllerWaterCoil_Impl::setSensorNode(const Node& node) { return this->setPointer(OS_Controller_WaterCoilFields::SensorNodeName, node.handle()); } - bool ControllerWaterCoil_Impl::setActuatorNode(Node& node) { + bool ControllerWaterCoil_Impl::setActuatorNode(const Node& node) { return this->setPointer(OS_Controller_WaterCoilFields::ActuatorNodeName, node.handle()); } @@ -396,11 +396,11 @@ namespace model { return getImpl()->actuatorNode(); } - bool ControllerWaterCoil::setSensorNode(Node& node) { + bool ControllerWaterCoil::setSensorNode(const Node& node) { return getImpl()->setSensorNode(node); } - bool ControllerWaterCoil::setActuatorNode(Node& node) { + bool ControllerWaterCoil::setActuatorNode(const Node& node) { return getImpl()->setActuatorNode(node); } diff --git a/src/model/ControllerWaterCoil.hpp b/src/model/ControllerWaterCoil.hpp index c0d0366c325..9afad0e067e 100644 --- a/src/model/ControllerWaterCoil.hpp +++ b/src/model/ControllerWaterCoil.hpp @@ -113,9 +113,9 @@ namespace model { void resetActuatorVariable(); - bool setSensorNode(Node& node); + bool setSensorNode(const Node& node); - bool setActuatorNode(Node& node); + bool setActuatorNode(const Node& node); bool setControllerConvergenceTolerance(double controllerConvergenceTolerance); diff --git a/src/model/ControllerWaterCoil_Impl.hpp b/src/model/ControllerWaterCoil_Impl.hpp index 25cebac8d45..7520d501b01 100644 --- a/src/model/ControllerWaterCoil_Impl.hpp +++ b/src/model/ControllerWaterCoil_Impl.hpp @@ -129,9 +129,9 @@ namespace model { boost::optional actuatorNode() const; - bool setSensorNode(Node& node); + bool setSensorNode(const Node& node); - bool setActuatorNode(Node& node); + bool setActuatorNode(const Node& node); bool setWaterCoil(const HVACComponent& comp); diff --git a/src/model/CoolingTowerSingleSpeed.cpp b/src/model/CoolingTowerSingleSpeed.cpp index a6a3ed255ec..c2692d60298 100644 --- a/src/model/CoolingTowerSingleSpeed.cpp +++ b/src/model/CoolingTowerSingleSpeed.cpp @@ -467,7 +467,7 @@ namespace model { OS_ASSERT(result); } - bool CoolingTowerSingleSpeed_Impl::setPerformanceInputMethod(std::string performanceInputMethod) { + bool CoolingTowerSingleSpeed_Impl::setPerformanceInputMethod(const std::string& performanceInputMethod) { bool result = setString(OS_CoolingTower_SingleSpeedFields::PerformanceInputMethod, performanceInputMethod); return result; } @@ -527,9 +527,9 @@ namespace model { OS_ASSERT(result); } - bool CoolingTowerSingleSpeed_Impl::setBasinHeaterOperatingSchedule(Schedule& schedule) { + bool CoolingTowerSingleSpeed_Impl::setBasinHeaterOperatingSchedule(Schedule& basinHeaterOperatingSchedule) { bool result = setSchedule(OS_CoolingTower_SingleSpeedFields::BasinHeaterOperatingScheduleName, "CoolingTowerSingleSpeed", - "Basin Heater Operating", schedule); + "Basin Heater Operating", basinHeaterOperatingSchedule); return result; } @@ -600,9 +600,9 @@ namespace model { OS_ASSERT(result); } - bool CoolingTowerSingleSpeed_Impl::setBlowdownMakeupWaterUsageSchedule(Schedule& schedule) { + bool CoolingTowerSingleSpeed_Impl::setBlowdownMakeupWaterUsageSchedule(Schedule& blowdownMakeupWaterUsageSchedule) { bool result = setSchedule(OS_CoolingTower_SingleSpeedFields::BlowdownMakeupWaterUsageScheduleName, "CoolingTowerSingleSpeed", - "Blowdown Makeup Water Usage", schedule); + "Blowdown Makeup Water Usage", blowdownMakeupWaterUsageSchedule); return result; } @@ -611,7 +611,7 @@ namespace model { OS_ASSERT(result); } - bool CoolingTowerSingleSpeed_Impl::setCapacityControl(std::string capacityControl) { + bool CoolingTowerSingleSpeed_Impl::setCapacityControl(const std::string& capacityControl) { bool result = setString(OS_CoolingTower_SingleSpeedFields::CapacityControl, capacityControl); return result; } @@ -631,7 +631,7 @@ namespace model { OS_ASSERT(result); } - bool CoolingTowerSingleSpeed_Impl::setCellControl(std::string cellControl) { + bool CoolingTowerSingleSpeed_Impl::setCellControl(const std::string& cellControl) { bool result = setString(OS_CoolingTower_SingleSpeedFields::CellControl, cellControl); return result; } @@ -1310,7 +1310,7 @@ namespace model { getImpl()->autosizeUFactorTimesAreaValueatFreeConvectionAirFlowRate(); } - bool CoolingTowerSingleSpeed::setPerformanceInputMethod(std::string performanceInputMethod) { + bool CoolingTowerSingleSpeed::setPerformanceInputMethod(const std::string& performanceInputMethod) { return getImpl()->setPerformanceInputMethod(performanceInputMethod); } @@ -1358,7 +1358,7 @@ namespace model { getImpl()->resetBasinHeaterOperatingSchedule(); } - bool CoolingTowerSingleSpeed::setEvaporationLossMode(std::string evaporationLossMode) { + bool CoolingTowerSingleSpeed::setEvaporationLossMode(const std::string& evaporationLossMode) { return getImpl()->setEvaporationLossMode(evaporationLossMode); } @@ -1382,7 +1382,7 @@ namespace model { getImpl()->resetDriftLossPercent(); } - bool CoolingTowerSingleSpeed::setBlowdownCalculationMode(std::string blowdownCalculationMode) { + bool CoolingTowerSingleSpeed::setBlowdownCalculationMode(const std::string& blowdownCalculationMode) { return getImpl()->setBlowdownCalculationMode(blowdownCalculationMode); } @@ -1406,7 +1406,7 @@ namespace model { getImpl()->resetBlowdownMakeupWaterUsageSchedule(); } - bool CoolingTowerSingleSpeed::setCapacityControl(std::string capacityControl) { + bool CoolingTowerSingleSpeed::setCapacityControl(const std::string& capacityControl) { return getImpl()->setCapacityControl(capacityControl); } @@ -1422,7 +1422,7 @@ namespace model { getImpl()->resetNumberofCells(); } - bool CoolingTowerSingleSpeed::setCellControl(std::string cellControl) { + bool CoolingTowerSingleSpeed::setCellControl(const std::string& cellControl) { return getImpl()->setCellControl(cellControl); } @@ -1581,4 +1581,4 @@ namespace model { } } // namespace model -} // namespace openstudio \ No newline at end of file +} // namespace openstudio diff --git a/src/model/CoolingTowerSingleSpeed.hpp b/src/model/CoolingTowerSingleSpeed.hpp index a658a86a66d..e7a8ddafd75 100644 --- a/src/model/CoolingTowerSingleSpeed.hpp +++ b/src/model/CoolingTowerSingleSpeed.hpp @@ -198,7 +198,7 @@ namespace model { void autosizeUFactorTimesAreaValueatFreeConvectionAirFlowRate(); - bool setPerformanceInputMethod(std::string performanceInputMethod); + bool setPerformanceInputMethod(const std::string& performanceInputMethod); void resetPerformanceInputMethod(); @@ -222,7 +222,7 @@ namespace model { void resetBasinHeaterOperatingSchedule(); - bool setEvaporationLossMode(std::string evaporationLossMode); + bool setEvaporationLossMode(const std::string& evaporationLossMode); void resetEvaporationLossMode(); @@ -234,7 +234,7 @@ namespace model { void resetDriftLossPercent(); - bool setBlowdownCalculationMode(std::string blowdownCalculationMode); + bool setBlowdownCalculationMode(const std::string& blowdownCalculationMode); void resetBlowdownCalculationMode(); @@ -246,7 +246,7 @@ namespace model { void resetBlowdownMakeupWaterUsageSchedule(); - bool setCapacityControl(std::string capacityControl); + bool setCapacityControl(const std::string& capacityControl); void resetCapacityControl(); @@ -254,7 +254,7 @@ namespace model { void resetNumberofCells(); - bool setCellControl(std::string cellControl); + bool setCellControl(const std::string& cellControl); void resetCellControl(); @@ -349,4 +349,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_COOLINGTOWERSINGLESPEED_HPP \ No newline at end of file +#endif // MODEL_COOLINGTOWERSINGLESPEED_HPP diff --git a/src/model/CoolingTowerSingleSpeed_Impl.hpp b/src/model/CoolingTowerSingleSpeed_Impl.hpp index ac6df2d5978..1b7af3f4511 100644 --- a/src/model/CoolingTowerSingleSpeed_Impl.hpp +++ b/src/model/CoolingTowerSingleSpeed_Impl.hpp @@ -217,7 +217,7 @@ namespace model { void autosizeUFactorTimesAreaValueatFreeConvectionAirFlowRate(); - bool setPerformanceInputMethod(std::string performanceInputMethod); + bool setPerformanceInputMethod(const std::string& performanceInputMethod); void resetPerformanceInputMethod(); @@ -265,7 +265,7 @@ namespace model { void resetBlowdownMakeupWaterUsageSchedule(); - bool setCapacityControl(std::string capacityControl); + bool setCapacityControl(const std::string& capacityControl); void resetCapacityControl(); @@ -273,7 +273,7 @@ namespace model { void resetNumberofCells(); - bool setCellControl(std::string cellControl); + bool setCellControl(const std::string& cellControl); void resetCellControl(); @@ -358,4 +358,4 @@ namespace model { } // namespace openstudio -#endif // MODEL_COOLINGTOWERSINGLESPEED_IMPL_HPP \ No newline at end of file +#endif // MODEL_COOLINGTOWERSINGLESPEED_IMPL_HPP diff --git a/src/model/CoolingTowerTwoSpeed.cpp b/src/model/CoolingTowerTwoSpeed.cpp index ca27d4b1f2d..8fc2bad674c 100644 --- a/src/model/CoolingTowerTwoSpeed.cpp +++ b/src/model/CoolingTowerTwoSpeed.cpp @@ -710,7 +710,7 @@ namespace model { OS_ASSERT(result); } - bool CoolingTowerTwoSpeed_Impl::setPerformanceInputMethod(std::string performanceInputMethod) { + bool CoolingTowerTwoSpeed_Impl::setPerformanceInputMethod(const std::string& performanceInputMethod) { bool result = setString(OS_CoolingTower_TwoSpeedFields::PerformanceInputMethod, performanceInputMethod); return result; } @@ -943,7 +943,7 @@ namespace model { OS_ASSERT(result); } - bool CoolingTowerTwoSpeed_Impl::setCellControl(std::string cellControl) { + bool CoolingTowerTwoSpeed_Impl::setCellControl(const std::string& cellControl) { bool result = setString(OS_CoolingTower_TwoSpeedFields::CellControl, cellControl); return result; } @@ -1655,7 +1655,7 @@ namespace model { getImpl()->resetFreeConvectionUFactorTimesAreaValueSizingFactor(); } - bool CoolingTowerTwoSpeed::setPerformanceInputMethod(std::string performanceInputMethod) { + bool CoolingTowerTwoSpeed::setPerformanceInputMethod(const std::string& performanceInputMethod) { return getImpl()->setPerformanceInputMethod(performanceInputMethod); } @@ -1744,7 +1744,7 @@ namespace model { getImpl()->resetBasinHeaterOperatingSchedule(); } - bool CoolingTowerTwoSpeed::setEvaporationLossMode(std::string evaporationLossMode) { + bool CoolingTowerTwoSpeed::setEvaporationLossMode(const std::string& evaporationLossMode) { return getImpl()->setEvaporationLossMode(evaporationLossMode); } @@ -1768,7 +1768,7 @@ namespace model { getImpl()->resetDriftLossPercent(); } - bool CoolingTowerTwoSpeed::setBlowdownCalculationMode(std::string blowdownCalculationMode) { + bool CoolingTowerTwoSpeed::setBlowdownCalculationMode(const std::string& blowdownCalculationMode) { return getImpl()->setBlowdownCalculationMode(blowdownCalculationMode); } @@ -1808,7 +1808,7 @@ namespace model { getImpl()->resetNumberofCells(); } - bool CoolingTowerTwoSpeed::setCellControl(std::string cellControl) { + bool CoolingTowerTwoSpeed::setCellControl(const std::string& cellControl) { return getImpl()->setCellControl(cellControl); } diff --git a/src/model/CoolingTowerTwoSpeed.hpp b/src/model/CoolingTowerTwoSpeed.hpp index eef4591bed8..7c89585637e 100644 --- a/src/model/CoolingTowerTwoSpeed.hpp +++ b/src/model/CoolingTowerTwoSpeed.hpp @@ -277,7 +277,7 @@ namespace model { void resetFreeConvectionUFactorTimesAreaValueSizingFactor(); - bool setPerformanceInputMethod(std::string performanceInputMethod); + bool setPerformanceInputMethod(const std::string& performanceInputMethod); void resetPerformanceInputMethod(); @@ -321,7 +321,7 @@ namespace model { void resetBasinHeaterOperatingSchedule(); - bool setEvaporationLossMode(std::string evaporationLossMode); + bool setEvaporationLossMode(const std::string& evaporationLossMode); void resetEvaporationLossMode(); @@ -333,7 +333,7 @@ namespace model { void resetDriftLossPercent(); - bool setBlowdownCalculationMode(std::string blowdownCalculationMode); + bool setBlowdownCalculationMode(const std::string& blowdownCalculationMode); void resetBlowdownCalculationMode(); @@ -353,7 +353,7 @@ namespace model { void resetNumberofCells(); - bool setCellControl(std::string cellControl); + bool setCellControl(const std::string& cellControl); void resetCellControl(); diff --git a/src/model/CoolingTowerTwoSpeed_Impl.hpp b/src/model/CoolingTowerTwoSpeed_Impl.hpp index f5af9c843b4..80ce67a0048 100644 --- a/src/model/CoolingTowerTwoSpeed_Impl.hpp +++ b/src/model/CoolingTowerTwoSpeed_Impl.hpp @@ -311,7 +311,7 @@ namespace model { void resetFreeConvectionUFactorTimesAreaValueSizingFactor(); - bool setPerformanceInputMethod(std::string performanceInputMethod); + bool setPerformanceInputMethod(const std::string& performanceInputMethod); void resetPerformanceInputMethod(); @@ -387,7 +387,7 @@ namespace model { void resetNumberofCells(); - bool setCellControl(std::string cellControl); + bool setCellControl(const std::string& cellControl); void resetCellControl(); diff --git a/src/model/CurveBicubic.cpp b/src/model/CurveBicubic.cpp index 074c47c8b96..d05fea14752 100644 --- a/src/model/CurveBicubic.cpp +++ b/src/model/CurveBicubic.cpp @@ -71,10 +71,10 @@ namespace model { return 2; } - double CurveBicubic_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 2u); + double CurveBicubic_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 2u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -84,7 +84,7 @@ namespace model { x = maximumValueofx(); } - double y = independantVariables[1]; + double y = independentVariables[1]; if (y < minimumValueofy()) { LOG(Warn, "Supplied y is below the minimumValueofy, resetting it."); y = minimumValueofy(); @@ -364,7 +364,7 @@ namespace model { OS_ASSERT(result); } - bool CurveBicubic_Impl::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveBicubic_Impl::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { bool result = setString(OS_Curve_BicubicFields::InputUnitTypeforX, inputUnitTypeforX); return result; } @@ -374,7 +374,7 @@ namespace model { OS_ASSERT(result); } - bool CurveBicubic_Impl::setInputUnitTypeforY(std::string inputUnitTypeforY) { + bool CurveBicubic_Impl::setInputUnitTypeforY(const std::string& inputUnitTypeforY) { bool result = setString(OS_Curve_BicubicFields::InputUnitTypeforY, inputUnitTypeforY); return result; } @@ -384,7 +384,7 @@ namespace model { OS_ASSERT(result); } - bool CurveBicubic_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveBicubic_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_BicubicFields::OutputUnitType, outputUnitType); return result; } @@ -591,7 +591,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveBicubic::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveBicubic::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { return getImpl()->setInputUnitTypeforX(inputUnitTypeforX); } @@ -599,7 +599,7 @@ namespace model { getImpl()->resetInputUnitTypeforX(); } - bool CurveBicubic::setInputUnitTypeforY(std::string inputUnitTypeforY) { + bool CurveBicubic::setInputUnitTypeforY(const std::string& inputUnitTypeforY) { return getImpl()->setInputUnitTypeforY(inputUnitTypeforY); } @@ -607,7 +607,7 @@ namespace model { getImpl()->resetInputUnitTypeforY(); } - bool CurveBicubic::setOutputUnitType(std::string outputUnitType) { + bool CurveBicubic::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveBicubic.hpp b/src/model/CurveBicubic.hpp index 32d67a605a5..002f01a3e13 100644 --- a/src/model/CurveBicubic.hpp +++ b/src/model/CurveBicubic.hpp @@ -152,15 +152,15 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setInputUnitTypeforY(std::string inputUnitTypeforY); + bool setInputUnitTypeforY(const std::string& inputUnitTypeforY); void resetInputUnitTypeforY(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveBicubic_Impl.hpp b/src/model/CurveBicubic_Impl.hpp index 68e7f345ce1..e92155b6a9d 100644 --- a/src/model/CurveBicubic_Impl.hpp +++ b/src/model/CurveBicubic_Impl.hpp @@ -63,7 +63,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -153,15 +153,15 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setInputUnitTypeforY(std::string inputUnitTypeforY); + bool setInputUnitTypeforY(const std::string& inputUnitTypeforY); void resetInputUnitTypeforY(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveBiquadratic.cpp b/src/model/CurveBiquadratic.cpp index fdc08023909..16303f7f890 100644 --- a/src/model/CurveBiquadratic.cpp +++ b/src/model/CurveBiquadratic.cpp @@ -73,10 +73,10 @@ namespace model { return 2u; } - double CurveBiquadratic_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 2u); + double CurveBiquadratic_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 2u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -86,7 +86,7 @@ namespace model { x = maximumValueofx(); } - double y = independantVariables[1]; + double y = independentVariables[1]; if (y < minimumValueofy()) { LOG(Warn, "Supplied y is below the minimumValueofy, resetting it."); y = minimumValueofy(); @@ -312,7 +312,7 @@ namespace model { OS_ASSERT(result); } - bool CurveBiquadratic_Impl::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveBiquadratic_Impl::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { bool result = setString(OS_Curve_BiquadraticFields::InputUnitTypeforX, inputUnitTypeforX); return result; } @@ -322,7 +322,7 @@ namespace model { OS_ASSERT(result); } - bool CurveBiquadratic_Impl::setInputUnitTypeforY(std::string inputUnitTypeforY) { + bool CurveBiquadratic_Impl::setInputUnitTypeforY(const std::string& inputUnitTypeforY) { bool result = setString(OS_Curve_BiquadraticFields::InputUnitTypeforY, inputUnitTypeforY); return result; } @@ -332,7 +332,7 @@ namespace model { OS_ASSERT(result); } - bool CurveBiquadratic_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveBiquadratic_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_BiquadraticFields::OutputUnitType, outputUnitType); return result; } @@ -503,7 +503,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveBiquadratic::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveBiquadratic::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { return getImpl()->setInputUnitTypeforX(inputUnitTypeforX); } @@ -511,7 +511,7 @@ namespace model { getImpl()->resetInputUnitTypeforX(); } - bool CurveBiquadratic::setInputUnitTypeforY(std::string inputUnitTypeforY) { + bool CurveBiquadratic::setInputUnitTypeforY(const std::string& inputUnitTypeforY) { return getImpl()->setInputUnitTypeforY(inputUnitTypeforY); } @@ -519,7 +519,7 @@ namespace model { getImpl()->resetInputUnitTypeforY(); } - bool CurveBiquadratic::setOutputUnitType(std::string outputUnitType) { + bool CurveBiquadratic::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveBiquadratic.hpp b/src/model/CurveBiquadratic.hpp index 13480c4ce49..43b3f8a7027 100644 --- a/src/model/CurveBiquadratic.hpp +++ b/src/model/CurveBiquadratic.hpp @@ -136,15 +136,15 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setInputUnitTypeforY(std::string inputUnitTypeforY); + bool setInputUnitTypeforY(const std::string& inputUnitTypeforY); void resetInputUnitTypeforY(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveBiquadratic_Impl.hpp b/src/model/CurveBiquadratic_Impl.hpp index daec0f06fa8..226228add8c 100644 --- a/src/model/CurveBiquadratic_Impl.hpp +++ b/src/model/CurveBiquadratic_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -138,15 +138,15 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setInputUnitTypeforY(std::string inputUnitTypeforY); + bool setInputUnitTypeforY(const std::string& inputUnitTypeforY); void resetInputUnitTypeforY(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveCubic.cpp b/src/model/CurveCubic.cpp index 5c2df27e60e..c0b6805527b 100644 --- a/src/model/CurveCubic.cpp +++ b/src/model/CurveCubic.cpp @@ -70,10 +70,10 @@ namespace model { return 1; } - double CurveCubic_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 1u); + double CurveCubic_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 1u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -239,7 +239,7 @@ namespace model { OS_ASSERT(result); } - bool CurveCubic_Impl::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveCubic_Impl::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { bool result = setString(OS_Curve_CubicFields::InputUnitTypeforX, inputUnitTypeforX); return result; } @@ -249,7 +249,7 @@ namespace model { OS_ASSERT(result); } - bool CurveCubic_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveCubic_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_CubicFields::OutputUnitType, outputUnitType); return result; } @@ -372,7 +372,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveCubic::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveCubic::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { return getImpl()->setInputUnitTypeforX(inputUnitTypeforX); } @@ -380,7 +380,7 @@ namespace model { getImpl()->resetInputUnitTypeforX(); } - bool CurveCubic::setOutputUnitType(std::string outputUnitType) { + bool CurveCubic::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveCubic.hpp b/src/model/CurveCubic.hpp index 88806d26c6d..c9eaa07035f 100644 --- a/src/model/CurveCubic.hpp +++ b/src/model/CurveCubic.hpp @@ -114,11 +114,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveCubic_Impl.hpp b/src/model/CurveCubic_Impl.hpp index f9f26c0ee93..ee5bb1dc2ae 100644 --- a/src/model/CurveCubic_Impl.hpp +++ b/src/model/CurveCubic_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -118,11 +118,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveDoubleExponentialDecay.cpp b/src/model/CurveDoubleExponentialDecay.cpp index 0e8985da8c2..9e5544fd845 100644 --- a/src/model/CurveDoubleExponentialDecay.cpp +++ b/src/model/CurveDoubleExponentialDecay.cpp @@ -74,10 +74,10 @@ namespace model { return 1; } - double CurveDoubleExponentialDecay_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 1u); + double CurveDoubleExponentialDecay_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 1u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -254,7 +254,7 @@ namespace model { OS_ASSERT(result); } - bool CurveDoubleExponentialDecay_Impl::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveDoubleExponentialDecay_Impl::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { bool result = setString(OS_Curve_DoubleExponentialDecayFields::InputUnitTypeforx, inputUnitTypeforx); return result; } @@ -264,7 +264,7 @@ namespace model { OS_ASSERT(result); } - bool CurveDoubleExponentialDecay_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveDoubleExponentialDecay_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_DoubleExponentialDecayFields::OutputUnitType, outputUnitType); return result; } @@ -416,7 +416,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveDoubleExponentialDecay::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveDoubleExponentialDecay::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { return getImpl()->setInputUnitTypeforx(inputUnitTypeforx); } @@ -424,7 +424,7 @@ namespace model { getImpl()->resetInputUnitTypeforx(); } - bool CurveDoubleExponentialDecay::setOutputUnitType(std::string outputUnitType) { + bool CurveDoubleExponentialDecay::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveDoubleExponentialDecay.hpp b/src/model/CurveDoubleExponentialDecay.hpp index 839c74f222e..18d8df6b802 100644 --- a/src/model/CurveDoubleExponentialDecay.hpp +++ b/src/model/CurveDoubleExponentialDecay.hpp @@ -123,11 +123,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveDoubleExponentialDecay_Impl.hpp b/src/model/CurveDoubleExponentialDecay_Impl.hpp index 1ca6326f708..205f008822b 100644 --- a/src/model/CurveDoubleExponentialDecay_Impl.hpp +++ b/src/model/CurveDoubleExponentialDecay_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -122,11 +122,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveExponent.cpp b/src/model/CurveExponent.cpp index 2924df56d73..444eae59324 100644 --- a/src/model/CurveExponent.cpp +++ b/src/model/CurveExponent.cpp @@ -72,10 +72,10 @@ namespace model { return 1; } - double CurveExponent_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 1u); + double CurveExponent_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 1u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -227,7 +227,7 @@ namespace model { OS_ASSERT(result); } - bool CurveExponent_Impl::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveExponent_Impl::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { bool result = setString(OS_Curve_ExponentFields::InputUnitTypeforX, inputUnitTypeforX); return result; } @@ -237,7 +237,7 @@ namespace model { OS_ASSERT(result); } - bool CurveExponent_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveExponent_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_ExponentFields::OutputUnitType, outputUnitType); return result; } @@ -355,7 +355,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveExponent::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveExponent::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { return getImpl()->setInputUnitTypeforX(inputUnitTypeforX); } @@ -363,7 +363,7 @@ namespace model { getImpl()->resetInputUnitTypeforX(); } - bool CurveExponent::setOutputUnitType(std::string outputUnitType) { + bool CurveExponent::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveExponent.hpp b/src/model/CurveExponent.hpp index 6d1d5a70698..c9d6204ddaa 100644 --- a/src/model/CurveExponent.hpp +++ b/src/model/CurveExponent.hpp @@ -110,11 +110,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveExponent_Impl.hpp b/src/model/CurveExponent_Impl.hpp index 32e5e3b61cc..58367951a14 100644 --- a/src/model/CurveExponent_Impl.hpp +++ b/src/model/CurveExponent_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -114,11 +114,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveExponentialDecay.cpp b/src/model/CurveExponentialDecay.cpp index 77b908591de..33e1e5c7730 100644 --- a/src/model/CurveExponentialDecay.cpp +++ b/src/model/CurveExponentialDecay.cpp @@ -72,10 +72,10 @@ namespace model { return 1; } - double CurveExponentialDecay_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 1u); + double CurveExponentialDecay_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 1u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -227,7 +227,7 @@ namespace model { OS_ASSERT(result); } - bool CurveExponentialDecay_Impl::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveExponentialDecay_Impl::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { bool result = setString(OS_Curve_ExponentialDecayFields::InputUnitTypeforx, inputUnitTypeforx); return result; } @@ -237,7 +237,7 @@ namespace model { OS_ASSERT(result); } - bool CurveExponentialDecay_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveExponentialDecay_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_ExponentialDecayFields::OutputUnitType, outputUnitType); return result; } @@ -351,7 +351,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveExponentialDecay::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveExponentialDecay::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { return getImpl()->setInputUnitTypeforx(inputUnitTypeforx); } @@ -359,7 +359,7 @@ namespace model { getImpl()->resetInputUnitTypeforx(); } - bool CurveExponentialDecay::setOutputUnitType(std::string outputUnitType) { + bool CurveExponentialDecay::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveExponentialDecay.hpp b/src/model/CurveExponentialDecay.hpp index 0ebc796ab51..8d584e367aa 100644 --- a/src/model/CurveExponentialDecay.hpp +++ b/src/model/CurveExponentialDecay.hpp @@ -110,11 +110,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveExponentialDecay_Impl.hpp b/src/model/CurveExponentialDecay_Impl.hpp index 3019e9ae87d..8d1ff29daf5 100644 --- a/src/model/CurveExponentialDecay_Impl.hpp +++ b/src/model/CurveExponentialDecay_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -114,11 +114,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveExponentialSkewNormal.cpp b/src/model/CurveExponentialSkewNormal.cpp index 7de34937a15..02ff73a5c49 100644 --- a/src/model/CurveExponentialSkewNormal.cpp +++ b/src/model/CurveExponentialSkewNormal.cpp @@ -74,10 +74,10 @@ namespace model { return 1; } - double CurveExponentialSkewNormal_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 1u); + double CurveExponentialSkewNormal_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 1u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -247,7 +247,7 @@ namespace model { OS_ASSERT(result); } - bool CurveExponentialSkewNormal_Impl::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveExponentialSkewNormal_Impl::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { bool result = setString(OS_Curve_ExponentialSkewNormalFields::InputUnitTypeforx, inputUnitTypeforx); return result; } @@ -257,7 +257,7 @@ namespace model { OS_ASSERT(result); } - bool CurveExponentialSkewNormal_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveExponentialSkewNormal_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_ExponentialSkewNormalFields::OutputUnitType, outputUnitType); return result; } @@ -380,7 +380,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveExponentialSkewNormal::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveExponentialSkewNormal::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { return getImpl()->setInputUnitTypeforx(inputUnitTypeforx); } @@ -388,7 +388,7 @@ namespace model { getImpl()->resetInputUnitTypeforx(); } - bool CurveExponentialSkewNormal::setOutputUnitType(std::string outputUnitType) { + bool CurveExponentialSkewNormal::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveExponentialSkewNormal.hpp b/src/model/CurveExponentialSkewNormal.hpp index 3b771dd0e58..b8925d02eea 100644 --- a/src/model/CurveExponentialSkewNormal.hpp +++ b/src/model/CurveExponentialSkewNormal.hpp @@ -114,11 +114,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveExponentialSkewNormal_Impl.hpp b/src/model/CurveExponentialSkewNormal_Impl.hpp index bd78fc2b5c2..369f3b5fe6b 100644 --- a/src/model/CurveExponentialSkewNormal_Impl.hpp +++ b/src/model/CurveExponentialSkewNormal_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -118,11 +118,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveFanPressureRise.cpp b/src/model/CurveFanPressureRise.cpp index 6060dc0e5f8..1c959ae7c67 100644 --- a/src/model/CurveFanPressureRise.cpp +++ b/src/model/CurveFanPressureRise.cpp @@ -71,10 +71,10 @@ namespace model { return 2; } - double CurveFanPressureRise_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 2u); + double CurveFanPressureRise_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 2u); - double Qfan = independantVariables[0]; + double Qfan = independentVariables[0]; if (Qfan < minimumValueofQfan()) { LOG(Warn, "Supplied Qfan is below the minimumValueofx, resetting it."); Qfan = minimumValueofQfan(); @@ -84,7 +84,7 @@ namespace model { Qfan = maximumValueofQfan(); } - double Psm = independantVariables[1]; + double Psm = independentVariables[1]; if (Psm < minimumValueofPsm()) { LOG(Warn, "Supplied Psm is below the minimumValueofPsm, resetting it."); Psm = minimumValueofPsm(); diff --git a/src/model/CurveFanPressureRise_Impl.hpp b/src/model/CurveFanPressureRise_Impl.hpp index e3c44fbd831..46f7578e677 100644 --- a/src/model/CurveFanPressureRise_Impl.hpp +++ b/src/model/CurveFanPressureRise_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ diff --git a/src/model/CurveFunctionalPressureDrop.cpp b/src/model/CurveFunctionalPressureDrop.cpp index 4c94532c6fb..095b86dcffb 100644 --- a/src/model/CurveFunctionalPressureDrop.cpp +++ b/src/model/CurveFunctionalPressureDrop.cpp @@ -84,7 +84,7 @@ namespace model { << "for this curve type."); } - double CurveFunctionalPressureDrop_Impl::evaluate(const std::vector& x) const { + double CurveFunctionalPressureDrop_Impl::evaluate(const std::vector& independentVariables) const { LOG_AND_THROW("CurveFunctionalPressureDrop must be evaluated by EnergyPlus, in the context of " << "plant pressure simulations. Therefore, numVariables and evaluate are not applicable " << "for this curve type."); diff --git a/src/model/CurveFunctionalPressureDrop_Impl.hpp b/src/model/CurveFunctionalPressureDrop_Impl.hpp index a840776b81a..27dbd6df07f 100644 --- a/src/model/CurveFunctionalPressureDrop_Impl.hpp +++ b/src/model/CurveFunctionalPressureDrop_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ diff --git a/src/model/CurveLinear.cpp b/src/model/CurveLinear.cpp index 02f4e4cf8d5..ff48db52813 100644 --- a/src/model/CurveLinear.cpp +++ b/src/model/CurveLinear.cpp @@ -70,10 +70,10 @@ namespace model { return 1; } - double CurveLinear_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 1u); + double CurveLinear_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 1u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -213,7 +213,7 @@ namespace model { OS_ASSERT(result); } - bool CurveLinear_Impl::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveLinear_Impl::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { bool result = setString(OS_Curve_LinearFields::InputUnitTypeforX, inputUnitTypeforX); return result; } @@ -223,7 +223,7 @@ namespace model { OS_ASSERT(result); } - bool CurveLinear_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveLinear_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_LinearFields::OutputUnitType, outputUnitType); return result; } @@ -328,7 +328,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveLinear::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveLinear::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { return getImpl()->setInputUnitTypeforX(inputUnitTypeforX); } @@ -336,7 +336,7 @@ namespace model { getImpl()->resetInputUnitTypeforX(); } - bool CurveLinear::setOutputUnitType(std::string outputUnitType) { + bool CurveLinear::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveLinear.hpp b/src/model/CurveLinear.hpp index cad96b303f5..edfd0dac412 100644 --- a/src/model/CurveLinear.hpp +++ b/src/model/CurveLinear.hpp @@ -106,11 +106,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveLinear_Impl.hpp b/src/model/CurveLinear_Impl.hpp index a80021b9e17..f2b196d66b2 100644 --- a/src/model/CurveLinear_Impl.hpp +++ b/src/model/CurveLinear_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -110,11 +110,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveQuadratic.cpp b/src/model/CurveQuadratic.cpp index ff76596bb4c..ce446600ddd 100644 --- a/src/model/CurveQuadratic.cpp +++ b/src/model/CurveQuadratic.cpp @@ -72,10 +72,10 @@ namespace model { return 1; } - double CurveQuadratic_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 1u); + double CurveQuadratic_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 1u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -228,7 +228,7 @@ namespace model { OS_ASSERT(result); } - bool CurveQuadratic_Impl::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveQuadratic_Impl::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { bool result = setString(OS_Curve_QuadraticFields::InputUnitTypeforX, inputUnitTypeforX); return result; } @@ -238,7 +238,7 @@ namespace model { OS_ASSERT(result); } - bool CurveQuadratic_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveQuadratic_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_QuadraticFields::OutputUnitType, outputUnitType); return result; } @@ -352,7 +352,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveQuadratic::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveQuadratic::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { return getImpl()->setInputUnitTypeforX(inputUnitTypeforX); } @@ -360,7 +360,7 @@ namespace model { getImpl()->resetInputUnitTypeforX(); } - bool CurveQuadratic::setOutputUnitType(std::string outputUnitType) { + bool CurveQuadratic::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveQuadratic.hpp b/src/model/CurveQuadratic.hpp index ea5ef5b1dfb..f60d65242b4 100644 --- a/src/model/CurveQuadratic.hpp +++ b/src/model/CurveQuadratic.hpp @@ -110,11 +110,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveQuadraticLinear.cpp b/src/model/CurveQuadraticLinear.cpp index db4ae3f4b18..1b38c6ede1c 100644 --- a/src/model/CurveQuadraticLinear.cpp +++ b/src/model/CurveQuadraticLinear.cpp @@ -73,10 +73,10 @@ namespace model { return 2; } - double CurveQuadraticLinear_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 2u); + double CurveQuadraticLinear_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 2u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -86,7 +86,7 @@ namespace model { x = maximumValueofx(); } - double y = independantVariables[1]; + double y = independentVariables[1]; if (y < minimumValueofy()) { LOG(Warn, "Supplied y is below the minimumValueofy, resetting it."); y = minimumValueofy(); @@ -314,7 +314,7 @@ namespace model { OS_ASSERT(result); } - bool CurveQuadraticLinear_Impl::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveQuadraticLinear_Impl::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { bool result = setString(OS_Curve_QuadraticLinearFields::InputUnitTypeforX, inputUnitTypeforX); return result; } @@ -324,7 +324,7 @@ namespace model { OS_ASSERT(result); } - bool CurveQuadraticLinear_Impl::setInputUnitTypeforY(std::string inputUnitTypeforY) { + bool CurveQuadraticLinear_Impl::setInputUnitTypeforY(const std::string& inputUnitTypeforY) { bool result = setString(OS_Curve_QuadraticLinearFields::InputUnitTypeforY, inputUnitTypeforY); return result; } @@ -334,7 +334,7 @@ namespace model { OS_ASSERT(result); } - bool CurveQuadraticLinear_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveQuadraticLinear_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_QuadraticLinearFields::OutputUnitType, outputUnitType); return result; } @@ -505,7 +505,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveQuadraticLinear::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveQuadraticLinear::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { return getImpl()->setInputUnitTypeforX(inputUnitTypeforX); } @@ -513,7 +513,7 @@ namespace model { getImpl()->resetInputUnitTypeforX(); } - bool CurveQuadraticLinear::setInputUnitTypeforY(std::string inputUnitTypeforY) { + bool CurveQuadraticLinear::setInputUnitTypeforY(const std::string& inputUnitTypeforY) { return getImpl()->setInputUnitTypeforY(inputUnitTypeforY); } @@ -521,7 +521,7 @@ namespace model { getImpl()->resetInputUnitTypeforY(); } - bool CurveQuadraticLinear::setOutputUnitType(std::string outputUnitType) { + bool CurveQuadraticLinear::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveQuadraticLinear.hpp b/src/model/CurveQuadraticLinear.hpp index d531e8a95a9..b6b83d0cca8 100644 --- a/src/model/CurveQuadraticLinear.hpp +++ b/src/model/CurveQuadraticLinear.hpp @@ -137,15 +137,15 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setInputUnitTypeforY(std::string inputUnitTypeforY); + bool setInputUnitTypeforY(const std::string& inputUnitTypeforY); void resetInputUnitTypeforY(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveQuadraticLinear_Impl.hpp b/src/model/CurveQuadraticLinear_Impl.hpp index a3b71db860c..001eed3b7f8 100644 --- a/src/model/CurveQuadraticLinear_Impl.hpp +++ b/src/model/CurveQuadraticLinear_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -138,15 +138,15 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setInputUnitTypeforY(std::string inputUnitTypeforY); + bool setInputUnitTypeforY(const std::string& inputUnitTypeforY); void resetInputUnitTypeforY(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveQuadratic_Impl.hpp b/src/model/CurveQuadratic_Impl.hpp index 49fa70cbacb..f42a578d7aa 100644 --- a/src/model/CurveQuadratic_Impl.hpp +++ b/src/model/CurveQuadratic_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -114,11 +114,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveQuartic.cpp b/src/model/CurveQuartic.cpp index 11bbecf5d23..bc8bd0168eb 100644 --- a/src/model/CurveQuartic.cpp +++ b/src/model/CurveQuartic.cpp @@ -70,10 +70,10 @@ namespace model { return 1; } - double CurveQuartic_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 1u); + double CurveQuartic_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 1u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -252,7 +252,7 @@ namespace model { OS_ASSERT(result); } - bool CurveQuartic_Impl::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveQuartic_Impl::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { bool result = setString(OS_Curve_QuarticFields::InputUnitTypeforX, inputUnitTypeforX); return result; } @@ -262,7 +262,7 @@ namespace model { OS_ASSERT(result); } - bool CurveQuartic_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveQuartic_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_QuarticFields::OutputUnitType, outputUnitType); return result; } @@ -394,7 +394,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveQuartic::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveQuartic::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { return getImpl()->setInputUnitTypeforX(inputUnitTypeforX); } @@ -402,7 +402,7 @@ namespace model { getImpl()->resetInputUnitTypeforX(); } - bool CurveQuartic::setOutputUnitType(std::string outputUnitType) { + bool CurveQuartic::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveQuartic.hpp b/src/model/CurveQuartic.hpp index fca9695d358..58270bccb52 100644 --- a/src/model/CurveQuartic.hpp +++ b/src/model/CurveQuartic.hpp @@ -118,11 +118,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveQuartic_Impl.hpp b/src/model/CurveQuartic_Impl.hpp index 1ca5d7ee576..0f646f6266d 100644 --- a/src/model/CurveQuartic_Impl.hpp +++ b/src/model/CurveQuartic_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -122,11 +122,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveRectangularHyperbola1.cpp b/src/model/CurveRectangularHyperbola1.cpp index a0750ae777a..85159feb998 100644 --- a/src/model/CurveRectangularHyperbola1.cpp +++ b/src/model/CurveRectangularHyperbola1.cpp @@ -73,10 +73,10 @@ namespace model { return 1; } - double CurveRectangularHyperbola1_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 1u); + double CurveRectangularHyperbola1_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 1u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -230,7 +230,7 @@ namespace model { OS_ASSERT(result); } - bool CurveRectangularHyperbola1_Impl::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveRectangularHyperbola1_Impl::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { bool result = setString(OS_Curve_RectangularHyperbola1Fields::InputUnitTypeforx, inputUnitTypeforx); return result; } @@ -240,7 +240,7 @@ namespace model { OS_ASSERT(result); } - bool CurveRectangularHyperbola1_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveRectangularHyperbola1_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_RectangularHyperbola1Fields::OutputUnitType, outputUnitType); return result; } @@ -354,7 +354,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveRectangularHyperbola1::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveRectangularHyperbola1::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { return getImpl()->setInputUnitTypeforx(inputUnitTypeforx); } @@ -362,7 +362,7 @@ namespace model { getImpl()->resetInputUnitTypeforx(); } - bool CurveRectangularHyperbola1::setOutputUnitType(std::string outputUnitType) { + bool CurveRectangularHyperbola1::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveRectangularHyperbola1.hpp b/src/model/CurveRectangularHyperbola1.hpp index 52032fc5144..81e76c06246 100644 --- a/src/model/CurveRectangularHyperbola1.hpp +++ b/src/model/CurveRectangularHyperbola1.hpp @@ -110,11 +110,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveRectangularHyperbola1_Impl.hpp b/src/model/CurveRectangularHyperbola1_Impl.hpp index 05532d68fd8..e475385ff90 100644 --- a/src/model/CurveRectangularHyperbola1_Impl.hpp +++ b/src/model/CurveRectangularHyperbola1_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -114,11 +114,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveRectangularHyperbola2.cpp b/src/model/CurveRectangularHyperbola2.cpp index fb7e652da58..13ba0d43f32 100644 --- a/src/model/CurveRectangularHyperbola2.cpp +++ b/src/model/CurveRectangularHyperbola2.cpp @@ -73,10 +73,10 @@ namespace model { return 1; } - double CurveRectangularHyperbola2_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 1u); + double CurveRectangularHyperbola2_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 1u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -230,7 +230,7 @@ namespace model { OS_ASSERT(result); } - bool CurveRectangularHyperbola2_Impl::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveRectangularHyperbola2_Impl::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { bool result = setString(OS_Curve_RectangularHyperbola2Fields::InputUnitTypeforx, inputUnitTypeforx); return result; } @@ -240,7 +240,7 @@ namespace model { OS_ASSERT(result); } - bool CurveRectangularHyperbola2_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveRectangularHyperbola2_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_RectangularHyperbola2Fields::OutputUnitType, outputUnitType); return result; } @@ -354,7 +354,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveRectangularHyperbola2::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveRectangularHyperbola2::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { return getImpl()->setInputUnitTypeforx(inputUnitTypeforx); } @@ -362,7 +362,7 @@ namespace model { getImpl()->resetInputUnitTypeforx(); } - bool CurveRectangularHyperbola2::setOutputUnitType(std::string outputUnitType) { + bool CurveRectangularHyperbola2::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveRectangularHyperbola2.hpp b/src/model/CurveRectangularHyperbola2.hpp index 5bf1a7f6dec..c13f3a3017d 100644 --- a/src/model/CurveRectangularHyperbola2.hpp +++ b/src/model/CurveRectangularHyperbola2.hpp @@ -111,11 +111,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveRectangularHyperbola2_Impl.hpp b/src/model/CurveRectangularHyperbola2_Impl.hpp index 685f10b1a9f..e6ca16d1c32 100644 --- a/src/model/CurveRectangularHyperbola2_Impl.hpp +++ b/src/model/CurveRectangularHyperbola2_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -114,11 +114,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveSigmoid.cpp b/src/model/CurveSigmoid.cpp index afc0d7bf3cd..ce41c6c20f0 100644 --- a/src/model/CurveSigmoid.cpp +++ b/src/model/CurveSigmoid.cpp @@ -70,10 +70,10 @@ namespace model { return 1; } - double CurveSigmoid_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 1u); + double CurveSigmoid_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 1u); - double x = independantVariables[0]; + double x = independentVariables[0]; if (x < minimumValueofx()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); x = minimumValueofx(); @@ -254,7 +254,7 @@ namespace model { OS_ASSERT(result); } - bool CurveSigmoid_Impl::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveSigmoid_Impl::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { bool result = setString(OS_Curve_SigmoidFields::InputUnitTypeforx, inputUnitTypeforx); return result; } @@ -265,7 +265,7 @@ namespace model { OS_ASSERT(result); } - bool CurveSigmoid_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveSigmoid_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_SigmoidFields::OutputUnitType, outputUnitType); return result; } @@ -397,7 +397,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveSigmoid::setInputUnitTypeforx(std::string inputUnitTypeforx) { + bool CurveSigmoid::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { return getImpl()->setInputUnitTypeforx(inputUnitTypeforx); } @@ -405,7 +405,7 @@ namespace model { getImpl()->resetInputUnitTypeforx(); } - bool CurveSigmoid::setOutputUnitType(std::string outputUnitType) { + bool CurveSigmoid::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveSigmoid.hpp b/src/model/CurveSigmoid.hpp index ffa96eac527..dc4df3b272a 100644 --- a/src/model/CurveSigmoid.hpp +++ b/src/model/CurveSigmoid.hpp @@ -118,11 +118,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveSigmoid_Impl.hpp b/src/model/CurveSigmoid_Impl.hpp index 5afedd72dd6..dee2a90dad9 100644 --- a/src/model/CurveSigmoid_Impl.hpp +++ b/src/model/CurveSigmoid_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -122,11 +122,11 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforx(std::string inputUnitTypeforx); + bool setInputUnitTypeforx(const std::string& inputUnitTypeforx); void resetInputUnitTypeforx(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveTriquadratic.cpp b/src/model/CurveTriquadratic.cpp index 508c159bcd1..c7c36deaa80 100644 --- a/src/model/CurveTriquadratic.cpp +++ b/src/model/CurveTriquadratic.cpp @@ -73,12 +73,12 @@ namespace model { return 3; } - double CurveTriquadratic_Impl::evaluate(const std::vector& independantVariables) const { - OS_ASSERT(independantVariables.size() == 3u); + double CurveTriquadratic_Impl::evaluate(const std::vector& independentVariables) const { + OS_ASSERT(independentVariables.size() == 3u); // TODO: I think minimumValueofx/y/z etc shouldn't be optionals to match other curves... - double x = independantVariables[0]; + double x = independentVariables[0]; if (boost::optional _val = minimumValueofx()) { if (x < _val.get()) { LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); @@ -92,7 +92,7 @@ namespace model { } } - double y = independantVariables[1]; + double y = independentVariables[1]; if (boost::optional _val = minimumValueofy()) { if (y < _val.get()) { LOG(Warn, "Supplied y is below the minimumValueofy, resetting it."); @@ -106,7 +106,7 @@ namespace model { } } - double z = independantVariables[2]; + double z = independentVariables[2]; if (boost::optional _val = minimumValueofz()) { if (z < _val.get()) { LOG(Warn, "Supplied z is below the minimumValueofz, resetting it."); @@ -966,7 +966,7 @@ namespace model { OS_ASSERT(result); } - bool CurveTriquadratic_Impl::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveTriquadratic_Impl::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { bool result = setString(OS_Curve_TriquadraticFields::InputUnitTypeforX, inputUnitTypeforX); return result; } @@ -976,7 +976,7 @@ namespace model { OS_ASSERT(result); } - bool CurveTriquadratic_Impl::setInputUnitTypeforY(std::string inputUnitTypeforY) { + bool CurveTriquadratic_Impl::setInputUnitTypeforY(const std::string& inputUnitTypeforY) { bool result = setString(OS_Curve_TriquadraticFields::InputUnitTypeforY, inputUnitTypeforY); return result; } @@ -986,7 +986,7 @@ namespace model { OS_ASSERT(result); } - bool CurveTriquadratic_Impl::setInputUnitTypeforZ(std::string inputUnitTypeforZ) { + bool CurveTriquadratic_Impl::setInputUnitTypeforZ(const std::string& inputUnitTypeforZ) { bool result = setString(OS_Curve_TriquadraticFields::InputUnitTypeforZ, inputUnitTypeforZ); return result; } @@ -996,7 +996,7 @@ namespace model { OS_ASSERT(result); } - bool CurveTriquadratic_Impl::setOutputUnitType(std::string outputUnitType) { + bool CurveTriquadratic_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Curve_TriquadraticFields::OutputUnitType, outputUnitType); return result; } @@ -1485,7 +1485,7 @@ namespace model { getImpl()->resetMaximumCurveOutput(); } - bool CurveTriquadratic::setInputUnitTypeforX(std::string inputUnitTypeforX) { + bool CurveTriquadratic::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { return getImpl()->setInputUnitTypeforX(inputUnitTypeforX); } @@ -1493,7 +1493,7 @@ namespace model { getImpl()->resetInputUnitTypeforX(); } - bool CurveTriquadratic::setInputUnitTypeforY(std::string inputUnitTypeforY) { + bool CurveTriquadratic::setInputUnitTypeforY(const std::string& inputUnitTypeforY) { return getImpl()->setInputUnitTypeforY(inputUnitTypeforY); } @@ -1501,7 +1501,7 @@ namespace model { getImpl()->resetInputUnitTypeforY(); } - bool CurveTriquadratic::setInputUnitTypeforZ(std::string inputUnitTypeforZ) { + bool CurveTriquadratic::setInputUnitTypeforZ(const std::string& inputUnitTypeforZ) { return getImpl()->setInputUnitTypeforZ(inputUnitTypeforZ); } @@ -1509,7 +1509,7 @@ namespace model { getImpl()->resetInputUnitTypeforZ(); } - bool CurveTriquadratic::setOutputUnitType(std::string outputUnitType) { + bool CurveTriquadratic::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/CurveTriquadratic.hpp b/src/model/CurveTriquadratic.hpp index 4a4d313597c..ff61993308c 100644 --- a/src/model/CurveTriquadratic.hpp +++ b/src/model/CurveTriquadratic.hpp @@ -307,19 +307,19 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setInputUnitTypeforY(std::string inputUnitTypeforY); + bool setInputUnitTypeforY(const std::string& inputUnitTypeforY); void resetInputUnitTypeforY(); - bool setInputUnitTypeforZ(std::string inputUnitTypeforZ); + bool setInputUnitTypeforZ(const std::string& inputUnitTypeforZ); void resetInputUnitTypeforZ(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/CurveTriquadratic_Impl.hpp b/src/model/CurveTriquadratic_Impl.hpp index 12f86e3efdd..d2380f90750 100644 --- a/src/model/CurveTriquadratic_Impl.hpp +++ b/src/model/CurveTriquadratic_Impl.hpp @@ -64,7 +64,7 @@ namespace model { virtual int numVariables() const override; - virtual double evaluate(const std::vector& x) const override; + virtual double evaluate(const std::vector& independentVariables) const override; //@} /** @name Getters */ @@ -300,19 +300,19 @@ namespace model { void resetMaximumCurveOutput(); - bool setInputUnitTypeforX(std::string inputUnitTypeforX); + bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); void resetInputUnitTypeforX(); - bool setInputUnitTypeforY(std::string inputUnitTypeforY); + bool setInputUnitTypeforY(const std::string& inputUnitTypeforY); void resetInputUnitTypeforY(); - bool setInputUnitTypeforZ(std::string inputUnitTypeforZ); + bool setInputUnitTypeforZ(const std::string& inputUnitTypeforZ); void resetInputUnitTypeforZ(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/DaylightingControl.cpp b/src/model/DaylightingControl.cpp index 7acf2d1cfb1..65c053802ec 100644 --- a/src/model/DaylightingControl.cpp +++ b/src/model/DaylightingControl.cpp @@ -254,7 +254,7 @@ namespace model { OS_ASSERT(result); } - bool DaylightingControl_Impl::setLightingControlType(std::string lightingControlType) { + bool DaylightingControl_Impl::setLightingControlType(const std::string& lightingControlType) { bool result = setString(OS_Daylighting_ControlFields::LightingControlType, lightingControlType); return result; } @@ -584,7 +584,7 @@ namespace model { getImpl()->resetIlluminanceSetpoint(); } - bool DaylightingControl::setLightingControlType(std::string lightingControlType) { + bool DaylightingControl::setLightingControlType(const std::string& lightingControlType) { return getImpl()->setLightingControlType(lightingControlType); } diff --git a/src/model/DaylightingControl.hpp b/src/model/DaylightingControl.hpp index 0ff89b61922..b5ff5b437ad 100644 --- a/src/model/DaylightingControl.hpp +++ b/src/model/DaylightingControl.hpp @@ -143,7 +143,7 @@ namespace model { void resetIlluminanceSetpoint(); - bool setLightingControlType(std::string lightingControlType); + bool setLightingControlType(const std::string& lightingControlType); void resetLightingControlType(); diff --git a/src/model/DaylightingControl_Impl.hpp b/src/model/DaylightingControl_Impl.hpp index 2279884d77d..f395c2a23fd 100644 --- a/src/model/DaylightingControl_Impl.hpp +++ b/src/model/DaylightingControl_Impl.hpp @@ -143,7 +143,7 @@ namespace model { void resetIlluminanceSetpoint(); - bool setLightingControlType(std::string lightingControlType); + bool setLightingControlType(const std::string& lightingControlType); void resetLightingControlType(); @@ -185,7 +185,7 @@ namespace model { bool isSecondaryDaylightingControl() const; - bool aimAt(const Point3d& point); + bool aimAt(const Point3d& target); protected: // index of the space name diff --git a/src/model/DesignDay.cpp b/src/model/DesignDay.cpp index 128bc55211f..90b7fa75723 100644 --- a/src/model/DesignDay.cpp +++ b/src/model/DesignDay.cpp @@ -397,7 +397,7 @@ namespace model { OS_ASSERT(result); } - bool DesignDay_Impl::setDayType(std::string dayType) { + bool DesignDay_Impl::setDayType(const std::string& dayType) { bool result = setString(OS_SizingPeriod_DesignDayFields::DayType, dayType); return result; } @@ -421,7 +421,7 @@ namespace model { OS_ASSERT(result); } - bool DesignDay_Impl::setHumidityIndicatingType(std::string humidityIndicatingType) { + bool DesignDay_Impl::setHumidityIndicatingType(const std::string& humidityIndicatingType) { bool result = setString(OS_SizingPeriod_DesignDayFields::HumidityIndicatingType, humidityIndicatingType); return result; } @@ -439,7 +439,7 @@ namespace model { this->setString(OS_SizingPeriod_DesignDayFields::HumidityIndicatingDayScheduleName, ""); } - bool DesignDay_Impl::setDryBulbTemperatureRangeModifierType(std::string dryBulbTemperatureRangeModifierType) { + bool DesignDay_Impl::setDryBulbTemperatureRangeModifierType(const std::string& dryBulbTemperatureRangeModifierType) { bool result = setString(OS_SizingPeriod_DesignDayFields::DryBulbTemperatureRangeModifierType, dryBulbTemperatureRangeModifierType); return result; } @@ -458,7 +458,7 @@ namespace model { this->setString(OS_SizingPeriod_DesignDayFields::DryBulbTemperatureRangeModifierScheduleName, ""); } - bool DesignDay_Impl::setSolarModelIndicator(std::string solarModelIndicator) { + bool DesignDay_Impl::setSolarModelIndicator(const std::string& solarModelIndicator) { bool result = setString(OS_SizingPeriod_DesignDayFields::SolarModelIndicator, solarModelIndicator); return result; } @@ -921,7 +921,7 @@ namespace model { getImpl()->resetMonth(); } - bool DesignDay::setDayType(std::string dayType) { + bool DesignDay::setDayType(const std::string& dayType) { return getImpl()->setDayType(dayType); } @@ -937,7 +937,7 @@ namespace model { getImpl()->resetDaylightSavingTimeIndicator(); } - bool DesignDay::setHumidityIndicatingType(std::string humidityIndicatingType) { + bool DesignDay::setHumidityIndicatingType(const std::string& humidityIndicatingType) { return getImpl()->setHumidityIndicatingType(humidityIndicatingType); } @@ -953,7 +953,7 @@ namespace model { getImpl()->resetHumidityIndicatingDaySchedule(); } - bool DesignDay::setDryBulbTemperatureRangeModifierType(std::string dryBulbTemperatureRangeModifierType) { + bool DesignDay::setDryBulbTemperatureRangeModifierType(const std::string& dryBulbTemperatureRangeModifierType) { return getImpl()->setDryBulbTemperatureRangeModifierType(dryBulbTemperatureRangeModifierType); } @@ -969,7 +969,7 @@ namespace model { getImpl()->resetDryBulbTemperatureRangeModifierSchedule(); } - bool DesignDay::setSolarModelIndicator(std::string solarModelIndicator) { + bool DesignDay::setSolarModelIndicator(const std::string& solarModelIndicator) { return getImpl()->setSolarModelIndicator(solarModelIndicator); } diff --git a/src/model/DesignDay.hpp b/src/model/DesignDay.hpp index 4e6bb56ed8a..22236a755a5 100644 --- a/src/model/DesignDay.hpp +++ b/src/model/DesignDay.hpp @@ -195,7 +195,7 @@ namespace model { void resetMonth(); - bool setDayType(std::string dayType); + bool setDayType(const std::string& dayType); void resetDayType(); @@ -203,7 +203,7 @@ namespace model { void resetDaylightSavingTimeIndicator(); - bool setHumidityIndicatingType(std::string humidityIndicatingType); + bool setHumidityIndicatingType(const std::string& humidityIndicatingType); void resetHumidityIndicatingType(); @@ -214,7 +214,7 @@ namespace model { void resetHumidityIndicatingDaySchedule(); - bool setDryBulbTemperatureRangeModifierType(std::string dryBulbTemperatureRangeModifierType); + bool setDryBulbTemperatureRangeModifierType(const std::string& dryBulbTemperatureRangeModifierType); void resetDryBulbTemperatureRangeModifierType(); @@ -225,7 +225,7 @@ namespace model { void resetDryBulbTemperatureRangeModifierSchedule(); - bool setSolarModelIndicator(std::string solarModelIndicator); + bool setSolarModelIndicator(const std::string& solarModelIndicator); void resetSolarModelIndicator(); @@ -237,11 +237,11 @@ namespace model { void resetDiffuseSolarDaySchedule(); - bool setAshraeTaub(double aSHRAETaub); + bool setAshraeTaub(double ashraeTaub); void resetAshraeTaub(); - bool setAshraeTaud(double aSHRAETaud); + bool setAshraeTaud(double ashraeTaud); void resetAshraeTaud(); diff --git a/src/model/DesignDay_Impl.hpp b/src/model/DesignDay_Impl.hpp index c792446e7aa..8396f12d9aa 100644 --- a/src/model/DesignDay_Impl.hpp +++ b/src/model/DesignDay_Impl.hpp @@ -193,7 +193,7 @@ namespace model { void resetMonth(); - bool setDayType(std::string dayType); + bool setDayType(const std::string& dayType); void resetDayType(); @@ -201,7 +201,7 @@ namespace model { void resetDaylightSavingTimeIndicator(); - bool setHumidityIndicatingType(std::string humidityIndicatingType); + bool setHumidityIndicatingType(const std::string& humidityIndicatingType); void resetHumidityIndicatingType(); @@ -209,7 +209,7 @@ namespace model { void resetHumidityIndicatingDaySchedule(); - bool setDryBulbTemperatureRangeModifierType(std::string dryBulbTemperatureRangeModifierType); + bool setDryBulbTemperatureRangeModifierType(const std::string& dryBulbTemperatureRangeModifierType); void resetDryBulbTemperatureRangeModifierType(); @@ -217,7 +217,7 @@ namespace model { void resetDryBulbTemperatureRangeModifierSchedule(); - bool setSolarModelIndicator(std::string solarModelIndicator); + bool setSolarModelIndicator(const std::string& solarModelIndicator); void resetSolarModelIndicator(); diff --git a/src/model/DesignSpecificationOutdoorAir.cpp b/src/model/DesignSpecificationOutdoorAir.cpp index 983cf90e15b..a2ceebe76de 100644 --- a/src/model/DesignSpecificationOutdoorAir.cpp +++ b/src/model/DesignSpecificationOutdoorAir.cpp @@ -132,7 +132,7 @@ namespace model { return getObject().getModelObjectTarget(OS_DesignSpecification_OutdoorAirFields::OutdoorAirFlowRateFractionScheduleName); } - bool DesignSpecificationOutdoorAir_Impl::setOutdoorAirMethod(std::string outdoorAirMethod) { + bool DesignSpecificationOutdoorAir_Impl::setOutdoorAirMethod(const std::string& outdoorAirMethod) { bool result = setString(OS_DesignSpecification_OutdoorAirFields::OutdoorAirMethod, outdoorAirMethod); return result; } @@ -285,7 +285,7 @@ namespace model { return getImpl()->outdoorAirFlowRateFractionSchedule(); } - bool DesignSpecificationOutdoorAir::setOutdoorAirMethod(std::string outdoorAirMethod) { + bool DesignSpecificationOutdoorAir::setOutdoorAirMethod(const std::string& outdoorAirMethod) { return getImpl()->setOutdoorAirMethod(outdoorAirMethod); } diff --git a/src/model/DesignSpecificationOutdoorAir.hpp b/src/model/DesignSpecificationOutdoorAir.hpp index 19d072eb8a5..b4116e2d710 100644 --- a/src/model/DesignSpecificationOutdoorAir.hpp +++ b/src/model/DesignSpecificationOutdoorAir.hpp @@ -95,7 +95,7 @@ namespace model { /** @name Setters */ //@{ - bool setOutdoorAirMethod(std::string outdoorAirMethod); + bool setOutdoorAirMethod(const std::string& outdoorAirMethod); void resetOutdoorAirMethod(); diff --git a/src/model/DesignSpecificationOutdoorAir_Impl.hpp b/src/model/DesignSpecificationOutdoorAir_Impl.hpp index 6589c7308ae..9a4df3d850a 100644 --- a/src/model/DesignSpecificationOutdoorAir_Impl.hpp +++ b/src/model/DesignSpecificationOutdoorAir_Impl.hpp @@ -97,7 +97,7 @@ namespace model { /** @name Setters */ //@{ - bool setOutdoorAirMethod(std::string outdoorAirMethod); + bool setOutdoorAirMethod(const std::string& outdoorAirMethod); void resetOutdoorAirMethod(); diff --git a/src/model/Duct.cpp b/src/model/Duct.cpp index c835a5b973c..e607ff6062b 100644 --- a/src/model/Duct.cpp +++ b/src/model/Duct.cpp @@ -76,7 +76,7 @@ namespace model { return StraightComponent_Impl::addToNode(node); } - if (auto oa = node.airLoopHVACOutdoorAirSystem()) { + if (node.airLoopHVACOutdoorAirSystem()) { return StraightComponent_Impl::addToNode(node); } diff --git a/src/model/ElectricEquipmentITEAirCooledDefinition.cpp b/src/model/ElectricEquipmentITEAirCooledDefinition.cpp index 8b652b1bdb3..547f1ef882c 100644 --- a/src/model/ElectricEquipmentITEAirCooledDefinition.cpp +++ b/src/model/ElectricEquipmentITEAirCooledDefinition.cpp @@ -570,9 +570,9 @@ namespace model { } ElectricEquipmentITEAirCooledDefinition::ElectricEquipmentITEAirCooledDefinition(const Model& model, - Curve& cPUPowerInputFunctionofLoadingandAirTemperatureCurve, - Curve& airFlowFunctionofLoadingandAirTemperatureCurve, - Curve& fanPowerInputFunctionofFlowCurve) + const Curve& cPUPowerInputFunctionofLoadingandAirTemperatureCurve, + const Curve& airFlowFunctionofLoadingandAirTemperatureCurve, + const Curve& fanPowerInputFunctionofFlowCurve) : SpaceLoadDefinition(ElectricEquipmentITEAirCooledDefinition::iddObjectType(), model) { OS_ASSERT(getImpl()); diff --git a/src/model/ElectricEquipmentITEAirCooledDefinition.hpp b/src/model/ElectricEquipmentITEAirCooledDefinition.hpp index 4ecfa799443..bbb97d93638 100644 --- a/src/model/ElectricEquipmentITEAirCooledDefinition.hpp +++ b/src/model/ElectricEquipmentITEAirCooledDefinition.hpp @@ -54,8 +54,9 @@ namespace model { /** @name Constructors and Destructors */ //@{ - explicit ElectricEquipmentITEAirCooledDefinition(const Model& model, Curve& cPUPowerInputFunctionofLoadingandAirTemperatureCurve, - Curve& airFlowFunctionofLoadingandAirTemperatureCurve, Curve& fanPowerInputFunctionofFlowCurve); + explicit ElectricEquipmentITEAirCooledDefinition(const Model& model, const Curve& cPUPowerInputFunctionofLoadingandAirTemperatureCurve, + const Curve& airFlowFunctionofLoadingandAirTemperatureCurve, + const Curve& fanPowerInputFunctionofFlowCurve); /** Create ElectricEquipmentITEAirCooledDefinition with default curves **/ explicit ElectricEquipmentITEAirCooledDefinition(const Model& model); diff --git a/src/model/ElectricLoadCenterTransformer.cpp b/src/model/ElectricLoadCenterTransformer.cpp index c2c1b14e4b5..89eeb74b0c1 100644 --- a/src/model/ElectricLoadCenterTransformer.cpp +++ b/src/model/ElectricLoadCenterTransformer.cpp @@ -449,7 +449,6 @@ namespace model { bool ElectricLoadCenterTransformer_Impl::eraseMeter(unsigned index) { //erase program at index bool result = false; - auto groups = extensibleGroups(); unsigned sizeOfGroup = numExtensibleGroups(); if (index < sizeOfGroup) { @@ -475,8 +474,8 @@ namespace model { bool ElectricLoadCenterTransformer_Impl::setMeter(const std::string& meterName, unsigned index) { //add meter to {index} of vector of meters bool result = false; - auto groups = extensibleGroups(); unsigned sizeOfGroup = numExtensibleGroups(); + if (index <= sizeOfGroup) { IdfExtensibleGroup idfGroup = insertExtensibleGroup(index, StringVector()); OS_ASSERT(!idfGroup.empty()); diff --git a/src/model/EnergyManagementSystemProgramCallingManager.cpp b/src/model/EnergyManagementSystemProgramCallingManager.cpp index 79fbce8e519..d7ae8ff4c46 100644 --- a/src/model/EnergyManagementSystemProgramCallingManager.cpp +++ b/src/model/EnergyManagementSystemProgramCallingManager.cpp @@ -119,7 +119,6 @@ namespace model { bool EnergyManagementSystemProgramCallingManager_Impl::eraseProgram(unsigned index) { //erase program at index bool result = false; - auto groups = extensibleGroups(); unsigned sizeOfGroup = numExtensibleGroups(); if (index < sizeOfGroup) { @@ -145,8 +144,8 @@ namespace model { bool EnergyManagementSystemProgramCallingManager_Impl::setProgram(const EnergyManagementSystemProgram& program, unsigned index) { //add program to {index} of vector of programs bool result = false; - auto groups = extensibleGroups(); unsigned sizeOfGroup = numExtensibleGroups(); + if (index <= sizeOfGroup) { IdfExtensibleGroup idfGroup = insertExtensibleGroup(index, StringVector()); OS_ASSERT(!idfGroup.empty()); diff --git a/src/model/EvaporativeCoolerIndirectResearchSpecial.cpp b/src/model/EvaporativeCoolerIndirectResearchSpecial.cpp index 4905d3d1a46..352f0117b1c 100644 --- a/src/model/EvaporativeCoolerIndirectResearchSpecial.cpp +++ b/src/model/EvaporativeCoolerIndirectResearchSpecial.cpp @@ -275,7 +275,7 @@ namespace model { } } - if (auto oa = node.airLoopHVACOutdoorAirSystem()) { + if (node.airLoopHVACOutdoorAirSystem()) { return StraightComponent_Impl::addToNode(node); } diff --git a/src/model/EvaporativeFluidCoolerTwoSpeed.cpp b/src/model/EvaporativeFluidCoolerTwoSpeed.cpp index 4069692cdb9..49d2b55afab 100644 --- a/src/model/EvaporativeFluidCoolerTwoSpeed.cpp +++ b/src/model/EvaporativeFluidCoolerTwoSpeed.cpp @@ -425,7 +425,7 @@ namespace model { return result; } - bool EvaporativeFluidCoolerTwoSpeed_Impl::setPerformanceInputMethod(std::string performanceInputMethod) { + bool EvaporativeFluidCoolerTwoSpeed_Impl::setPerformanceInputMethod(const std::string& performanceInputMethod) { bool result = setString(OS_EvaporativeFluidCooler_TwoSpeedFields::PerformanceInputMethod, performanceInputMethod); return result; } @@ -667,7 +667,7 @@ namespace model { return result; } - bool EvaporativeFluidCoolerTwoSpeed_Impl::setEvaporationLossMode(std::string evaporationLossMode) { + bool EvaporativeFluidCoolerTwoSpeed_Impl::setEvaporationLossMode(const std::string& evaporationLossMode) { bool result = setString(OS_EvaporativeFluidCooler_TwoSpeedFields::EvaporationLossMode, evaporationLossMode); return result; } @@ -695,7 +695,7 @@ namespace model { return result; } - bool EvaporativeFluidCoolerTwoSpeed_Impl::setBlowdownCalculationMode(std::string blowdownCalculationMode) { + bool EvaporativeFluidCoolerTwoSpeed_Impl::setBlowdownCalculationMode(const std::string& blowdownCalculationMode) { bool result = setString(OS_EvaporativeFluidCooler_TwoSpeedFields::BlowdownCalculationMode, blowdownCalculationMode); return result; } @@ -1086,11 +1086,11 @@ namespace model { return getImpl()->setDesignSprayWaterFlowRate(designSprayWaterFlowRate); } - bool EvaporativeFluidCoolerTwoSpeed::setPerformanceInputMethod(std::string performanceInputMethod) { + bool EvaporativeFluidCoolerTwoSpeed::setPerformanceInputMethod(const std::string& performanceInputMethod) { return getImpl()->setPerformanceInputMethod(performanceInputMethod); } - bool EvaporativeFluidCoolerTwoSpeed::setOutdoorAirInletNodeName(std::string outdoorAirInletNodeName) { + bool EvaporativeFluidCoolerTwoSpeed::setOutdoorAirInletNodeName(const std::string& outdoorAirInletNodeName) { return getImpl()->setOutdoorAirInletNodeName(outdoorAirInletNodeName); } @@ -1222,7 +1222,7 @@ namespace model { return getImpl()->setHighSpeedSizingFactor(highSpeedSizingFactor); } - bool EvaporativeFluidCoolerTwoSpeed::setEvaporationLossMode(std::string evaporationLossMode) { + bool EvaporativeFluidCoolerTwoSpeed::setEvaporationLossMode(const std::string& evaporationLossMode) { return getImpl()->setEvaporationLossMode(evaporationLossMode); } @@ -1238,7 +1238,7 @@ namespace model { return getImpl()->setDriftLossPercent(driftLossPercent); } - bool EvaporativeFluidCoolerTwoSpeed::setBlowdownCalculationMode(std::string blowdownCalculationMode) { + bool EvaporativeFluidCoolerTwoSpeed::setBlowdownCalculationMode(const std::string& blowdownCalculationMode) { return getImpl()->setBlowdownCalculationMode(blowdownCalculationMode); } diff --git a/src/model/EvaporativeFluidCoolerTwoSpeed.hpp b/src/model/EvaporativeFluidCoolerTwoSpeed.hpp index 49d7ac2db07..863c2625746 100644 --- a/src/model/EvaporativeFluidCoolerTwoSpeed.hpp +++ b/src/model/EvaporativeFluidCoolerTwoSpeed.hpp @@ -176,9 +176,9 @@ namespace model { bool setDesignSprayWaterFlowRate(double designSprayWaterFlowRate); - bool setPerformanceInputMethod(std::string performanceInputMethod); + bool setPerformanceInputMethod(const std::string& performanceInputMethod); - bool setOutdoorAirInletNodeName(std::string outdoorAirInletNodeName); + bool setOutdoorAirInletNodeName(const std::string& outdoorAirInletNodeName); void resetOutdoorAirInletNodeName(); @@ -242,7 +242,7 @@ namespace model { bool setHighSpeedSizingFactor(double highSpeedSizingFactor); - bool setEvaporationLossMode(std::string evaporationLossMode); + bool setEvaporationLossMode(const std::string& evaporationLossMode); bool setEvaporationLossFactor(double evaporationLossFactor); @@ -250,7 +250,7 @@ namespace model { bool setDriftLossPercent(double driftLossPercent); - bool setBlowdownCalculationMode(std::string blowdownCalculationMode); + bool setBlowdownCalculationMode(const std::string& blowdownCalculationMode); bool setBlowdownConcentrationRatio(double blowdownConcentrationRatio); diff --git a/src/model/EvaporativeFluidCoolerTwoSpeed_Impl.hpp b/src/model/EvaporativeFluidCoolerTwoSpeed_Impl.hpp index ae6ee9dfd59..4a70234071f 100644 --- a/src/model/EvaporativeFluidCoolerTwoSpeed_Impl.hpp +++ b/src/model/EvaporativeFluidCoolerTwoSpeed_Impl.hpp @@ -204,7 +204,7 @@ namespace model { bool setDesignSprayWaterFlowRate(double designSprayWaterFlowRate); - bool setPerformanceInputMethod(std::string performanceInputMethod); + bool setPerformanceInputMethod(const std::string& performanceInputMethod); bool setOutdoorAirInletNodeName(boost::optional outdoorAirInletNodeName); @@ -270,7 +270,7 @@ namespace model { bool setHighSpeedSizingFactor(double highSpeedSizingFactor); - bool setEvaporationLossMode(std::string evaporationLossMode); + bool setEvaporationLossMode(const std::string& evaporationLossMode); bool setEvaporationLossFactor(boost::optional evaporationLossFactor); @@ -278,7 +278,7 @@ namespace model { bool setDriftLossPercent(double driftLossPercent); - bool setBlowdownCalculationMode(std::string blowdownCalculationMode); + bool setBlowdownCalculationMode(const std::string& blowdownCalculationMode); bool setBlowdownConcentrationRatio(double blowdownConcentrationRatio); diff --git a/src/model/ExternalInterfaceActuator_Impl.hpp b/src/model/ExternalInterfaceActuator_Impl.hpp index 87518deb8be..d226d57b202 100644 --- a/src/model/ExternalInterfaceActuator_Impl.hpp +++ b/src/model/ExternalInterfaceActuator_Impl.hpp @@ -57,9 +57,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/ExternalInterfaceFunctionalMockupUnitExportFromVariable_Impl.hpp b/src/model/ExternalInterfaceFunctionalMockupUnitExportFromVariable_Impl.hpp index 9d77ada2ccb..20f17306ff0 100644 --- a/src/model/ExternalInterfaceFunctionalMockupUnitExportFromVariable_Impl.hpp +++ b/src/model/ExternalInterfaceFunctionalMockupUnitExportFromVariable_Impl.hpp @@ -59,9 +59,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/ExternalInterfaceFunctionalMockupUnitExportToActuator_Impl.hpp b/src/model/ExternalInterfaceFunctionalMockupUnitExportToActuator_Impl.hpp index 92c72225bf8..88571b2ad8c 100644 --- a/src/model/ExternalInterfaceFunctionalMockupUnitExportToActuator_Impl.hpp +++ b/src/model/ExternalInterfaceFunctionalMockupUnitExportToActuator_Impl.hpp @@ -59,9 +59,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/ExternalInterfaceFunctionalMockupUnitExportToVariable_Impl.hpp b/src/model/ExternalInterfaceFunctionalMockupUnitExportToVariable_Impl.hpp index 891b02c23dd..91dc531a5bf 100644 --- a/src/model/ExternalInterfaceFunctionalMockupUnitExportToVariable_Impl.hpp +++ b/src/model/ExternalInterfaceFunctionalMockupUnitExportToVariable_Impl.hpp @@ -59,9 +59,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/ExternalInterfaceFunctionalMockupUnitImport.cpp b/src/model/ExternalInterfaceFunctionalMockupUnitImport.cpp index 7ceb8af7940..e39172f0c39 100644 --- a/src/model/ExternalInterfaceFunctionalMockupUnitImport.cpp +++ b/src/model/ExternalInterfaceFunctionalMockupUnitImport.cpp @@ -113,7 +113,7 @@ namespace model { OS_ASSERT(result); } - bool ExternalInterfaceFunctionalMockupUnitImport_Impl::setFMUFileName(std::string fMUName) { + bool ExternalInterfaceFunctionalMockupUnitImport_Impl::setFMUFileName(const std::string& fMUName) { bool result = setString(OS_ExternalInterface_FunctionalMockupUnitImportFields::FMUFileName, fMUName); return result; } @@ -175,7 +175,7 @@ namespace model { getImpl()->resetFMULoggingOn(); } - bool ExternalInterfaceFunctionalMockupUnitImport::setFMUFileName(std::string fMUName) { + bool ExternalInterfaceFunctionalMockupUnitImport::setFMUFileName(const std::string& fMUName) { return getImpl()->setFMUFileName(fMUName); } diff --git a/src/model/ExternalInterfaceFunctionalMockupUnitImport.hpp b/src/model/ExternalInterfaceFunctionalMockupUnitImport.hpp index 3331bfc77c5..c705b442b5c 100644 --- a/src/model/ExternalInterfaceFunctionalMockupUnitImport.hpp +++ b/src/model/ExternalInterfaceFunctionalMockupUnitImport.hpp @@ -83,7 +83,7 @@ namespace model { void resetFMULoggingOn(); - bool setFMUFileName(std::string fMUName); + bool setFMUFileName(const std::string& fMUName); //@} /** @name Other */ diff --git a/src/model/ExternalInterfaceFunctionalMockupUnitImportFromVariable_Impl.hpp b/src/model/ExternalInterfaceFunctionalMockupUnitImportFromVariable_Impl.hpp index f5a524a7fe7..8499476eb63 100644 --- a/src/model/ExternalInterfaceFunctionalMockupUnitImportFromVariable_Impl.hpp +++ b/src/model/ExternalInterfaceFunctionalMockupUnitImportFromVariable_Impl.hpp @@ -61,9 +61,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/ExternalInterfaceFunctionalMockupUnitImportToActuator_Impl.hpp b/src/model/ExternalInterfaceFunctionalMockupUnitImportToActuator_Impl.hpp index 895f49db688..0996eb6a88a 100644 --- a/src/model/ExternalInterfaceFunctionalMockupUnitImportToActuator_Impl.hpp +++ b/src/model/ExternalInterfaceFunctionalMockupUnitImportToActuator_Impl.hpp @@ -62,9 +62,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/ExternalInterfaceFunctionalMockupUnitImportToVariable_Impl.hpp b/src/model/ExternalInterfaceFunctionalMockupUnitImportToVariable_Impl.hpp index e0dbf8088d8..12732553844 100644 --- a/src/model/ExternalInterfaceFunctionalMockupUnitImportToVariable_Impl.hpp +++ b/src/model/ExternalInterfaceFunctionalMockupUnitImportToVariable_Impl.hpp @@ -62,9 +62,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/ExternalInterfaceFunctionalMockupUnitImport_Impl.hpp b/src/model/ExternalInterfaceFunctionalMockupUnitImport_Impl.hpp index c46d4b1bc67..eae6b09165b 100644 --- a/src/model/ExternalInterfaceFunctionalMockupUnitImport_Impl.hpp +++ b/src/model/ExternalInterfaceFunctionalMockupUnitImport_Impl.hpp @@ -58,9 +58,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ @@ -88,7 +88,7 @@ namespace model { void resetFMULoggingOn(); - bool setFMUFileName(std::string fMUName); + bool setFMUFileName(const std::string& fMUName); //@} /** @name Other */ diff --git a/src/model/ExternalInterfaceVariable_Impl.hpp b/src/model/ExternalInterfaceVariable_Impl.hpp index 61efd5f54cb..474bcac76b4 100644 --- a/src/model/ExternalInterfaceVariable_Impl.hpp +++ b/src/model/ExternalInterfaceVariable_Impl.hpp @@ -57,9 +57,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/ExternalInterface_Impl.hpp b/src/model/ExternalInterface_Impl.hpp index 95dac24c444..b9be196be15 100644 --- a/src/model/ExternalInterface_Impl.hpp +++ b/src/model/ExternalInterface_Impl.hpp @@ -57,9 +57,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ diff --git a/src/model/FluidCoolerSingleSpeed.cpp b/src/model/FluidCoolerSingleSpeed.cpp index c2213aac1a9..af32c76ef96 100644 --- a/src/model/FluidCoolerSingleSpeed.cpp +++ b/src/model/FluidCoolerSingleSpeed.cpp @@ -164,7 +164,7 @@ namespace model { return getObject().getModelObjectTarget(OS_FluidCooler_SingleSpeedFields::OutdoorAirInletNode); } - bool FluidCoolerSingleSpeed_Impl::setPerformanceInputMethod(std::string performanceInputMethod) { + bool FluidCoolerSingleSpeed_Impl::setPerformanceInputMethod(const std::string& performanceInputMethod) { bool result = setString(OS_FluidCooler_SingleSpeedFields::PerformanceInputMethod, performanceInputMethod); return result; } @@ -393,7 +393,7 @@ namespace model { return getImpl()->outdoorAirInletNode(); } - bool FluidCoolerSingleSpeed::setPerformanceInputMethod(std::string performanceInputMethod) { + bool FluidCoolerSingleSpeed::setPerformanceInputMethod(const std::string& performanceInputMethod) { return getImpl()->setPerformanceInputMethod(performanceInputMethod); } diff --git a/src/model/FluidCoolerSingleSpeed.hpp b/src/model/FluidCoolerSingleSpeed.hpp index fcb1e1e557a..df75feb966f 100644 --- a/src/model/FluidCoolerSingleSpeed.hpp +++ b/src/model/FluidCoolerSingleSpeed.hpp @@ -97,7 +97,7 @@ namespace model { /** @name Setters */ //@{ - bool setPerformanceInputMethod(std::string performanceInputMethod); + bool setPerformanceInputMethod(const std::string& performanceInputMethod); bool setDesignAirFlowRateUfactorTimesAreaValue(double designAirFlowRateUfactorTimesAreaValue); diff --git a/src/model/FluidCoolerSingleSpeed_Impl.hpp b/src/model/FluidCoolerSingleSpeed_Impl.hpp index a9ef6216e23..849c9fc28c2 100644 --- a/src/model/FluidCoolerSingleSpeed_Impl.hpp +++ b/src/model/FluidCoolerSingleSpeed_Impl.hpp @@ -115,7 +115,7 @@ namespace model { /** @name Setters */ //@{ - bool setPerformanceInputMethod(std::string performanceInputMethod); + bool setPerformanceInputMethod(const std::string& performanceInputMethod); bool setDesignAirFlowRateUfactorTimesAreaValue(boost::optional designAirFlowRateUfactorTimesAreaValue); diff --git a/src/model/FluidCoolerTwoSpeed.cpp b/src/model/FluidCoolerTwoSpeed.cpp index f9cbaa69f79..1e0c0391035 100644 --- a/src/model/FluidCoolerTwoSpeed.cpp +++ b/src/model/FluidCoolerTwoSpeed.cpp @@ -239,7 +239,7 @@ namespace model { return getObject().getModelObjectTarget(OS_FluidCooler_TwoSpeedFields::OutdoorAirInletNode); } - bool FluidCoolerTwoSpeed_Impl::setPerformanceInputMethod(std::string performanceInputMethod) { + bool FluidCoolerTwoSpeed_Impl::setPerformanceInputMethod(const std::string& performanceInputMethod) { bool result = setString(OS_FluidCooler_TwoSpeedFields::PerformanceInputMethod, performanceInputMethod); return result; } @@ -640,7 +640,7 @@ namespace model { return getImpl()->outdoorAirInletNode(); } - bool FluidCoolerTwoSpeed::setPerformanceInputMethod(std::string performanceInputMethod) { + bool FluidCoolerTwoSpeed::setPerformanceInputMethod(const std::string& performanceInputMethod) { return getImpl()->setPerformanceInputMethod(performanceInputMethod); } diff --git a/src/model/FluidCoolerTwoSpeed.hpp b/src/model/FluidCoolerTwoSpeed.hpp index be73189a5bf..cf8d4c8171e 100644 --- a/src/model/FluidCoolerTwoSpeed.hpp +++ b/src/model/FluidCoolerTwoSpeed.hpp @@ -121,7 +121,7 @@ namespace model { /** @name Setters */ //@{ - bool setPerformanceInputMethod(std::string performanceInputMethod); + bool setPerformanceInputMethod(const std::string& performanceInputMethod); bool setHighFanSpeedUfactorTimesAreaValue(double highFanSpeedUfactorTimesAreaValue); diff --git a/src/model/FluidCoolerTwoSpeed_Impl.hpp b/src/model/FluidCoolerTwoSpeed_Impl.hpp index 78dea13aee9..91e548d594c 100644 --- a/src/model/FluidCoolerTwoSpeed_Impl.hpp +++ b/src/model/FluidCoolerTwoSpeed_Impl.hpp @@ -147,7 +147,7 @@ namespace model { /** @name Setters */ //@{ - bool setPerformanceInputMethod(std::string performanceInputMethod); + bool setPerformanceInputMethod(const std::string& performanceInputMethod); bool setHighFanSpeedUfactorTimesAreaValue(boost::optional highFanSpeedUfactorTimesAreaValue); diff --git a/src/model/GenericModelObject.cpp b/src/model/GenericModelObject.cpp index b186fa35098..2992a752e49 100644 --- a/src/model/GenericModelObject.cpp +++ b/src/model/GenericModelObject.cpp @@ -57,7 +57,7 @@ namespace model { } // namespace detail - GenericModelObject::GenericModelObject(std::shared_ptr p) : ModelObject(std::move(p)) {} + GenericModelObject::GenericModelObject(std::shared_ptr impl) : ModelObject(std::move(impl)) {} } // namespace model } // namespace openstudio diff --git a/src/model/GroundHeatExchangerHorizontalTrench.cpp b/src/model/GroundHeatExchangerHorizontalTrench.cpp index c887a294580..07e0b773a64 100644 --- a/src/model/GroundHeatExchangerHorizontalTrench.cpp +++ b/src/model/GroundHeatExchangerHorizontalTrench.cpp @@ -270,7 +270,7 @@ namespace model { return result; } - bool GroundHeatExchangerHorizontalTrench_Impl::setGroundTemperatureModel(std::string groundTemperatureModel) { + bool GroundHeatExchangerHorizontalTrench_Impl::setGroundTemperatureModel(const std::string& groundTemperatureModel) { bool result = setString(OS_GroundHeatExchanger_HorizontalTrenchFields::GroundTemperatureModel, groundTemperatureModel); return result; } @@ -509,7 +509,7 @@ namespace model { soilMoistureContentPercentatSaturation); } - bool GroundHeatExchangerHorizontalTrench::setGroundTemperatureModel(std::string groundTemperatureModel) { + bool GroundHeatExchangerHorizontalTrench::setGroundTemperatureModel(const std::string& groundTemperatureModel) { return getImpl()->setGroundTemperatureModel(groundTemperatureModel); } diff --git a/src/model/GroundHeatExchangerHorizontalTrench.hpp b/src/model/GroundHeatExchangerHorizontalTrench.hpp index 4a59aa930c2..5e44e0fcf40 100644 --- a/src/model/GroundHeatExchangerHorizontalTrench.hpp +++ b/src/model/GroundHeatExchangerHorizontalTrench.hpp @@ -139,7 +139,7 @@ namespace model { bool setSoilMoistureContentPercentatSaturation(double soilMoistureContentPercentatSaturation); - bool setGroundTemperatureModel(std::string groundTemperatureModel); + bool setGroundTemperatureModel(const std::string& groundTemperatureModel); void resetGroundTemperatureModel(); diff --git a/src/model/GroundHeatExchangerHorizontalTrench_Impl.hpp b/src/model/GroundHeatExchangerHorizontalTrench_Impl.hpp index ca4bd356360..60870267605 100644 --- a/src/model/GroundHeatExchangerHorizontalTrench_Impl.hpp +++ b/src/model/GroundHeatExchangerHorizontalTrench_Impl.hpp @@ -141,7 +141,7 @@ namespace model { bool setSoilMoistureContentPercentatSaturation(double soilMoistureContentPercentatSaturation); - bool setGroundTemperatureModel(std::string groundTemperatureModel); + bool setGroundTemperatureModel(const std::string& groundTemperatureModel); void resetGroundTemperatureModel(); diff --git a/src/model/HeaderedPumpsConstantSpeed.cpp b/src/model/HeaderedPumpsConstantSpeed.cpp index 06678ec4546..176a69f1ee3 100644 --- a/src/model/HeaderedPumpsConstantSpeed.cpp +++ b/src/model/HeaderedPumpsConstantSpeed.cpp @@ -268,7 +268,7 @@ namespace model { } bool HeaderedPumpsConstantSpeed_Impl::addToNode(Node& node) { - if (boost::optional plant = node.plantLoop()) { + if (node.plantLoop()) { return StraightComponent_Impl::addToNode(node); } diff --git a/src/model/HeaderedPumpsVariableSpeed.cpp b/src/model/HeaderedPumpsVariableSpeed.cpp index 642f596448a..fd30c235fa7 100644 --- a/src/model/HeaderedPumpsVariableSpeed.cpp +++ b/src/model/HeaderedPumpsVariableSpeed.cpp @@ -332,7 +332,7 @@ namespace model { } bool HeaderedPumpsVariableSpeed_Impl::addToNode(Node& node) { - if (boost::optional plant = node.plantLoop()) { + if (node.plantLoop()) { return StraightComponent_Impl::addToNode(node); } diff --git a/src/model/MasslessOpaqueMaterial.cpp b/src/model/MasslessOpaqueMaterial.cpp index c83ea76847a..7cc60ceba96 100644 --- a/src/model/MasslessOpaqueMaterial.cpp +++ b/src/model/MasslessOpaqueMaterial.cpp @@ -213,7 +213,7 @@ namespace model { return isEmpty(OS_Material_NoMassFields::VisibleAbsorptance); } - bool MasslessOpaqueMaterial_Impl::setRoughness(std::string roughness) { + bool MasslessOpaqueMaterial_Impl::setRoughness(const std::string& roughness) { bool result = setString(OS_Material_NoMassFields::Roughness, roughness); return result; } @@ -259,7 +259,7 @@ namespace model { } // namespace detail - MasslessOpaqueMaterial::MasslessOpaqueMaterial(const Model& model, std::string roughness, double thermalResistance) + MasslessOpaqueMaterial::MasslessOpaqueMaterial(const Model& model, const std::string& roughness, double thermalResistance) : OpaqueMaterial(MasslessOpaqueMaterial::iddObjectType(), model) { OS_ASSERT(getImpl()); @@ -316,7 +316,7 @@ namespace model { return getImpl()->isVisibleAbsorptanceDefaulted(); } - bool MasslessOpaqueMaterial::setRoughness(std::string roughness) { + bool MasslessOpaqueMaterial::setRoughness(const std::string& roughness) { return getImpl()->setRoughness(roughness); } diff --git a/src/model/MasslessOpaqueMaterial.hpp b/src/model/MasslessOpaqueMaterial.hpp index 22ed35c2712..cda0c6c8389 100644 --- a/src/model/MasslessOpaqueMaterial.hpp +++ b/src/model/MasslessOpaqueMaterial.hpp @@ -50,7 +50,7 @@ namespace model { /** @name Constructors and Destructors */ //@{ - explicit MasslessOpaqueMaterial(const Model& model, std::string roughness = "Smooth", double thermalResistance = 0.1); + explicit MasslessOpaqueMaterial(const Model& model, const std::string& roughness = "Smooth", double thermalResistance = 0.1); virtual ~MasslessOpaqueMaterial() {} @@ -83,7 +83,7 @@ namespace model { /** @name Setters */ //@{ - bool setRoughness(std::string roughness); + bool setRoughness(const std::string& roughness); bool setThermalResistance(double thermalResistance); diff --git a/src/model/MasslessOpaqueMaterial_Impl.hpp b/src/model/MasslessOpaqueMaterial_Impl.hpp index bebc26d58ca..62229d2dc98 100644 --- a/src/model/MasslessOpaqueMaterial_Impl.hpp +++ b/src/model/MasslessOpaqueMaterial_Impl.hpp @@ -103,7 +103,7 @@ namespace model { /** @name Setters */ //@{ - bool setRoughness(std::string roughness); + bool setRoughness(const std::string& roughness); /** Set thickness to value (m). */ virtual bool setThickness(double value) override; @@ -118,7 +118,7 @@ namespace model { virtual bool setThermalResistivity(double value) override; /** Sets the resistance of the material in m^2*K/W, if possible. */ - virtual bool setThermalResistance(double value) override; + virtual bool setThermalResistance(double thermalResistance) override; virtual bool setThermalAbsorptance(boost::optional value); diff --git a/src/model/MaterialPropertyMoisturePenetrationDepthSettings_Impl.hpp b/src/model/MaterialPropertyMoisturePenetrationDepthSettings_Impl.hpp index 2324197108b..e62d29167f9 100644 --- a/src/model/MaterialPropertyMoisturePenetrationDepthSettings_Impl.hpp +++ b/src/model/MaterialPropertyMoisturePenetrationDepthSettings_Impl.hpp @@ -61,9 +61,9 @@ namespace model { /** @name Virtual Methods */ //@{ - virtual const std::vector& outputVariableNames() const; + virtual const std::vector& outputVariableNames() const override; - virtual IddObjectType iddObjectType() const; + virtual IddObjectType iddObjectType() const override; //@} /** @name Getters */ @@ -139,4 +139,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_MATERIALPROPERTYMOISTUREPENETRATIONDEPTHSETTINGS_IMPL_HPP \ No newline at end of file +#endif // MODEL_MATERIALPROPERTYMOISTUREPENETRATIONDEPTHSETTINGS_IMPL_HPP diff --git a/src/model/ModelExtensibleGroup.cpp b/src/model/ModelExtensibleGroup.cpp index 93f28ce1a87..6ef20bcca38 100644 --- a/src/model/ModelExtensibleGroup.cpp +++ b/src/model/ModelExtensibleGroup.cpp @@ -44,7 +44,7 @@ namespace model { if (!result) { if (boost::optional scheduleTypeLimits = schedule.scheduleTypeLimits()) { LOG(Warn, "For object of type " << className << " cannot set Schedule " << scheduleDisplayName << "=" << schedule.nameString() - << " because it has an incompatible ScheduleTypeLimits"); + << " because it has an incompatible ScheduleTypeLimits (" << scheduleTypeLimits->nameString() << ")"); } return result; } diff --git a/src/model/PeopleDefinition.cpp b/src/model/PeopleDefinition.cpp index 313a289415c..13944bb5295 100644 --- a/src/model/PeopleDefinition.cpp +++ b/src/model/PeopleDefinition.cpp @@ -270,7 +270,7 @@ namespace model { OS_ASSERT(result); } - bool PeopleDefinition_Impl::setMeanRadiantTemperatureCalculationType(std::string meanRadiantTemperatureCalculationType) { + bool PeopleDefinition_Impl::setMeanRadiantTemperatureCalculationType(const std::string& meanRadiantTemperatureCalculationType) { bool result = setString(OS_People_DefinitionFields::MeanRadiantTemperatureCalculationType, meanRadiantTemperatureCalculationType); return result; } @@ -539,7 +539,7 @@ namespace model { getImpl()->resetEnableASHRAE55ComfortWarnings(); } - bool PeopleDefinition::setMeanRadiantTemperatureCalculationType(std::string meanRadiantTemperatureCalculationType) { + bool PeopleDefinition::setMeanRadiantTemperatureCalculationType(const std::string& meanRadiantTemperatureCalculationType) { return getImpl()->setMeanRadiantTemperatureCalculationType(meanRadiantTemperatureCalculationType); } diff --git a/src/model/PeopleDefinition.hpp b/src/model/PeopleDefinition.hpp index 5760d342ae4..3bccc6515c7 100644 --- a/src/model/PeopleDefinition.hpp +++ b/src/model/PeopleDefinition.hpp @@ -133,7 +133,7 @@ namespace model { void resetEnableASHRAE55ComfortWarnings(); - bool setMeanRadiantTemperatureCalculationType(std::string meanRadiantTemperatureCalculationType); + bool setMeanRadiantTemperatureCalculationType(const std::string& meanRadiantTemperatureCalculationType); void resetMeanRadiantTemperatureCalculationType(); diff --git a/src/model/PeopleDefinition_Impl.hpp b/src/model/PeopleDefinition_Impl.hpp index 0530440952d..327f2588767 100644 --- a/src/model/PeopleDefinition_Impl.hpp +++ b/src/model/PeopleDefinition_Impl.hpp @@ -129,7 +129,7 @@ namespace model { void resetEnableASHRAE55ComfortWarnings(); - bool setMeanRadiantTemperatureCalculationType(std::string meanRadiantTemperatureCalculationType); + bool setMeanRadiantTemperatureCalculationType(const std::string& meanRadiantTemperatureCalculationType); void resetMeanRadiantTemperatureCalculationType(); diff --git a/src/model/PhotovoltaicPerformanceEquivalentOneDiode.cpp b/src/model/PhotovoltaicPerformanceEquivalentOneDiode.cpp index 79638b5166e..23ecade000b 100644 --- a/src/model/PhotovoltaicPerformanceEquivalentOneDiode.cpp +++ b/src/model/PhotovoltaicPerformanceEquivalentOneDiode.cpp @@ -264,7 +264,7 @@ namespace model { return isEmpty(OS_PhotovoltaicPerformance_EquivalentOneDiodeFields::TotalHeatCapacity); } - bool PhotovoltaicPerformanceEquivalentOneDiode_Impl::setCelltype(std::string celltype) { + bool PhotovoltaicPerformanceEquivalentOneDiode_Impl::setCelltype(const std::string& celltype) { bool result = setString(OS_PhotovoltaicPerformance_EquivalentOneDiodeFields::Celltype, celltype); return result; } @@ -638,7 +638,7 @@ namespace model { return getImpl()->isTotalHeatCapacityDefaulted(); } - bool PhotovoltaicPerformanceEquivalentOneDiode::setCelltype(std::string celltype) { + bool PhotovoltaicPerformanceEquivalentOneDiode::setCelltype(const std::string& celltype) { return getImpl()->setCelltype(celltype); } diff --git a/src/model/PhotovoltaicPerformanceEquivalentOneDiode.hpp b/src/model/PhotovoltaicPerformanceEquivalentOneDiode.hpp index 9f4a2c7f55e..a57439e224a 100644 --- a/src/model/PhotovoltaicPerformanceEquivalentOneDiode.hpp +++ b/src/model/PhotovoltaicPerformanceEquivalentOneDiode.hpp @@ -143,7 +143,7 @@ namespace model { /** @name Setters */ //@{ - bool setCelltype(std::string celltype); + bool setCelltype(const std::string& celltype); void resetCelltype(); diff --git a/src/model/PhotovoltaicPerformanceEquivalentOneDiode_Impl.hpp b/src/model/PhotovoltaicPerformanceEquivalentOneDiode_Impl.hpp index af4b46999ee..cd03cf3e09d 100644 --- a/src/model/PhotovoltaicPerformanceEquivalentOneDiode_Impl.hpp +++ b/src/model/PhotovoltaicPerformanceEquivalentOneDiode_Impl.hpp @@ -145,7 +145,7 @@ namespace model { /** @name Setters */ //@{ - bool setCelltype(std::string celltype); + bool setCelltype(const std::string& celltype); void resetCelltype(); diff --git a/src/model/PipeIndoor.cpp b/src/model/PipeIndoor.cpp index 9dffc8f0bce..21e1329d312 100644 --- a/src/model/PipeIndoor.cpp +++ b/src/model/PipeIndoor.cpp @@ -148,7 +148,7 @@ namespace model { OS_ASSERT(result); } - bool PipeIndoor_Impl::setEnvironmentType(std::string environmentType) { + bool PipeIndoor_Impl::setEnvironmentType(const std::string& environmentType) { bool result = setString(OS_Pipe_IndoorFields::EnvironmentType, environmentType); return result; } @@ -267,7 +267,7 @@ namespace model { getImpl()->resetConstruction(); } - bool PipeIndoor::setEnvironmentType(std::string environmentType) { + bool PipeIndoor::setEnvironmentType(const std::string& environmentType) { return getImpl()->setEnvironmentType(environmentType); } diff --git a/src/model/PipeIndoor.hpp b/src/model/PipeIndoor.hpp index 55e10b41759..4313277c00d 100644 --- a/src/model/PipeIndoor.hpp +++ b/src/model/PipeIndoor.hpp @@ -89,7 +89,7 @@ namespace model { void resetConstruction(); - bool setEnvironmentType(std::string environmentType); + bool setEnvironmentType(const std::string& environmentType); bool setAmbientTemperatureZone(const ThermalZone& thermalZone); diff --git a/src/model/PipeIndoor_Impl.hpp b/src/model/PipeIndoor_Impl.hpp index 981f3802ff7..9ab88b5fa17 100644 --- a/src/model/PipeIndoor_Impl.hpp +++ b/src/model/PipeIndoor_Impl.hpp @@ -97,7 +97,7 @@ namespace model { void resetConstruction(); - bool setEnvironmentType(std::string environmentType); + bool setEnvironmentType(const std::string& environmentType); bool setAmbientTemperatureZone(const boost::optional& thermalZone); diff --git a/src/model/PlantComponentTemperatureSource.cpp b/src/model/PlantComponentTemperatureSource.cpp index 67bc8cfadc8..ca7d74d1164 100644 --- a/src/model/PlantComponentTemperatureSource.cpp +++ b/src/model/PlantComponentTemperatureSource.cpp @@ -134,7 +134,7 @@ namespace model { OS_ASSERT(result); } - bool PlantComponentTemperatureSource_Impl::setTemperatureSpecificationType(std::string temperatureSpecificationType) { + bool PlantComponentTemperatureSource_Impl::setTemperatureSpecificationType(const std::string& temperatureSpecificationType) { bool result = setString(OS_PlantComponent_TemperatureSourceFields::TemperatureSpecificationType, temperatureSpecificationType); return result; } @@ -243,7 +243,7 @@ namespace model { getImpl()->autosizeDesignVolumeFlowRate(); } - bool PlantComponentTemperatureSource::setTemperatureSpecificationType(std::string temperatureSpecificationType) { + bool PlantComponentTemperatureSource::setTemperatureSpecificationType(const std::string& temperatureSpecificationType) { return getImpl()->setTemperatureSpecificationType(temperatureSpecificationType); } diff --git a/src/model/PlantComponentTemperatureSource.hpp b/src/model/PlantComponentTemperatureSource.hpp index 14b678f1438..8310afd3551 100644 --- a/src/model/PlantComponentTemperatureSource.hpp +++ b/src/model/PlantComponentTemperatureSource.hpp @@ -83,7 +83,7 @@ namespace model { void autosizeDesignVolumeFlowRate(); - bool setTemperatureSpecificationType(std::string temperatureSpecificationType); + bool setTemperatureSpecificationType(const std::string& temperatureSpecificationType); bool setSourceTemperature(double sourceTemperature); diff --git a/src/model/PlantComponentTemperatureSource_Impl.hpp b/src/model/PlantComponentTemperatureSource_Impl.hpp index c7d1aea86df..6d93bcf1e96 100644 --- a/src/model/PlantComponentTemperatureSource_Impl.hpp +++ b/src/model/PlantComponentTemperatureSource_Impl.hpp @@ -103,7 +103,7 @@ namespace model { void autosizeDesignVolumeFlowRate(); - bool setTemperatureSpecificationType(std::string temperatureSpecificationType); + bool setTemperatureSpecificationType(const std::string& temperatureSpecificationType); bool setSourceTemperature(boost::optional sourceTemperature); diff --git a/src/model/PumpConstantSpeed.cpp b/src/model/PumpConstantSpeed.cpp index 93475d5d1c1..212e71234d9 100644 --- a/src/model/PumpConstantSpeed.cpp +++ b/src/model/PumpConstantSpeed.cpp @@ -260,7 +260,7 @@ namespace model { OS_ASSERT(result); } - bool PumpConstantSpeed_Impl::setPumpControlType(std::string pumpControlType) { + bool PumpConstantSpeed_Impl::setPumpControlType(const std::string& pumpControlType) { bool result = setString(OS_Pump_ConstantSpeedFields::PumpControlType, pumpControlType); return result; } @@ -449,7 +449,7 @@ namespace model { } bool PumpConstantSpeed_Impl::addToNode(Node& node) { - if (boost::optional plant = node.plantLoop()) { + if (node.plantLoop()) { return StraightComponent_Impl::addToNode(node); } @@ -689,7 +689,7 @@ namespace model { getImpl()->resetFractionofMotorInefficienciestoFluidStream(); } - bool PumpConstantSpeed::setPumpControlType(std::string pumpControlType) { + bool PumpConstantSpeed::setPumpControlType(const std::string& pumpControlType) { return getImpl()->setPumpControlType(pumpControlType); } @@ -790,4 +790,4 @@ namespace model { } } // namespace model -} // namespace openstudio \ No newline at end of file +} // namespace openstudio diff --git a/src/model/PumpConstantSpeed.hpp b/src/model/PumpConstantSpeed.hpp index 1755f80c181..fa8ef827293 100644 --- a/src/model/PumpConstantSpeed.hpp +++ b/src/model/PumpConstantSpeed.hpp @@ -112,7 +112,7 @@ namespace model { bool isPumpControlTypeDefaulted() const; - bool setPumpControlType(std::string pumpControlType); + bool setPumpControlType(const std::string& pumpControlType); void resetPumpControlType(); diff --git a/src/model/PumpConstantSpeed_Impl.hpp b/src/model/PumpConstantSpeed_Impl.hpp index d772ae918cc..fb312a99bce 100644 --- a/src/model/PumpConstantSpeed_Impl.hpp +++ b/src/model/PumpConstantSpeed_Impl.hpp @@ -123,7 +123,7 @@ namespace model { void resetFractionofMotorInefficienciestoFluidStream(); - bool setPumpControlType(std::string pumpControlType); + bool setPumpControlType(const std::string& pumpControlType); void resetPumpControlType(); @@ -205,4 +205,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_PUMPCONSTANTSPEED_IMPL_HPP \ No newline at end of file +#endif // MODEL_PUMPCONSTANTSPEED_IMPL_HPP diff --git a/src/model/PumpVariableSpeed.cpp b/src/model/PumpVariableSpeed.cpp index 52e90b7661e..b8f93b676ad 100644 --- a/src/model/PumpVariableSpeed.cpp +++ b/src/model/PumpVariableSpeed.cpp @@ -421,7 +421,7 @@ namespace model { OS_ASSERT(result); } - bool PumpVariableSpeed_Impl::setPumpControlType(std::string pumpControlType) { + bool PumpVariableSpeed_Impl::setPumpControlType(const std::string& pumpControlType) { bool result = setString(OS_Pump_VariableSpeedFields::PumpControlType, pumpControlType); return result; } @@ -544,7 +544,7 @@ namespace model { } bool PumpVariableSpeed_Impl::addToNode(Node& node) { - if (boost::optional plant = node.plantLoop()) { + if (node.plantLoop()) { return StraightComponent_Impl::addToNode(node); } @@ -1092,7 +1092,7 @@ namespace model { getImpl()->resetMinimumFlowRate(); } - bool PumpVariableSpeed::setPumpControlType(std::string pumpControlType) { + bool PumpVariableSpeed::setPumpControlType(const std::string& pumpControlType) { return getImpl()->setPumpControlType(pumpControlType); } @@ -1124,7 +1124,7 @@ namespace model { getImpl()->resetImpellerDiameter(); } - bool PumpVariableSpeed::setVFDControlType(std::string vFDControlType) { + bool PumpVariableSpeed::setVFDControlType(const std::string& vFDControlType) { return getImpl()->setVFDControlType(vFDControlType); } @@ -1245,4 +1245,4 @@ namespace model { } } // namespace model -} // namespace openstudio \ No newline at end of file +} // namespace openstudio diff --git a/src/model/PumpVariableSpeed.hpp b/src/model/PumpVariableSpeed.hpp index 5ee69ab937e..46b94eb8513 100644 --- a/src/model/PumpVariableSpeed.hpp +++ b/src/model/PumpVariableSpeed.hpp @@ -194,7 +194,7 @@ namespace model { void resetMinimumFlowRate(); - bool setPumpControlType(std::string pumpControlType); + bool setPumpControlType(const std::string& pumpControlType); void resetPumpControlType(); @@ -211,7 +211,7 @@ namespace model { void resetImpellerDiameter(); - bool setVFDControlType(std::string vFDControlType); + bool setVFDControlType(const std::string& vFDControlType); void resetVFDControlType(); @@ -293,4 +293,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_PUMPVARIABLESPEED_HPP \ No newline at end of file +#endif // MODEL_PUMPVARIABLESPEED_HPP diff --git a/src/model/PumpVariableSpeed_Impl.hpp b/src/model/PumpVariableSpeed_Impl.hpp index 97f5e64d686..756c1b84cb0 100644 --- a/src/model/PumpVariableSpeed_Impl.hpp +++ b/src/model/PumpVariableSpeed_Impl.hpp @@ -207,7 +207,7 @@ namespace model { void resetMinimumFlowRate(); - bool setPumpControlType(std::string pumpControlType); + bool setPumpControlType(const std::string& pumpControlType); void resetPumpControlType(); @@ -304,4 +304,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_PUMPVARIABLESPEED_IMPL_HPP \ No newline at end of file +#endif // MODEL_PUMPVARIABLESPEED_IMPL_HPP diff --git a/src/model/RadianceParameters.cpp b/src/model/RadianceParameters.cpp index 8f24d57134a..4fa4ff0f37d 100644 --- a/src/model/RadianceParameters.cpp +++ b/src/model/RadianceParameters.cpp @@ -205,7 +205,7 @@ namespace model { return value.get(); } - bool RadianceParameters_Impl::setSkyDiscretizationResolution(std::string skyDiscretizationResolution) { + bool RadianceParameters_Impl::setSkyDiscretizationResolution(const std::string& skyDiscretizationResolution) { bool result = setString(OS_RadianceParametersFields::SkyDiscretizationResolution, skyDiscretizationResolution); return result; } @@ -319,8 +319,8 @@ namespace model { OS_ASSERT(result); } - bool RadianceParameters_Impl::setLimitWeightVMX(double LimitWeightVMX) { - bool result = setDouble(OS_RadianceParametersFields::LimitWeightVMX, LimitWeightVMX); + bool RadianceParameters_Impl::setLimitWeightVMX(double limitWeightVMX) { + bool result = setDouble(OS_RadianceParametersFields::LimitWeightVMX, limitWeightVMX); return result; } @@ -329,8 +329,8 @@ namespace model { OS_ASSERT(result); } - bool RadianceParameters_Impl::setLimitWeightDMX(double LimitWeightDMX) { - bool result = setDouble(OS_RadianceParametersFields::LimitWeightDMX, LimitWeightDMX); + bool RadianceParameters_Impl::setLimitWeightDMX(double limitWeightDMX) { + bool result = setDouble(OS_RadianceParametersFields::LimitWeightDMX, limitWeightDMX); OS_ASSERT(result); return result; } @@ -529,7 +529,7 @@ namespace model { return impl->skyDiscretizationResolution(); } - bool RadianceParameters::setSkyDiscretizationResolution(std::string skyDiscretizationResolution) { + bool RadianceParameters::setSkyDiscretizationResolution(const std::string& skyDiscretizationResolution) { auto impl = getImpl(); return impl->setSkyDiscretizationResolution(skyDiscretizationResolution); } @@ -618,16 +618,16 @@ namespace model { getImpl()->resetAmbientSupersamples(); } - bool RadianceParameters::setLimitWeightVMX(double LimitWeightVMX) { - return getImpl()->setLimitWeightVMX(LimitWeightVMX); + bool RadianceParameters::setLimitWeightVMX(double limitWeightVMX) { + return getImpl()->setLimitWeightVMX(limitWeightVMX); } void RadianceParameters::resetLimitWeightVMX() { getImpl()->resetLimitWeightVMX(); } - bool RadianceParameters::setLimitWeightDMX(double LimitWeightDMX) { - return getImpl()->setLimitWeightDMX(LimitWeightDMX); + bool RadianceParameters::setLimitWeightDMX(double limitWeightDMX) { + return getImpl()->setLimitWeightDMX(limitWeightDMX); } void RadianceParameters::resetLimitWeightDMX() { @@ -670,4 +670,4 @@ namespace model { /// @endcond } // namespace model -} // namespace openstudio \ No newline at end of file +} // namespace openstudio diff --git a/src/model/RadianceParameters.hpp b/src/model/RadianceParameters.hpp index 343d3329677..df4fe02133f 100644 --- a/src/model/RadianceParameters.hpp +++ b/src/model/RadianceParameters.hpp @@ -176,7 +176,7 @@ namespace model { void resetKlemsSamplingDensity(); - bool setSkyDiscretizationResolution(std::string skyDiscretizationResolution); + bool setSkyDiscretizationResolution(const std::string& skyDiscretizationResolution); void resetSkyDiscretizationResolution(); diff --git a/src/model/RadianceParameters_Impl.hpp b/src/model/RadianceParameters_Impl.hpp index 4a4c2010abf..dce6c75e0ba 100644 --- a/src/model/RadianceParameters_Impl.hpp +++ b/src/model/RadianceParameters_Impl.hpp @@ -181,7 +181,7 @@ namespace model { void resetKlemsSamplingDensity(); - bool setSkyDiscretizationResolution(std::string skyDiscretizationResolution); + bool setSkyDiscretizationResolution(const std::string& skyDiscretizationResolution); void resetSkyDiscretizationResolution(); @@ -206,4 +206,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_RADIANCEPARAMETERS_IMPL_HPP \ No newline at end of file +#endif // MODEL_RADIANCEPARAMETERS_IMPL_HPP diff --git a/src/model/RefrigerationCondenserWaterCooled.cpp b/src/model/RefrigerationCondenserWaterCooled.cpp index e2795859be0..77552c76e33 100644 --- a/src/model/RefrigerationCondenserWaterCooled.cpp +++ b/src/model/RefrigerationCondenserWaterCooled.cpp @@ -251,7 +251,7 @@ namespace model { return result; } - bool RefrigerationCondenserWaterCooled_Impl::setWaterCooledLoopFlowType(std::string waterCooledLoopFlowType) { + bool RefrigerationCondenserWaterCooled_Impl::setWaterCooledLoopFlowType(const std::string& waterCooledLoopFlowType) { bool result = setString(OS_Refrigeration_Condenser_WaterCooledFields::WaterCooledLoopFlowType, waterCooledLoopFlowType); return result; } @@ -324,7 +324,7 @@ namespace model { OS_ASSERT(result); } - bool RefrigerationCondenserWaterCooled_Impl::setEndUseSubcategory(std::string endUseSubcategory) { + bool RefrigerationCondenserWaterCooled_Impl::setEndUseSubcategory(const std::string& endUseSubcategory) { bool result = setString(OS_Refrigeration_Condenser_WaterCooledFields::EndUseSubcategory, endUseSubcategory); OS_ASSERT(result); return result; @@ -551,7 +551,7 @@ namespace model { return getImpl()->setRatedWaterInletTemperature(ratedWaterInletTemperature); } - bool RefrigerationCondenserWaterCooled::setWaterCooledLoopFlowType(std::string waterCooledLoopFlowType) { + bool RefrigerationCondenserWaterCooled::setWaterCooledLoopFlowType(const std::string& waterCooledLoopFlowType) { return getImpl()->setWaterCooledLoopFlowType(waterCooledLoopFlowType); } @@ -599,7 +599,7 @@ namespace model { getImpl()->resetWaterMinimumWaterInletTemperature(); } - bool RefrigerationCondenserWaterCooled::setEndUseSubcategory(std::string endUseSubcategory) { + bool RefrigerationCondenserWaterCooled::setEndUseSubcategory(const std::string& endUseSubcategory) { return getImpl()->setEndUseSubcategory(endUseSubcategory); } diff --git a/src/model/RefrigerationCondenserWaterCooled.hpp b/src/model/RefrigerationCondenserWaterCooled.hpp index 8df7a5208b5..fd163a14134 100644 --- a/src/model/RefrigerationCondenserWaterCooled.hpp +++ b/src/model/RefrigerationCondenserWaterCooled.hpp @@ -120,7 +120,7 @@ namespace model { bool setRatedWaterInletTemperature(double ratedWaterInletTemperature); - bool setWaterCooledLoopFlowType(std::string waterCooledLoopFlowType); + bool setWaterCooledLoopFlowType(const std::string& waterCooledLoopFlowType); void resetWaterCooledLoopFlowType(); @@ -144,7 +144,7 @@ namespace model { void resetWaterMinimumWaterInletTemperature(); - bool setEndUseSubcategory(std::string endUseSubcategory); + bool setEndUseSubcategory(const std::string& endUseSubcategory); void resetEndUseSubcategory(); diff --git a/src/model/RefrigerationCondenserWaterCooled_Impl.hpp b/src/model/RefrigerationCondenserWaterCooled_Impl.hpp index 006d22c46da..a80c7bd1ab1 100644 --- a/src/model/RefrigerationCondenserWaterCooled_Impl.hpp +++ b/src/model/RefrigerationCondenserWaterCooled_Impl.hpp @@ -130,7 +130,7 @@ namespace model { bool setRatedWaterInletTemperature(double ratedWaterInletTemperature); - bool setWaterCooledLoopFlowType(std::string waterCooledLoopFlowType); + bool setWaterCooledLoopFlowType(const std::string& waterCooledLoopFlowType); void resetWaterCooledLoopFlowType(); @@ -154,7 +154,7 @@ namespace model { void resetWaterMinimumWaterInletTemperature(); - bool setEndUseSubcategory(std::string endUseSubcategory); + bool setEndUseSubcategory(const std::string& endUseSubcategory); void resetEndUseSubcategory(); diff --git a/src/model/RoofVegetation.cpp b/src/model/RoofVegetation.cpp index 98cebf0567c..da3c59906e1 100644 --- a/src/model/RoofVegetation.cpp +++ b/src/model/RoofVegetation.cpp @@ -655,7 +655,7 @@ namespace model { } // namespace detail - RoofVegetation::RoofVegetation(const Model& model, std::string roughness) : OpaqueMaterial(RoofVegetation::iddObjectType(), model) { + RoofVegetation::RoofVegetation(const Model& model, const std::string& roughness) : OpaqueMaterial(RoofVegetation::iddObjectType(), model) { OS_ASSERT(getImpl()); // TODO: Appropriately handle the following required object-list fields. diff --git a/src/model/RoofVegetation.hpp b/src/model/RoofVegetation.hpp index f3e546ca278..ab7d1a644a6 100644 --- a/src/model/RoofVegetation.hpp +++ b/src/model/RoofVegetation.hpp @@ -50,7 +50,7 @@ namespace model { /** @name Constructors and Destructors */ //@{ - explicit RoofVegetation(const Model& model, std::string roughness = "Smooth"); + explicit RoofVegetation(const Model& model, const std::string& roughness = "Smooth"); virtual ~RoofVegetation() {} @@ -154,11 +154,11 @@ namespace model { /** @name Setters */ //@{ - bool setLeafAreaIndex(double value); + bool setLeafAreaIndex(double leafAreaIndex); - bool setLeafReflectivity(double value); + bool setLeafReflectivity(double leafReflectivity); - bool setLeafEmissivity(double value); + bool setLeafEmissivity(double leafEmissivity); bool setMinimumStomatalResistance(double value); diff --git a/src/model/ScheduleTypeLimits.cpp b/src/model/ScheduleTypeLimits.cpp index e9144d850e7..85e9aa4d712 100644 --- a/src/model/ScheduleTypeLimits.cpp +++ b/src/model/ScheduleTypeLimits.cpp @@ -123,7 +123,7 @@ namespace model { OS_ASSERT(result); } - bool ScheduleTypeLimits_Impl::setNumericType(std::string numericType) { + bool ScheduleTypeLimits_Impl::setNumericType(const std::string& numericType) { bool result = false; result = setString(OS_ScheduleTypeLimitsFields::NumericType, numericType); return result; @@ -134,7 +134,7 @@ namespace model { OS_ASSERT(result); } - bool ScheduleTypeLimits_Impl::setUnitType(std::string unitType) { + bool ScheduleTypeLimits_Impl::setUnitType(const std::string& unitType) { bool result = setString(OS_ScheduleTypeLimitsFields::UnitType, unitType); return result; } @@ -342,7 +342,7 @@ namespace model { getImpl()->resetUpperLimitValue(); } - bool ScheduleTypeLimits::setNumericType(std::string numericType) { + bool ScheduleTypeLimits::setNumericType(const std::string& numericType) { return getImpl()->setNumericType(numericType); } @@ -350,7 +350,7 @@ namespace model { getImpl()->resetNumericType(); } - bool ScheduleTypeLimits::setUnitType(std::string unitType) { + bool ScheduleTypeLimits::setUnitType(const std::string& unitType) { return getImpl()->setUnitType(unitType); } diff --git a/src/model/ScheduleTypeLimits.hpp b/src/model/ScheduleTypeLimits.hpp index c8227f3dbb4..f62fb4cb5fa 100644 --- a/src/model/ScheduleTypeLimits.hpp +++ b/src/model/ScheduleTypeLimits.hpp @@ -97,11 +97,11 @@ namespace model { void resetUpperLimitValue(); - bool setNumericType(std::string numericType); + bool setNumericType(const std::string& numericType); void resetNumericType(); - bool setUnitType(std::string unitType); + bool setUnitType(const std::string& unitType); void resetUnitType(); @@ -135,4 +135,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_SCHEDULETYPELIMITS_HPP \ No newline at end of file +#endif // MODEL_SCHEDULETYPELIMITS_HPP diff --git a/src/model/ScheduleTypeLimits_Impl.hpp b/src/model/ScheduleTypeLimits_Impl.hpp index c8237ab7ddd..9e527cd6ed7 100644 --- a/src/model/ScheduleTypeLimits_Impl.hpp +++ b/src/model/ScheduleTypeLimits_Impl.hpp @@ -91,11 +91,11 @@ namespace model { void resetUpperLimitValue(); - bool setNumericType(std::string numericType); + bool setNumericType(const std::string& numericType); void resetNumericType(); - bool setUnitType(std::string unitType); + bool setUnitType(const std::string& unitType); void resetUnitType(); diff --git a/src/model/Screen.cpp b/src/model/Screen.cpp index 0b4fa6f7126..7153450d227 100644 --- a/src/model/Screen.cpp +++ b/src/model/Screen.cpp @@ -223,7 +223,7 @@ namespace model { return isEmpty(OS_WindowMaterial_ScreenFields::AngleofResolutionforScreenTransmittanceOutputMap); } - bool Screen_Impl::setReflectedBeamTransmittanceAccountingMethod(std::string reflectedBeamTransmittanceAccountingMethod) { + bool Screen_Impl::setReflectedBeamTransmittanceAccountingMethod(const std::string& reflectedBeamTransmittanceAccountingMethod) { bool result = setString(OS_WindowMaterial_ScreenFields::ReflectedBeamTransmittanceAccountingMethod, reflectedBeamTransmittanceAccountingMethod); return result; } @@ -323,7 +323,7 @@ namespace model { OS_ASSERT(result); } - bool Screen_Impl::setAngleofResolutionforScreenTransmittanceOutputMap(std::string angleofResolutionforScreenTransmittanceOutputMap) { + bool Screen_Impl::setAngleofResolutionforScreenTransmittanceOutputMap(const std::string& angleofResolutionforScreenTransmittanceOutputMap) { bool result = setString(OS_WindowMaterial_ScreenFields::AngleofResolutionforScreenTransmittanceOutputMap, angleofResolutionforScreenTransmittanceOutputMap); return result; @@ -489,7 +489,7 @@ namespace model { return getImpl()->isAngleofResolutionforScreenTransmittanceOutputMapDefaulted(); } - bool Screen::setReflectedBeamTransmittanceAccountingMethod(std::string reflectedBeamTransmittanceAccountingMethod) { + bool Screen::setReflectedBeamTransmittanceAccountingMethod(const std::string& reflectedBeamTransmittanceAccountingMethod) { return getImpl()->setReflectedBeamTransmittanceAccountingMethod(reflectedBeamTransmittanceAccountingMethod); } @@ -569,7 +569,7 @@ namespace model { getImpl()->resetRightSideOpeningMultiplier(); } - bool Screen::setAngleofResolutionforScreenTransmittanceOutputMap(std::string angleofResolutionforScreenTransmittanceOutputMap) { + bool Screen::setAngleofResolutionforScreenTransmittanceOutputMap(const std::string& angleofResolutionforScreenTransmittanceOutputMap) { return getImpl()->setAngleofResolutionforScreenTransmittanceOutputMap(angleofResolutionforScreenTransmittanceOutputMap); } diff --git a/src/model/Screen.hpp b/src/model/Screen.hpp index 37083eb6a6e..95510641ba7 100644 --- a/src/model/Screen.hpp +++ b/src/model/Screen.hpp @@ -132,7 +132,7 @@ namespace model { /** Sets the resistivity of the material in m*K/W, if possible. */ bool setThermalResistivity(double value); - bool setReflectedBeamTransmittanceAccountingMethod(std::string reflectedBeamTransmittanceAccountingMethod); + bool setReflectedBeamTransmittanceAccountingMethod(const std::string& reflectedBeamTransmittanceAccountingMethod); void resetReflectedBeamTransmittanceAccountingMethod(); @@ -172,7 +172,7 @@ namespace model { void resetRightSideOpeningMultiplier(); - bool setAngleofResolutionforScreenTransmittanceOutputMap(std::string angleofResolutionforScreenTransmittanceOutputMap); + bool setAngleofResolutionforScreenTransmittanceOutputMap(const std::string& angleofResolutionforScreenTransmittanceOutputMap); void resetAngleofResolutionforScreenTransmittanceOutputMap(); diff --git a/src/model/Screen_Impl.hpp b/src/model/Screen_Impl.hpp index c18406d755a..49f1f6e9e4a 100644 --- a/src/model/Screen_Impl.hpp +++ b/src/model/Screen_Impl.hpp @@ -143,7 +143,7 @@ namespace model { /** Sets the resistivity of the material in m*K/W, if possible. */ bool setThermalResistivity(double value); - bool setReflectedBeamTransmittanceAccountingMethod(std::string reflectedBeamTransmittanceAccountingMethod); + bool setReflectedBeamTransmittanceAccountingMethod(const std::string& reflectedBeamTransmittanceAccountingMethod); void resetReflectedBeamTransmittanceAccountingMethod(); @@ -183,7 +183,7 @@ namespace model { void resetRightSideOpeningMultiplier(); - bool setAngleofResolutionforScreenTransmittanceOutputMap(std::string angleofResolutionforScreenTransmittanceOutputMap); + bool setAngleofResolutionforScreenTransmittanceOutputMap(const std::string& angleofResolutionforScreenTransmittanceOutputMap); void resetAngleofResolutionforScreenTransmittanceOutputMap(); diff --git a/src/model/SetpointManagerSingleZoneCooling.cpp b/src/model/SetpointManagerSingleZoneCooling.cpp index 33ef6da1b7a..6a064a707ac 100644 --- a/src/model/SetpointManagerSingleZoneCooling.cpp +++ b/src/model/SetpointManagerSingleZoneCooling.cpp @@ -191,8 +191,8 @@ namespace model { getImpl()->resetControlZone(); } - bool SetpointManagerSingleZoneCooling::setControlVariable(const std::string& value) { - return getImpl()->setControlVariable(value); + bool SetpointManagerSingleZoneCooling::setControlVariable(const std::string& controlVariable) { + return getImpl()->setControlVariable(controlVariable); } std::string SetpointManagerSingleZoneCooling::controlVariable() const { diff --git a/src/model/SetpointManagerSingleZoneHeating.cpp b/src/model/SetpointManagerSingleZoneHeating.cpp index f0ca7ea7628..78363a79337 100644 --- a/src/model/SetpointManagerSingleZoneHeating.cpp +++ b/src/model/SetpointManagerSingleZoneHeating.cpp @@ -191,8 +191,8 @@ namespace model { getImpl()->resetControlZone(); } - bool SetpointManagerSingleZoneHeating::setControlVariable(const std::string& value) { - return getImpl()->setControlVariable(value); + bool SetpointManagerSingleZoneHeating::setControlVariable(const std::string& controlVariable) { + return getImpl()->setControlVariable(controlVariable); } std::string SetpointManagerSingleZoneHeating::controlVariable() const { diff --git a/src/model/SetpointManagerWarmestTemperatureFlow.cpp b/src/model/SetpointManagerWarmestTemperatureFlow.cpp index 88d47ab4e3f..2d50f7fbef2 100644 --- a/src/model/SetpointManagerWarmestTemperatureFlow.cpp +++ b/src/model/SetpointManagerWarmestTemperatureFlow.cpp @@ -111,7 +111,7 @@ namespace model { return result; } - bool SetpointManagerWarmestTemperatureFlow_Impl::setStrategy(std::string strategy) { + bool SetpointManagerWarmestTemperatureFlow_Impl::setStrategy(const std::string& strategy) { bool result = setString(OS_SetpointManager_WarmestTemperatureFlowFields::Strategy, strategy); return result; } @@ -197,7 +197,7 @@ namespace model { return getImpl()->setMaximumSetpointTemperature(maximumSetpointTemperature); } - bool SetpointManagerWarmestTemperatureFlow::setStrategy(std::string strategy) { + bool SetpointManagerWarmestTemperatureFlow::setStrategy(const std::string& strategy) { return getImpl()->setStrategy(strategy); } diff --git a/src/model/SetpointManagerWarmestTemperatureFlow.hpp b/src/model/SetpointManagerWarmestTemperatureFlow.hpp index e3ddc5ee37a..560be31ec2f 100644 --- a/src/model/SetpointManagerWarmestTemperatureFlow.hpp +++ b/src/model/SetpointManagerWarmestTemperatureFlow.hpp @@ -87,7 +87,7 @@ namespace model { bool setMaximumSetpointTemperature(double maximumSetpointTemperature); - bool setStrategy(std::string strategy); + bool setStrategy(const std::string& strategy); bool setMinimumTurndownRatio(double minimumTurndownRatio); diff --git a/src/model/SetpointManagerWarmestTemperatureFlow_Impl.hpp b/src/model/SetpointManagerWarmestTemperatureFlow_Impl.hpp index 386e9ffa427..d7bd00c262c 100644 --- a/src/model/SetpointManagerWarmestTemperatureFlow_Impl.hpp +++ b/src/model/SetpointManagerWarmestTemperatureFlow_Impl.hpp @@ -88,7 +88,7 @@ namespace model { bool setMaximumSetpointTemperature(double maximumSetpointTemperature); - bool setStrategy(std::string strategy); + bool setStrategy(const std::string& strategy); bool setMinimumTurndownRatio(double minimumTurndownRatio); diff --git a/src/model/Shade.cpp b/src/model/Shade.cpp index ccd8ad9f7df..ad5acec7f45 100644 --- a/src/model/Shade.cpp +++ b/src/model/Shade.cpp @@ -432,8 +432,8 @@ namespace model { return getImpl()->setThermalResistance(value); } - bool Shade::setThermalTransmittance(double value) { - return getImpl()->setThermalTransmittance(value); + bool Shade::setThermalTransmittance(double thermalTransmittance) { + return getImpl()->setThermalTransmittance(thermalTransmittance); } double Shade::thickness() const { diff --git a/src/model/Shade.hpp b/src/model/Shade.hpp index 7eb96eadbb4..56508711f14 100644 --- a/src/model/Shade.hpp +++ b/src/model/Shade.hpp @@ -135,15 +135,15 @@ namespace model { /** Sets the resistance of the material in m^2*K/W, if possible. */ bool setThermalResistance(double value); - bool setThermalTransmittance(double value); + bool setThermalTransmittance(double thermalTransmittance); - bool setSolarTransmittance(double value); + bool setSolarTransmittance(double solarTransmittance); - bool setSolarReflectance(double value); + bool setSolarReflectance(double solarReflectance); - bool setVisibleTransmittance(double value); + bool setVisibleTransmittance(double visibleTransmittance); - bool setVisibleReflectance(double value); + bool setVisibleReflectance(double visibleReflectance); bool setThermalHemisphericalEmissivity(double thermalHemisphericalEmissivity); diff --git a/src/model/Shade_Impl.hpp b/src/model/Shade_Impl.hpp index 03c0f863df9..679d3cc3dba 100644 --- a/src/model/Shade_Impl.hpp +++ b/src/model/Shade_Impl.hpp @@ -136,7 +136,7 @@ namespace model { //@{ /** Set thickness to value (m). */ - virtual bool setThickness(double value) override; + virtual bool setThickness(double thickness) override; /** Sets the conductivity of the material in W/m*K, if possible. */ bool setThermalConductivity(double value); @@ -150,15 +150,15 @@ namespace model { /** Sets the resistance of the material in m^2*K/W, if possible. */ bool setThermalResistance(double value); - bool setThermalTransmittance(double value); + bool setThermalTransmittance(double thermalTransmittance); - bool setSolarTransmittance(double value); + bool setSolarTransmittance(double solarTransmittance); - bool setSolarReflectance(double value); + bool setSolarReflectance(double solarReflectance); - bool setVisibleTransmittance(double value); + bool setVisibleTransmittance(double visibleTransmittance); - bool setVisibleReflectance(double value); + bool setVisibleReflectance(double visibleReflectance); bool setThermalHemisphericalEmissivity(double thermalHemisphericalEmissivity); diff --git a/src/model/SizingPlant.cpp b/src/model/SizingPlant.cpp index c002a659675..7bdfd6989c4 100644 --- a/src/model/SizingPlant.cpp +++ b/src/model/SizingPlant.cpp @@ -104,7 +104,7 @@ namespace model { return result; } - bool SizingPlant_Impl::setLoopType(std::string loopType) { + bool SizingPlant_Impl::setLoopType(const std::string& loopType) { bool result = setString(OS_Sizing_PlantFields::LoopType, loopType); return result; } @@ -162,7 +162,7 @@ namespace model { return value.get(); } - bool SizingPlant_Impl::setSizingOption(std::string sizingOption) { + bool SizingPlant_Impl::setSizingOption(const std::string& sizingOption) { bool result = setString(OS_Sizing_PlantFields::SizingOption, sizingOption); return result; } @@ -172,7 +172,7 @@ namespace model { return result; } - bool SizingPlant_Impl::setCoincidentSizingFactorMode(std::string coincidentSizingFactorMode) { + bool SizingPlant_Impl::setCoincidentSizingFactorMode(const std::string& coincidentSizingFactorMode) { bool result = setString(OS_Sizing_PlantFields::CoincidentSizingFactorMode, coincidentSizingFactorMode); return result; } @@ -220,7 +220,7 @@ namespace model { return getImpl()->setPlantLoop(plantLoop); } - bool SizingPlant::setLoopType(std::string loopType) { + bool SizingPlant::setLoopType(const std::string& loopType) { return getImpl()->setLoopType(loopType); } @@ -248,7 +248,7 @@ namespace model { return getImpl()->zoneTimestepsinAveragingWindow(); } - bool SizingPlant::setSizingOption(std::string sizingOption) { + bool SizingPlant::setSizingOption(const std::string& sizingOption) { return getImpl()->setSizingOption(sizingOption); } @@ -256,7 +256,7 @@ namespace model { return getImpl()->setZoneTimestepsinAveragingWindow(zoneTimestepsinAveragingWindow); } - bool SizingPlant::setCoincidentSizingFactorMode(std::string coincidentSizingFactorMode) { + bool SizingPlant::setCoincidentSizingFactorMode(const std::string& coincidentSizingFactorMode) { return getImpl()->setCoincidentSizingFactorMode(coincidentSizingFactorMode); } @@ -269,4 +269,4 @@ namespace model { /// @endcond } // namespace model -} // namespace openstudio \ No newline at end of file +} // namespace openstudio diff --git a/src/model/SizingPlant.hpp b/src/model/SizingPlant.hpp index 2aafd4eb5eb..21f3d66b54a 100644 --- a/src/model/SizingPlant.hpp +++ b/src/model/SizingPlant.hpp @@ -67,7 +67,7 @@ namespace model { std::string loopType() const; - bool setLoopType(std::string loopType); + bool setLoopType(const std::string& loopType); double designLoopExitTemperature() const; @@ -79,7 +79,7 @@ namespace model { std::string sizingOption() const; - bool setSizingOption(std::string sizingOption); + bool setSizingOption(const std::string& sizingOption); int zoneTimestepsinAveragingWindow() const; @@ -87,7 +87,7 @@ namespace model { std::string coincidentSizingFactorMode() const; - bool setCoincidentSizingFactorMode(std::string coincidentSizingFactorMode); + bool setCoincidentSizingFactorMode(const std::string& coincidentSizingFactorMode); protected: /// @cond @@ -114,4 +114,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_SIZINGPLANT_HPP \ No newline at end of file +#endif // MODEL_SIZINGPLANT_HPP diff --git a/src/model/SizingPlant_Impl.hpp b/src/model/SizingPlant_Impl.hpp index a0eab655e98..6511347929b 100644 --- a/src/model/SizingPlant_Impl.hpp +++ b/src/model/SizingPlant_Impl.hpp @@ -75,17 +75,17 @@ namespace model { bool setPlantLoop(const PlantLoop& plantLoop); - bool setLoopType(std::string loopType); + bool setLoopType(const std::string& loopType); bool setDesignLoopExitTemperature(double designLoopExitTemperature); bool setLoopDesignTemperatureDifference(double loopDesignTemperatureDifference); - bool setSizingOption(std::string sizingOption); + bool setSizingOption(const std::string& sizingOption); bool setZoneTimestepsinAveragingWindow(int zoneTimestepsinAveragingWindow); - bool setCoincidentSizingFactorMode(std::string coincidentSizingFactorMode); + bool setCoincidentSizingFactorMode(const std::string& coincidentSizingFactorMode); protected: private: @@ -108,4 +108,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_SIZINGPLANT_IMPL_HPP \ No newline at end of file +#endif // MODEL_SIZINGPLANT_IMPL_HPP diff --git a/src/model/SolarCollectorPerformanceFlatPlate.cpp b/src/model/SolarCollectorPerformanceFlatPlate.cpp index 4b04ede6a7e..a0a0c34582f 100644 --- a/src/model/SolarCollectorPerformanceFlatPlate.cpp +++ b/src/model/SolarCollectorPerformanceFlatPlate.cpp @@ -126,7 +126,7 @@ namespace model { return result; } - bool SolarCollectorPerformanceFlatPlate_Impl::setTestFluid(std::string testFluid) { + bool SolarCollectorPerformanceFlatPlate_Impl::setTestFluid(const std::string& testFluid) { bool result = setString(OS_SolarCollectorPerformance_FlatPlateFields::TestFluid, testFluid); return result; } @@ -141,7 +141,7 @@ namespace model { return result; } - bool SolarCollectorPerformanceFlatPlate_Impl::setTestCorrelationType(std::string testCorrelationType) { + bool SolarCollectorPerformanceFlatPlate_Impl::setTestCorrelationType(const std::string& testCorrelationType) { bool result = setString(OS_SolarCollectorPerformance_FlatPlateFields::TestCorrelationType, testCorrelationType); return result; } @@ -293,7 +293,7 @@ namespace model { return getImpl()->setGrossArea(grossArea); } - bool SolarCollectorPerformanceFlatPlate::setTestFluid(std::string testFluid) { + bool SolarCollectorPerformanceFlatPlate::setTestFluid(const std::string& testFluid) { return getImpl()->setTestFluid(testFluid); } @@ -305,7 +305,7 @@ namespace model { return getImpl()->setTestFlowRate(testFlowRate); } - bool SolarCollectorPerformanceFlatPlate::setTestCorrelationType(std::string testCorrelationType) { + bool SolarCollectorPerformanceFlatPlate::setTestCorrelationType(const std::string& testCorrelationType) { return getImpl()->setTestCorrelationType(testCorrelationType); } diff --git a/src/model/SolarCollectorPerformanceFlatPlate.hpp b/src/model/SolarCollectorPerformanceFlatPlate.hpp index e9793c7075d..5bcc1cf8217 100644 --- a/src/model/SolarCollectorPerformanceFlatPlate.hpp +++ b/src/model/SolarCollectorPerformanceFlatPlate.hpp @@ -92,13 +92,13 @@ namespace model { bool setGrossArea(double grossArea); - bool setTestFluid(std::string testFluid); + bool setTestFluid(const std::string& testFluid); void resetTestFluid(); bool setTestFlowRate(double testFlowRate); - bool setTestCorrelationType(std::string testCorrelationType); + bool setTestCorrelationType(const std::string& testCorrelationType); bool setCoefficient1ofEfficiencyEquation(double coefficient1ofEfficiencyEquation); diff --git a/src/model/SolarCollectorPerformanceFlatPlate_Impl.hpp b/src/model/SolarCollectorPerformanceFlatPlate_Impl.hpp index c470ce6e421..2a5004ec1ab 100644 --- a/src/model/SolarCollectorPerformanceFlatPlate_Impl.hpp +++ b/src/model/SolarCollectorPerformanceFlatPlate_Impl.hpp @@ -92,13 +92,13 @@ namespace model { bool setGrossArea(double grossArea); - bool setTestFluid(std::string testFluid); + bool setTestFluid(const std::string& testFluid); void resetTestFluid(); bool setTestFlowRate(double testFlowRate); - bool setTestCorrelationType(std::string testCorrelationType); + bool setTestCorrelationType(const std::string& testCorrelationType); bool setCoefficient1ofEfficiencyEquation(double coefficient1ofEfficiencyEquation); diff --git a/src/model/SolarCollectorPerformanceIntegralCollectorStorage.cpp b/src/model/SolarCollectorPerformanceIntegralCollectorStorage.cpp index 561b258dbf2..9f10f0877e6 100644 --- a/src/model/SolarCollectorPerformanceIntegralCollectorStorage.cpp +++ b/src/model/SolarCollectorPerformanceIntegralCollectorStorage.cpp @@ -242,7 +242,7 @@ namespace model { return isEmpty(OS_SolarCollectorPerformance_IntegralCollectorStorageFields::EmissivityofAbsorberPlate); } - bool SolarCollectorPerformanceIntegralCollectorStorage_Impl::setICSCollectorType(std::string iCSCollectorType) { + bool SolarCollectorPerformanceIntegralCollectorStorage_Impl::setICSCollectorType(const std::string& iCSCollectorType) { bool result = setString(OS_SolarCollectorPerformance_IntegralCollectorStorageFields::ICSCollectorType, iCSCollectorType); return result; } @@ -583,7 +583,7 @@ namespace model { return getImpl()->isEmissivityOfAbsorberPlateDefaulted(); } - bool SolarCollectorPerformanceIntegralCollectorStorage::setICSCollectorType(std::string iCSCollectorType) { + bool SolarCollectorPerformanceIntegralCollectorStorage::setICSCollectorType(const std::string& iCSCollectorType) { return getImpl()->setICSCollectorType(iCSCollectorType); } diff --git a/src/model/SolarCollectorPerformanceIntegralCollectorStorage.hpp b/src/model/SolarCollectorPerformanceIntegralCollectorStorage.hpp index 7a2e80755ee..6270470636e 100644 --- a/src/model/SolarCollectorPerformanceIntegralCollectorStorage.hpp +++ b/src/model/SolarCollectorPerformanceIntegralCollectorStorage.hpp @@ -136,7 +136,7 @@ namespace model { /** @name Setters */ //@{ - bool setICSCollectorType(std::string iCSCollectorType); + bool setICSCollectorType(const std::string& iCSCollectorType); void resetICSCollectorType(); diff --git a/src/model/SolarCollectorPerformanceIntegralCollectorStorage_Impl.hpp b/src/model/SolarCollectorPerformanceIntegralCollectorStorage_Impl.hpp index 7240114d74c..15b5aa9328e 100644 --- a/src/model/SolarCollectorPerformanceIntegralCollectorStorage_Impl.hpp +++ b/src/model/SolarCollectorPerformanceIntegralCollectorStorage_Impl.hpp @@ -140,7 +140,7 @@ namespace model { /** @name Setters */ //@{ - bool setICSCollectorType(std::string iCSCollectorType); + bool setICSCollectorType(const std::string& iCSCollectorType); void resetICSCollectorType(); diff --git a/src/model/SolarCollectorPerformancePhotovoltaicThermalSimple.hpp b/src/model/SolarCollectorPerformancePhotovoltaicThermalSimple.hpp index e63209f28f7..30335c12153 100644 --- a/src/model/SolarCollectorPerformancePhotovoltaicThermalSimple.hpp +++ b/src/model/SolarCollectorPerformancePhotovoltaicThermalSimple.hpp @@ -83,7 +83,7 @@ namespace model { bool setFractionOfSurfaceAreaWithActiveThermalCollector(double fractionofSurfaceAreawithActiveThermalCollector); - bool setThermalConversionEfficiency(double fixedThermalConversionEfficiency); + bool setThermalConversionEfficiency(double valueforThermalConversionEfficiencyifFixed); void resetThermalConversionEfficiency(); diff --git a/src/model/StandardGlazing.cpp b/src/model/StandardGlazing.cpp index 23bfb813198..b33d4128057 100644 --- a/src/model/StandardGlazing.cpp +++ b/src/model/StandardGlazing.cpp @@ -206,7 +206,7 @@ namespace model { return isEmpty(OS_WindowMaterial_GlazingFields::SolarDiffusing); } - bool StandardGlazing_Impl::setOpticalDataType(std::string opticalDataType) { + bool StandardGlazing_Impl::setOpticalDataType(const std::string& opticalDataType) { bool result = setString(OS_WindowMaterial_GlazingFields::OpticalDataType, opticalDataType); return result; } @@ -222,7 +222,6 @@ namespace model { } } else { resetWindowGlassSpectralDataSetName(); - result = true; result = setOpticalDataType("SpectralAverage"); OS_ASSERT(result); } @@ -489,7 +488,7 @@ namespace model { } // namespace detail - StandardGlazing::StandardGlazing(const Model& model, std::string opticalDataType, double thickness) + StandardGlazing::StandardGlazing(const Model& model, const std::string& opticalDataType, double thickness) : Glazing(StandardGlazing::iddObjectType(), model) { OS_ASSERT(getImpl()); @@ -611,7 +610,7 @@ namespace model { return getImpl()->isSolarDiffusingDefaulted(); } - bool StandardGlazing::setOpticalDataType(std::string opticalDataType) { + bool StandardGlazing::setOpticalDataType(const std::string& opticalDataType) { return getImpl()->setOpticalDataType(opticalDataType); } diff --git a/src/model/StandardGlazing.hpp b/src/model/StandardGlazing.hpp index 1893079ecdb..13f07820d17 100644 --- a/src/model/StandardGlazing.hpp +++ b/src/model/StandardGlazing.hpp @@ -52,7 +52,7 @@ namespace model { /** @name Constructors and Destructors */ //@{ - explicit StandardGlazing(const Model& model, std::string opticalDataType = "SpectralAverage", double thickness = 0.1); + explicit StandardGlazing(const Model& model, const std::string& opticalDataType = "SpectralAverage", double thickness = 0.1); virtual ~StandardGlazing() {} @@ -124,7 +124,7 @@ namespace model { //@{ // TODO: JM 2018-12-13 This needs to be removed as it will be set by setWindowGlassSpectralDataSet/resetWindowGlassSpectalDataSet - bool setOpticalDataType(std::string opticalDataType); + bool setOpticalDataType(const std::string& opticalDataType); /** deprecated **/ bool setWindowGlassSpectralDataSetName(const std::string& windowGlassSpectralDataSetName); diff --git a/src/model/StandardGlazing_Impl.hpp b/src/model/StandardGlazing_Impl.hpp index 3915aeeabf3..eff40d9f8b1 100644 --- a/src/model/StandardGlazing_Impl.hpp +++ b/src/model/StandardGlazing_Impl.hpp @@ -127,7 +127,7 @@ namespace model { /** @name Setters */ //@{ - bool setOpticalDataType(std::string opticalDataType); + bool setOpticalDataType(const std::string& opticalDataType); bool setWindowGlassSpectralDataSetName(boost::optional windowGlassSpectralDataSetName); void resetWindowGlassSpectralDataSetName(); @@ -136,7 +136,7 @@ namespace model { void resetWindowGlassSpectralDataSet(); /** Set thickness to value (m). */ - virtual bool setThickness(double value) override; + virtual bool setThickness(double thickness) override; bool setSolarTransmittance(double value); @@ -238,4 +238,4 @@ namespace model { } // namespace model } // namespace openstudio -#endif // MODEL_STANDARDGLAZING_IMPL_HPP \ No newline at end of file +#endif // MODEL_STANDARDGLAZING_IMPL_HPP diff --git a/src/model/StandardOpaqueMaterial.cpp b/src/model/StandardOpaqueMaterial.cpp index d4a34e325a7..e97b8421e9e 100644 --- a/src/model/StandardOpaqueMaterial.cpp +++ b/src/model/StandardOpaqueMaterial.cpp @@ -189,7 +189,7 @@ namespace model { return isEmpty(OS_MaterialFields::VisibleAbsorptance); } - bool StandardOpaqueMaterial_Impl::setRoughness(std::string roughness) { + bool StandardOpaqueMaterial_Impl::setRoughness(const std::string& roughness) { bool result = setString(OS_MaterialFields::Roughness, roughness); return result; } @@ -319,8 +319,8 @@ namespace model { } // namespace detail - StandardOpaqueMaterial::StandardOpaqueMaterial(const Model& model, std::string roughness, double thickness, double conductivity, double density, - double specificHeat) + StandardOpaqueMaterial::StandardOpaqueMaterial(const Model& model, const std::string& roughness, double thickness, double conductivity, + double density, double specificHeat) : OpaqueMaterial(StandardOpaqueMaterial::iddObjectType(), model) { OS_ASSERT(getImpl()); @@ -464,7 +464,7 @@ namespace model { return getImpl()->isVisibleAbsorptanceDefaulted(); } - bool StandardOpaqueMaterial::setRoughness(std::string roughness) { + bool StandardOpaqueMaterial::setRoughness(const std::string& roughness) { return getImpl()->setRoughness(roughness); } diff --git a/src/model/StandardOpaqueMaterial.hpp b/src/model/StandardOpaqueMaterial.hpp index 2fc46ceb41e..9d2343d9775 100644 --- a/src/model/StandardOpaqueMaterial.hpp +++ b/src/model/StandardOpaqueMaterial.hpp @@ -50,7 +50,7 @@ namespace model { /** @name Constructors and Destructors */ //@{ - explicit StandardOpaqueMaterial(const Model& model, std::string roughness = "Smooth", double thickness = 0.1, double conductivity = 0.1, + explicit StandardOpaqueMaterial(const Model& model, const std::string& roughness = "Smooth", double thickness = 0.1, double conductivity = 0.1, double density = 0.1, double specificHeat = 1400); virtual ~StandardOpaqueMaterial() {} @@ -175,7 +175,7 @@ namespace model { * Attribute name: 'visibleReflectance' */ bool setVisibleReflectance(boost::optional value); - bool setRoughness(std::string roughness); + bool setRoughness(const std::string& roughness); bool setThickness(double thickness); diff --git a/src/model/StandardOpaqueMaterial_Impl.hpp b/src/model/StandardOpaqueMaterial_Impl.hpp index 8ba91d35206..8199b614f0b 100644 --- a/src/model/StandardOpaqueMaterial_Impl.hpp +++ b/src/model/StandardOpaqueMaterial_Impl.hpp @@ -144,7 +144,7 @@ namespace model { virtual bool setVisibleReflectance(boost::optional value) override; - virtual bool setRoughness(std::string roughness); + virtual bool setRoughness(const std::string& roughness); virtual bool setThickness(double thickness) override; diff --git a/src/model/TableMultiVariableLookup.cpp b/src/model/TableMultiVariableLookup.cpp index d673803673c..26cbbe17231 100644 --- a/src/model/TableMultiVariableLookup.cpp +++ b/src/model/TableMultiVariableLookup.cpp @@ -48,7 +48,7 @@ namespace openstudio { namespace model { - TableMultiVariableLookupPoint::TableMultiVariableLookupPoint(std::vector x, double y) : m_x(x), m_y(y){}; + TableMultiVariableLookupPoint::TableMultiVariableLookupPoint(const std::vector& x, double y) : m_x(x), m_y(y){}; TableMultiVariableLookupPoint::TableMultiVariableLookupPoint(double x1, double yValue) : m_x(std::vector{x1}), m_y(yValue){}; @@ -323,7 +323,7 @@ namespace model { return value.get(); } - bool TableMultiVariableLookup_Impl::setInterpolationMethod(std::string interpolationMethod) { + bool TableMultiVariableLookup_Impl::setInterpolationMethod(const std::string& interpolationMethod) { bool result = setString(OS_Table_MultiVariableLookupFields::InterpolationMethod, interpolationMethod); return result; } @@ -359,7 +359,7 @@ namespace model { OS_ASSERT(result); } - bool TableMultiVariableLookup_Impl::setTableDataFormat(std::string tableDataFormat) { + bool TableMultiVariableLookup_Impl::setTableDataFormat(const std::string& tableDataFormat) { bool result = setString(OS_Table_MultiVariableLookupFields::TableDataFormat, tableDataFormat); return result; } @@ -386,7 +386,7 @@ namespace model { OS_ASSERT(result); } - bool TableMultiVariableLookup_Impl::setX1SortOrder(std::string x1SortOrder) { + bool TableMultiVariableLookup_Impl::setX1SortOrder(const std::string& x1SortOrder) { bool result = setString(OS_Table_MultiVariableLookupFields::X1SortOrder, x1SortOrder); return result; } @@ -396,7 +396,7 @@ namespace model { OS_ASSERT(result); } - bool TableMultiVariableLookup_Impl::setX2SortOrder(std::string x2SortOrder) { + bool TableMultiVariableLookup_Impl::setX2SortOrder(const std::string& x2SortOrder) { bool result = setString(OS_Table_MultiVariableLookupFields::X2SortOrder, x2SortOrder); return result; } @@ -627,7 +627,7 @@ namespace model { OS_ASSERT(result); } - bool TableMultiVariableLookup_Impl::setInputUnitTypeforX1(std::string inputUnitTypeforX1) { + bool TableMultiVariableLookup_Impl::setInputUnitTypeforX1(const std::string& inputUnitTypeforX1) { bool result = setString(OS_Table_MultiVariableLookupFields::InputUnitTypeforX1, inputUnitTypeforX1); return result; } @@ -637,7 +637,7 @@ namespace model { OS_ASSERT(result); } - bool TableMultiVariableLookup_Impl::setInputUnitTypeforX2(std::string inputUnitTypeforX2) { + bool TableMultiVariableLookup_Impl::setInputUnitTypeforX2(const std::string& inputUnitTypeforX2) { bool result = setString(OS_Table_MultiVariableLookupFields::InputUnitTypeforX2, inputUnitTypeforX2); return result; } @@ -647,7 +647,7 @@ namespace model { OS_ASSERT(result); } - bool TableMultiVariableLookup_Impl::setInputUnitTypeforX3(std::string inputUnitTypeforX3) { + bool TableMultiVariableLookup_Impl::setInputUnitTypeforX3(const std::string& inputUnitTypeforX3) { bool result = setString(OS_Table_MultiVariableLookupFields::InputUnitTypeforX3, inputUnitTypeforX3); return result; } @@ -657,7 +657,7 @@ namespace model { OS_ASSERT(result); } - bool TableMultiVariableLookup_Impl::setInputUnitTypeforX4(std::string inputUnitTypeforX4) { + bool TableMultiVariableLookup_Impl::setInputUnitTypeforX4(const std::string& inputUnitTypeforX4) { bool result = setString(OS_Table_MultiVariableLookupFields::InputUnitTypeforX4, inputUnitTypeforX4); return result; } @@ -667,7 +667,7 @@ namespace model { OS_ASSERT(result); } - bool TableMultiVariableLookup_Impl::setInputUnitTypeforX5(std::string inputUnitTypeforX5) { + bool TableMultiVariableLookup_Impl::setInputUnitTypeforX5(const std::string& inputUnitTypeforX5) { bool result = setString(OS_Table_MultiVariableLookupFields::InputUnitTypeforX5, inputUnitTypeforX5); return result; } @@ -677,7 +677,7 @@ namespace model { OS_ASSERT(result); } - bool TableMultiVariableLookup_Impl::setOutputUnitType(std::string outputUnitType) { + bool TableMultiVariableLookup_Impl::setOutputUnitType(const std::string& outputUnitType) { bool result = setString(OS_Table_MultiVariableLookupFields::OutputUnitType, outputUnitType); return result; } @@ -753,7 +753,7 @@ namespace model { } // Helper function for printTable - std::string centered(std::string const& original, int targetSize) { + std::string centered(const std::string& original, int targetSize) { // assert( targetSize >= 0 ); int padding = targetSize - (int)(original.size()); return padding > 0 ? std::string(padding / 2, ' ') + original + std::string(padding - (padding / 2), ' ') : original; @@ -1094,7 +1094,7 @@ namespace model { return getImpl()->numberofIndependentVariables(); } - bool TableMultiVariableLookup::setInterpolationMethod(std::string interpolationMethod) { + bool TableMultiVariableLookup::setInterpolationMethod(const std::string& interpolationMethod) { return getImpl()->setInterpolationMethod(interpolationMethod); } @@ -1110,7 +1110,7 @@ namespace model { getImpl()->resetNumberofInterpolationPoints(); } - bool TableMultiVariableLookup::setCurveType(std::string curveType) { + bool TableMultiVariableLookup::setCurveType(const std::string& curveType) { return getImpl()->setCurveType(curveType); } @@ -1118,7 +1118,7 @@ namespace model { getImpl()->resetCurveType(); } - bool TableMultiVariableLookup::setTableDataFormat(std::string tableDataFormat) { + bool TableMultiVariableLookup::setTableDataFormat(const std::string& tableDataFormat) { return getImpl()->setTableDataFormat(tableDataFormat); } @@ -1230,7 +1230,7 @@ namespace model { getImpl()->resetMaximumTableOutput(); } - bool TableMultiVariableLookup::setInputUnitTypeforX1(std::string inputUnitTypeforX1) { + bool TableMultiVariableLookup::setInputUnitTypeforX1(const std::string& inputUnitTypeforX1) { return getImpl()->setInputUnitTypeforX1(inputUnitTypeforX1); } @@ -1238,7 +1238,7 @@ namespace model { getImpl()->resetInputUnitTypeforX1(); } - bool TableMultiVariableLookup::setInputUnitTypeforX2(std::string inputUnitTypeforX2) { + bool TableMultiVariableLookup::setInputUnitTypeforX2(const std::string& inputUnitTypeforX2) { return getImpl()->setInputUnitTypeforX2(inputUnitTypeforX2); } @@ -1246,7 +1246,7 @@ namespace model { getImpl()->resetInputUnitTypeforX2(); } - bool TableMultiVariableLookup::setInputUnitTypeforX3(std::string inputUnitTypeforX3) { + bool TableMultiVariableLookup::setInputUnitTypeforX3(const std::string& inputUnitTypeforX3) { return getImpl()->setInputUnitTypeforX3(inputUnitTypeforX3); } @@ -1254,7 +1254,7 @@ namespace model { getImpl()->resetInputUnitTypeforX3(); } - bool TableMultiVariableLookup::setInputUnitTypeforX4(std::string inputUnitTypeforX4) { + bool TableMultiVariableLookup::setInputUnitTypeforX4(const std::string& inputUnitTypeforX4) { return getImpl()->setInputUnitTypeforX4(inputUnitTypeforX4); } @@ -1262,7 +1262,7 @@ namespace model { getImpl()->resetInputUnitTypeforX4(); } - bool TableMultiVariableLookup::setInputUnitTypeforX5(std::string inputUnitTypeforX5) { + bool TableMultiVariableLookup::setInputUnitTypeforX5(const std::string& inputUnitTypeforX5) { return getImpl()->setInputUnitTypeforX5(inputUnitTypeforX5); } @@ -1270,7 +1270,7 @@ namespace model { getImpl()->resetInputUnitTypeforX5(); } - bool TableMultiVariableLookup::setOutputUnitType(std::string outputUnitType) { + bool TableMultiVariableLookup::setOutputUnitType(const std::string& outputUnitType) { return getImpl()->setOutputUnitType(outputUnitType); } diff --git a/src/model/TableMultiVariableLookup.hpp b/src/model/TableMultiVariableLookup.hpp index dec5c8772b4..c86a49dd16e 100644 --- a/src/model/TableMultiVariableLookup.hpp +++ b/src/model/TableMultiVariableLookup.hpp @@ -49,7 +49,7 @@ namespace model { class MODEL_API TableMultiVariableLookupPoint { public: - TableMultiVariableLookupPoint(std::vector x, double y); + TableMultiVariableLookupPoint(const std::vector& x, double y); TableMultiVariableLookupPoint(double x1, double yValue); TableMultiVariableLookupPoint(double x1, double x2, double yValue); TableMultiVariableLookupPoint(double x1, double x2, double x3, double yValue); @@ -186,7 +186,7 @@ namespace model { /** @name Setters */ //@{ - bool setInterpolationMethod(std::string interpolationMethod); + bool setInterpolationMethod(const std::string& interpolationMethod); void resetInterpolationMethod(); @@ -194,11 +194,11 @@ namespace model { void resetNumberofInterpolationPoints(); - bool setCurveType(std::string curveType); + bool setCurveType(const std::string& curveType); void resetCurveType(); - bool setTableDataFormat(std::string tableDataFormat); + bool setTableDataFormat(const std::string& tableDataFormat); void resetTableDataFormat(); @@ -254,27 +254,27 @@ namespace model { void resetMaximumTableOutput(); - bool setInputUnitTypeforX1(std::string inputUnitTypeforX1); + bool setInputUnitTypeforX1(const std::string& inputUnitTypeforX1); void resetInputUnitTypeforX1(); - bool setInputUnitTypeforX2(std::string inputUnitTypeforX2); + bool setInputUnitTypeforX2(const std::string& inputUnitTypeforX2); void resetInputUnitTypeforX2(); - bool setInputUnitTypeforX3(std::string inputUnitTypeforX3); + bool setInputUnitTypeforX3(const std::string& inputUnitTypeforX3); void resetInputUnitTypeforX3(); - bool setInputUnitTypeforX4(std::string inputUnitTypeforX4); + bool setInputUnitTypeforX4(const std::string& inputUnitTypeforX4); void resetInputUnitTypeforX4(); - bool setInputUnitTypeforX5(std::string inputUnitTypeforX5); + bool setInputUnitTypeforX5(const std::string& inputUnitTypeforX5); void resetInputUnitTypeforX5(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); diff --git a/src/model/TableMultiVariableLookup_Impl.hpp b/src/model/TableMultiVariableLookup_Impl.hpp index ac6af45f0fc..61fd15ecdfe 100644 --- a/src/model/TableMultiVariableLookup_Impl.hpp +++ b/src/model/TableMultiVariableLookup_Impl.hpp @@ -152,7 +152,7 @@ namespace model { /** @name Setters */ //@{ - bool setInterpolationMethod(std::string interpolationMethod); + bool setInterpolationMethod(const std::string& interpolationMethod); void resetInterpolationMethod(); @@ -164,7 +164,7 @@ namespace model { void resetCurveType(); - bool setTableDataFormat(std::string tableDataFormat); + bool setTableDataFormat(const std::string& tableDataFormat); void resetTableDataFormat(); @@ -172,11 +172,11 @@ namespace model { void resetExternalFileName(); - bool setX1SortOrder(std::string x1SortOrder); + bool setX1SortOrder(const std::string& x1SortOrder); void resetX1SortOrder(); - bool setX2SortOrder(std::string x2SortOrder); + bool setX2SortOrder(const std::string& x2SortOrder); void resetX2SortOrder(); @@ -232,27 +232,27 @@ namespace model { void resetMaximumTableOutput(); - bool setInputUnitTypeforX1(std::string inputUnitTypeforX1); + bool setInputUnitTypeforX1(const std::string& inputUnitTypeforX1); void resetInputUnitTypeforX1(); - bool setInputUnitTypeforX2(std::string inputUnitTypeforX2); + bool setInputUnitTypeforX2(const std::string& inputUnitTypeforX2); void resetInputUnitTypeforX2(); - bool setInputUnitTypeforX3(std::string inputUnitTypeforX3); + bool setInputUnitTypeforX3(const std::string& inputUnitTypeforX3); void resetInputUnitTypeforX3(); - bool setInputUnitTypeforX4(std::string inputUnitTypeforX4); + bool setInputUnitTypeforX4(const std::string& inputUnitTypeforX4); void resetInputUnitTypeforX4(); - bool setInputUnitTypeforX5(std::string inputUnitTypeforX5); + bool setInputUnitTypeforX5(const std::string& inputUnitTypeforX5); void resetInputUnitTypeforX5(); - bool setOutputUnitType(std::string outputUnitType); + bool setOutputUnitType(const std::string& outputUnitType); void resetOutputUnitType(); @@ -269,7 +269,7 @@ namespace model { * * The independent variables are indexed from 0. */ - std::vector xValues(int i) const; + std::vector xValues(int xIndex) const; /** Return the y value corresponding to xValues. * If no value then return boost::none @@ -282,7 +282,7 @@ namespace model { bool addPoint(const TableMultiVariableLookupPoint& point); // Convenience functions - bool addPoint(const std::vector& xValues, double yValue); + bool addPoint(const std::vector& t_xValues, double t_yValue); bool addPoint(double x1, double yValue); bool addPoint(double x1, double x2, double yValue); bool addPoint(double x1, double x2, double x3, double yValue); diff --git a/src/model/ThermalStorageChilledWaterStratified.cpp b/src/model/ThermalStorageChilledWaterStratified.cpp index 8d51d770ce9..347c8228e25 100644 --- a/src/model/ThermalStorageChilledWaterStratified.cpp +++ b/src/model/ThermalStorageChilledWaterStratified.cpp @@ -383,7 +383,7 @@ namespace model { return result; } - bool ThermalStorageChilledWaterStratified_Impl::setTankShape(std::string tankShape) { + bool ThermalStorageChilledWaterStratified_Impl::setTankShape(const std::string& tankShape) { bool result = setString(OS_ThermalStorage_ChilledWater_StratifiedFields::TankShape, tankShape); return result; } @@ -470,7 +470,7 @@ namespace model { OS_ASSERT(result); } - bool ThermalStorageChilledWaterStratified_Impl::setAmbientTemperatureIndicator(std::string ambientTemperatureIndicator) { + bool ThermalStorageChilledWaterStratified_Impl::setAmbientTemperatureIndicator(const std::string& ambientTemperatureIndicator) { bool result = setString(OS_ThermalStorage_ChilledWater_StratifiedFields::AmbientTemperatureIndicator, ambientTemperatureIndicator); return result; } @@ -639,7 +639,7 @@ namespace model { return result; } - bool ThermalStorageChilledWaterStratified_Impl::setInletMode(std::string inletMode) { + bool ThermalStorageChilledWaterStratified_Impl::setInletMode(const std::string& inletMode) { bool result = setString(OS_ThermalStorage_ChilledWater_StratifiedFields::InletMode, inletMode); return result; } @@ -988,7 +988,7 @@ namespace model { return getImpl()->setTankHeight(tankHeight); } - bool ThermalStorageChilledWaterStratified::setTankShape(std::string tankShape) { + bool ThermalStorageChilledWaterStratified::setTankShape(const std::string& tankShape) { return getImpl()->setTankShape(tankShape); } @@ -1036,7 +1036,7 @@ namespace model { getImpl()->resetNominalCoolingCapacity(); } - bool ThermalStorageChilledWaterStratified::setAmbientTemperatureIndicator(std::string ambientTemperatureIndicator) { + bool ThermalStorageChilledWaterStratified::setAmbientTemperatureIndicator(const std::string& ambientTemperatureIndicator) { return getImpl()->setAmbientTemperatureIndicator(ambientTemperatureIndicator); } @@ -1056,7 +1056,7 @@ namespace model { getImpl()->resetAmbientTemperatureThermalZone(); } - bool ThermalStorageChilledWaterStratified::setAmbientTemperatureOutdoorAirNodeName(std::string ambientTemperatureOutdoorAirNodeName) { + bool ThermalStorageChilledWaterStratified::setAmbientTemperatureOutdoorAirNodeName(const std::string& ambientTemperatureOutdoorAirNodeName) { return getImpl()->setAmbientTemperatureOutdoorAirNodeName( ambientTemperatureOutdoorAirNodeName); } @@ -1143,7 +1143,7 @@ namespace model { return getImpl()->setTankRecoveryTime(tankRecoveryTime); } - bool ThermalStorageChilledWaterStratified::setInletMode(std::string inletMode) { + bool ThermalStorageChilledWaterStratified::setInletMode(const std::string& inletMode) { return getImpl()->setInletMode(inletMode); } diff --git a/src/model/ThermalStorageChilledWaterStratified.hpp b/src/model/ThermalStorageChilledWaterStratified.hpp index 79326d8b4c0..9c38b199cc2 100644 --- a/src/model/ThermalStorageChilledWaterStratified.hpp +++ b/src/model/ThermalStorageChilledWaterStratified.hpp @@ -162,7 +162,7 @@ namespace model { bool setTankHeight(double tankHeight); - bool setTankShape(std::string tankShape); + bool setTankShape(const std::string& tankShape); bool setTankPerimeter(double tankPerimeter); @@ -186,7 +186,7 @@ namespace model { void resetNominalCoolingCapacity(); - bool setAmbientTemperatureIndicator(std::string ambientTemperatureIndicator); + bool setAmbientTemperatureIndicator(const std::string& ambientTemperatureIndicator); bool setAmbientTemperatureSchedule(Schedule& schedule); @@ -196,7 +196,7 @@ namespace model { void resetAmbientTemperatureThermalZone(); - bool setAmbientTemperatureOutdoorAirNodeName(std::string ambientTemperatureOutdoorAirNodeName); + bool setAmbientTemperatureOutdoorAirNodeName(const std::string& ambientTemperatureOutdoorAirNodeName); void resetAmbientTemperatureOutdoorAirNodeName(); @@ -238,7 +238,7 @@ namespace model { bool setTankRecoveryTime(double tankRecoveryTime); - bool setInletMode(std::string inletMode); + bool setInletMode(const std::string& inletMode); bool setNumberofNodes(int numberofNodes); diff --git a/src/model/ThermalStorageChilledWaterStratified_Impl.hpp b/src/model/ThermalStorageChilledWaterStratified_Impl.hpp index e1a2c5141fb..630da36e1e9 100644 --- a/src/model/ThermalStorageChilledWaterStratified_Impl.hpp +++ b/src/model/ThermalStorageChilledWaterStratified_Impl.hpp @@ -178,7 +178,7 @@ namespace model { bool setTankHeight(double tankHeight); - bool setTankShape(std::string tankShape); + bool setTankShape(const std::string& tankShape); bool setTankPerimeter(boost::optional tankPerimeter); @@ -202,7 +202,7 @@ namespace model { void resetNominalCoolingCapacity(); - bool setAmbientTemperatureIndicator(std::string ambientTemperatureIndicator); + bool setAmbientTemperatureIndicator(const std::string& ambientTemperatureIndicator); bool setAmbientTemperatureSchedule(Schedule& schedule); @@ -255,7 +255,7 @@ namespace model { bool setTankRecoveryTime(double tankRecoveryTime); - bool setInletMode(std::string inletMode); + bool setInletMode(const std::string& inletMode); bool setNumberofNodes(int numberofNodes); diff --git a/src/model/UnitarySystemPerformanceMultispeed.cpp b/src/model/UnitarySystemPerformanceMultispeed.cpp index 53e1b9f9b24..3656126ddd9 100644 --- a/src/model/UnitarySystemPerformanceMultispeed.cpp +++ b/src/model/UnitarySystemPerformanceMultispeed.cpp @@ -80,7 +80,8 @@ namespace model { OS_ASSERT(setString(OS_UnitarySystemPerformance_MultispeedFields::SingleModeOperation, "")); } - boost::optional UnitarySystemPerformanceMultispeed_Impl::readDoubleFieldOrAutosize(unsigned fieldNum, const ModelExtensibleGroup& group) { + boost::optional UnitarySystemPerformanceMultispeed_Impl::readDoubleFieldOrAutosize(unsigned fieldNum, + const ModelExtensibleGroup& group) const { boost::optional result = group.getDouble(fieldNum); if (!result) { boost::optional resultString = group.getString(fieldNum); @@ -91,7 +92,7 @@ namespace model { return result; } - std::vector UnitarySystemPerformanceMultispeed_Impl::supplyAirflowRatioFields() { + std::vector UnitarySystemPerformanceMultispeed_Impl::supplyAirflowRatioFields() const { std::vector result; for (const ModelExtensibleGroup& group : castVector(extensibleGroups())) { @@ -169,19 +170,19 @@ namespace model { return SupplyAirflowRatioField(false, coolingRatio); } - boost::optional SupplyAirflowRatioField::heatingRatio() { + boost::optional SupplyAirflowRatioField::heatingRatio() const { return m_heatingRatio; } - boost::optional SupplyAirflowRatioField::coolingRatio() { + boost::optional SupplyAirflowRatioField::coolingRatio() const { return m_coolingRatio; } - bool SupplyAirflowRatioField::isHeatingRatioAutosized() { + bool SupplyAirflowRatioField::isHeatingRatioAutosized() const { return !m_heatingRatio; } - bool SupplyAirflowRatioField::isCoolingRatioAutosized() { + bool SupplyAirflowRatioField::isCoolingRatioAutosized() const { return !m_coolingRatio; } @@ -218,7 +219,7 @@ namespace model { getImpl()->resetSingleModeOperation(); } - std::vector UnitarySystemPerformanceMultispeed::supplyAirflowRatioFields() { + std::vector UnitarySystemPerformanceMultispeed::supplyAirflowRatioFields() const { return getImpl()->supplyAirflowRatioFields(); } diff --git a/src/model/UnitarySystemPerformanceMultispeed.hpp b/src/model/UnitarySystemPerformanceMultispeed.hpp index 0e5ff3cc5b0..ca591d2d3b3 100644 --- a/src/model/UnitarySystemPerformanceMultispeed.hpp +++ b/src/model/UnitarySystemPerformanceMultispeed.hpp @@ -62,10 +62,10 @@ namespace model { /** @name Getters */ //@{ - boost::optional heatingRatio(); - boost::optional coolingRatio(); - bool isHeatingRatioAutosized(); - bool isCoolingRatioAutosized(); + boost::optional heatingRatio() const; + boost::optional coolingRatio() const; + bool isHeatingRatioAutosized() const; + bool isCoolingRatioAutosized() const; //@} protected: @@ -98,7 +98,7 @@ namespace model { bool singleModeOperation() const; - std::vector supplyAirflowRatioFields(); + std::vector supplyAirflowRatioFields() const; //@} diff --git a/src/model/UnitarySystemPerformanceMultispeed_Impl.hpp b/src/model/UnitarySystemPerformanceMultispeed_Impl.hpp index 58818c07177..cd0e557dd9c 100644 --- a/src/model/UnitarySystemPerformanceMultispeed_Impl.hpp +++ b/src/model/UnitarySystemPerformanceMultispeed_Impl.hpp @@ -36,6 +36,9 @@ namespace openstudio { namespace model { + class SupplyAirflowRatioField; + class ModelExtensibleGroup; + namespace detail { /** UnitarySystemPerformanceMultispeed_Impl is a ModelObject_Impl that is the implementation class for UnitarySystemPerformanceMultispeed.*/ @@ -63,7 +66,7 @@ namespace model { //@{ bool singleModeOperation() const; - std::vector supplyAirflowRatioFields(); + std::vector supplyAirflowRatioFields() const; //@} /** @name Setters */ @@ -85,7 +88,7 @@ namespace model { protected: private: REGISTER_LOGGER("openstudio.model.UnitarySystemPerformanceMultispeed"); - boost::optional readDoubleFieldOrAutosize(unsigned fieldNum, const ModelExtensibleGroup& group); + boost::optional readDoubleFieldOrAutosize(unsigned fieldNum, const ModelExtensibleGroup& group) const; }; } // namespace detail diff --git a/src/model/WaterUseEquipmentDefinition.cpp b/src/model/WaterUseEquipmentDefinition.cpp index d1ea7a45d94..7ef7e0cdf0d 100644 --- a/src/model/WaterUseEquipmentDefinition.cpp +++ b/src/model/WaterUseEquipmentDefinition.cpp @@ -96,7 +96,7 @@ namespace model { return getObject().getModelObjectTarget(OS_WaterUse_Equipment_DefinitionFields::LatentFractionScheduleName); } - bool WaterUseEquipmentDefinition_Impl::setEndUseSubcategory(std::string endUseSubcategory) { + bool WaterUseEquipmentDefinition_Impl::setEndUseSubcategory(const std::string& endUseSubcategory) { bool result = setString(OS_WaterUse_Equipment_DefinitionFields::EndUseSubcategory, endUseSubcategory); OS_ASSERT(result); return result; @@ -263,7 +263,7 @@ namespace model { return getImpl()->latentFractionSchedule(); } - bool WaterUseEquipmentDefinition::setEndUseSubcategory(std::string endUseSubcategory) { + bool WaterUseEquipmentDefinition::setEndUseSubcategory(const std::string& endUseSubcategory) { return getImpl()->setEndUseSubcategory(endUseSubcategory); } diff --git a/src/model/WaterUseEquipmentDefinition.hpp b/src/model/WaterUseEquipmentDefinition.hpp index 3ae2c23dc1e..3aaa45e0d62 100644 --- a/src/model/WaterUseEquipmentDefinition.hpp +++ b/src/model/WaterUseEquipmentDefinition.hpp @@ -57,7 +57,7 @@ namespace model { std::string endUseSubcategory() const; bool isEndUseSubcategoryDefaulted() const; - bool setEndUseSubcategory(std::string endUseSubcategory); + bool setEndUseSubcategory(const std::string& endUseSubcategory); void resetEndUseSubcategory(); double peakFlowRate() const; diff --git a/src/model/WaterUseEquipmentDefinition_Impl.hpp b/src/model/WaterUseEquipmentDefinition_Impl.hpp index 1c8f46ed499..b52dea78c6d 100644 --- a/src/model/WaterUseEquipmentDefinition_Impl.hpp +++ b/src/model/WaterUseEquipmentDefinition_Impl.hpp @@ -59,7 +59,7 @@ namespace model { std::string endUseSubcategory() const; bool isEndUseSubcategoryDefaulted() const; - bool setEndUseSubcategory(std::string endUseSubcategory); + bool setEndUseSubcategory(const std::string& endUseSubcategory); void resetEndUseSubcategory(); double peakFlowRate() const; diff --git a/src/model/WindowPropertyFrameAndDivider.cpp b/src/model/WindowPropertyFrameAndDivider.cpp index 0f85dc6ec1d..5133fb7018a 100644 --- a/src/model/WindowPropertyFrameAndDivider.cpp +++ b/src/model/WindowPropertyFrameAndDivider.cpp @@ -359,9 +359,9 @@ namespace model { } bool WindowPropertyFrameAndDivider_Impl::setRatioOfFrameEdgeGlassConductanceToCenterOfGlassConductance( - double ratioOfFrameEdgeGlassConductancetoCenterOfGlassConductance) { + double ratioOfFrameEdgeGlassConductanceToCenterOfGlassConductance) { bool result = setDouble(OS_WindowProperty_FrameAndDividerFields::RatioofFrameEdgeGlassConductancetoCenterOfGlassConductance, - ratioOfFrameEdgeGlassConductancetoCenterOfGlassConductance); + ratioOfFrameEdgeGlassConductanceToCenterOfGlassConductance); return result; } @@ -400,7 +400,7 @@ namespace model { OS_ASSERT(result); } - bool WindowPropertyFrameAndDivider_Impl::setDividerType(std::string dividerType) { + bool WindowPropertyFrameAndDivider_Impl::setDividerType(const std::string& dividerType) { bool result = setString(OS_WindowProperty_FrameAndDividerFields::DividerType, dividerType); return result; } @@ -420,8 +420,8 @@ namespace model { OS_ASSERT(result); } - bool WindowPropertyFrameAndDivider_Impl::setNumberOfHorizontalDividers(double numberofHorizontalDividers) { - bool result = setDouble(OS_WindowProperty_FrameAndDividerFields::NumberofHorizontalDividers, numberofHorizontalDividers); + bool WindowPropertyFrameAndDivider_Impl::setNumberOfHorizontalDividers(double numberOfHorizontalDividers) { + bool result = setDouble(OS_WindowProperty_FrameAndDividerFields::NumberofHorizontalDividers, numberOfHorizontalDividers); return result; } @@ -430,8 +430,8 @@ namespace model { OS_ASSERT(result); } - bool WindowPropertyFrameAndDivider_Impl::setNumberOfVerticalDividers(double numberofVerticalDividers) { - bool result = setDouble(OS_WindowProperty_FrameAndDividerFields::NumberofVerticalDividers, numberofVerticalDividers); + bool WindowPropertyFrameAndDivider_Impl::setNumberOfVerticalDividers(double numberOfVerticalDividers) { + bool result = setDouble(OS_WindowProperty_FrameAndDividerFields::NumberofVerticalDividers, numberOfVerticalDividers); return result; } @@ -471,9 +471,9 @@ namespace model { } bool WindowPropertyFrameAndDivider_Impl::setRatioOfDividerEdgeGlassConductanceToCenterOfGlassConductance( - double ratioofDividerEdgeGlassConductancetoCenterOfGlassConductance) { + double ratioOfDividerEdgeGlassConductanceToCenterOfGlassConductance) { bool result = setDouble(OS_WindowProperty_FrameAndDividerFields::RatioofDividerEdgeGlassConductancetoCenterOfGlassConductance, - ratioofDividerEdgeGlassConductancetoCenterOfGlassConductance); + ratioOfDividerEdgeGlassConductanceToCenterOfGlassConductance); return result; } @@ -821,9 +821,9 @@ namespace model { } bool WindowPropertyFrameAndDivider::setRatioOfFrameEdgeGlassConductanceToCenterOfGlassConductance( - double ratioOfFrameEdgeGlassConductancetoCenterOfGlassConductance) { + double ratioOfFrameEdgeGlassConductanceToCenterOfGlassConductance) { return getImpl()->setRatioOfFrameEdgeGlassConductanceToCenterOfGlassConductance( - ratioOfFrameEdgeGlassConductancetoCenterOfGlassConductance); + ratioOfFrameEdgeGlassConductanceToCenterOfGlassConductance); } void WindowPropertyFrameAndDivider::resetRatioOfFrameEdgeGlassConductanceToCenterOfGlassConductance() { @@ -854,7 +854,7 @@ namespace model { getImpl()->resetFrameThermalHemisphericalEmissivity(); } - bool WindowPropertyFrameAndDivider::setDividerType(std::string dividerType) { + bool WindowPropertyFrameAndDivider::setDividerType(const std::string& dividerType) { return getImpl()->setDividerType(dividerType); } @@ -870,16 +870,16 @@ namespace model { getImpl()->resetDividerWidth(); } - bool WindowPropertyFrameAndDivider::setNumberOfHorizontalDividers(double numberofHorizontalDividers) { - return getImpl()->setNumberOfHorizontalDividers(numberofHorizontalDividers); + bool WindowPropertyFrameAndDivider::setNumberOfHorizontalDividers(double numberOfHorizontalDividers) { + return getImpl()->setNumberOfHorizontalDividers(numberOfHorizontalDividers); } void WindowPropertyFrameAndDivider::resetNumberOfHorizontalDividers() { getImpl()->resetNumberOfHorizontalDividers(); } - bool WindowPropertyFrameAndDivider::setNumberOfVerticalDividers(double numberofVerticalDividers) { - return getImpl()->setNumberOfVerticalDividers(numberofVerticalDividers); + bool WindowPropertyFrameAndDivider::setNumberOfVerticalDividers(double numberOfVerticalDividers) { + return getImpl()->setNumberOfVerticalDividers(numberOfVerticalDividers); } void WindowPropertyFrameAndDivider::resetNumberOfVerticalDividers() { @@ -911,9 +911,9 @@ namespace model { } bool WindowPropertyFrameAndDivider::setRatioOfDividerEdgeGlassConductanceToCenterOfGlassConductance( - double ratioofDividerEdgeGlassConductancetoCenterOfGlassConductance) { + double ratioOfDividerEdgeGlassConductanceToCenterOfGlassConductance) { return getImpl()->setRatioOfDividerEdgeGlassConductanceToCenterOfGlassConductance( - ratioofDividerEdgeGlassConductancetoCenterOfGlassConductance); + ratioOfDividerEdgeGlassConductanceToCenterOfGlassConductance); } void WindowPropertyFrameAndDivider::resetRatioOfDividerEdgeGlassConductanceToCenterOfGlassConductance() { diff --git a/src/model/WindowPropertyFrameAndDivider.hpp b/src/model/WindowPropertyFrameAndDivider.hpp index 0192f6ab563..77754274aaa 100644 --- a/src/model/WindowPropertyFrameAndDivider.hpp +++ b/src/model/WindowPropertyFrameAndDivider.hpp @@ -197,7 +197,7 @@ namespace model { void resetFrameThermalHemisphericalEmissivity(); - bool setDividerType(std::string dividerType); + bool setDividerType(const std::string& dividerType); void resetDividerType(); diff --git a/src/model/WindowPropertyFrameAndDivider_Impl.hpp b/src/model/WindowPropertyFrameAndDivider_Impl.hpp index 3618164f288..c04d8c1e766 100644 --- a/src/model/WindowPropertyFrameAndDivider_Impl.hpp +++ b/src/model/WindowPropertyFrameAndDivider_Impl.hpp @@ -199,7 +199,7 @@ namespace model { void resetFrameThermalHemisphericalEmissivity(); - bool setDividerType(std::string dividerType); + bool setDividerType(const std::string& dividerType); void resetDividerType(); diff --git a/src/model/ZoneHVACEnergyRecoveryVentilatorController.cpp b/src/model/ZoneHVACEnergyRecoveryVentilatorController.cpp index 3c6fb1c986d..1135cf8b5e4 100644 --- a/src/model/ZoneHVACEnergyRecoveryVentilatorController.cpp +++ b/src/model/ZoneHVACEnergyRecoveryVentilatorController.cpp @@ -232,12 +232,12 @@ namespace model { OS_ASSERT(result); } - bool ZoneHVACEnergyRecoveryVentilatorController_Impl::setExhaustAirTemperatureLimit(std::string exhaustAirTemperatureLimit) { + bool ZoneHVACEnergyRecoveryVentilatorController_Impl::setExhaustAirTemperatureLimit(const std::string& exhaustAirTemperatureLimit) { bool result = setString(OS_ZoneHVAC_EnergyRecoveryVentilator_ControllerFields::ExhaustAirTemperatureLimit, exhaustAirTemperatureLimit); return result; } - bool ZoneHVACEnergyRecoveryVentilatorController_Impl::setExhaustAirEnthalpyLimit(std::string exhaustAirEnthalpyLimit) { + bool ZoneHVACEnergyRecoveryVentilatorController_Impl::setExhaustAirEnthalpyLimit(const std::string& exhaustAirEnthalpyLimit) { bool result = setString(OS_ZoneHVAC_EnergyRecoveryVentilator_ControllerFields::ExhaustAirEnthalpyLimit, exhaustAirEnthalpyLimit); return result; } @@ -386,11 +386,11 @@ namespace model { getImpl()->resetElectronicEnthalpyLimitCurve(); } - bool ZoneHVACEnergyRecoveryVentilatorController::setExhaustAirTemperatureLimit(std::string exhaustAirTemperatureLimit) { + bool ZoneHVACEnergyRecoveryVentilatorController::setExhaustAirTemperatureLimit(const std::string& exhaustAirTemperatureLimit) { return getImpl()->setExhaustAirTemperatureLimit(exhaustAirTemperatureLimit); } - bool ZoneHVACEnergyRecoveryVentilatorController::setExhaustAirEnthalpyLimit(std::string exhaustAirEnthalpyLimit) { + bool ZoneHVACEnergyRecoveryVentilatorController::setExhaustAirEnthalpyLimit(const std::string& exhaustAirEnthalpyLimit) { return getImpl()->setExhaustAirEnthalpyLimit(exhaustAirEnthalpyLimit); } diff --git a/src/model/ZoneHVACEnergyRecoveryVentilatorController.hpp b/src/model/ZoneHVACEnergyRecoveryVentilatorController.hpp index 36d5ead780e..0df0252dfa7 100644 --- a/src/model/ZoneHVACEnergyRecoveryVentilatorController.hpp +++ b/src/model/ZoneHVACEnergyRecoveryVentilatorController.hpp @@ -114,9 +114,9 @@ namespace model { void resetElectronicEnthalpyLimitCurve(); - bool setExhaustAirTemperatureLimit(std::string exhaustAirTemperatureLimit); + bool setExhaustAirTemperatureLimit(const std::string& exhaustAirTemperatureLimit); - bool setExhaustAirEnthalpyLimit(std::string exhaustAirEnthalpyLimit); + bool setExhaustAirEnthalpyLimit(const std::string& exhaustAirEnthalpyLimit); bool setTimeofDayEconomizerFlowControlSchedule(Schedule& schedule); diff --git a/src/model/ZoneHVACEnergyRecoveryVentilatorController_Impl.hpp b/src/model/ZoneHVACEnergyRecoveryVentilatorController_Impl.hpp index 5cc7580975c..a7aa415680f 100644 --- a/src/model/ZoneHVACEnergyRecoveryVentilatorController_Impl.hpp +++ b/src/model/ZoneHVACEnergyRecoveryVentilatorController_Impl.hpp @@ -119,9 +119,9 @@ namespace model { void resetElectronicEnthalpyLimitCurve(); - bool setExhaustAirTemperatureLimit(std::string exhaustAirTemperatureLimit); + bool setExhaustAirTemperatureLimit(const std::string& exhaustAirTemperatureLimit); - bool setExhaustAirEnthalpyLimit(std::string exhaustAirEnthalpyLimit); + bool setExhaustAirEnthalpyLimit(const std::string& exhaustAirEnthalpyLimit); bool setTimeofDayEconomizerFlowControlSchedule(Schedule& schedule); diff --git a/src/model/ZoneHVACIdealLoadsAirSystem.cpp b/src/model/ZoneHVACIdealLoadsAirSystem.cpp index 578215d054c..fade437e6e5 100644 --- a/src/model/ZoneHVACIdealLoadsAirSystem.cpp +++ b/src/model/ZoneHVACIdealLoadsAirSystem.cpp @@ -360,9 +360,9 @@ namespace model { return isEmpty(OS_ZoneHVAC_IdealLoadsAirSystemFields::LatentHeatRecoveryEffectiveness); } - bool ZoneHVACIdealLoadsAirSystem_Impl::setAvailabilitySchedule(Schedule& schedule) { - bool result = - setSchedule(OS_ZoneHVAC_IdealLoadsAirSystemFields::AvailabilityScheduleName, "ZoneHVACIdealLoadsAirSystem", "Availability", schedule); + bool ZoneHVACIdealLoadsAirSystem_Impl::setAvailabilitySchedule(Schedule& availabilitySchedule) { + bool result = setSchedule(OS_ZoneHVAC_IdealLoadsAirSystemFields::AvailabilityScheduleName, "ZoneHVACIdealLoadsAirSystem", "Availability", + availabilitySchedule); return result; } @@ -411,7 +411,7 @@ namespace model { OS_ASSERT(result); } - bool ZoneHVACIdealLoadsAirSystem_Impl::setHeatingLimit(std::string heatingLimit) { + bool ZoneHVACIdealLoadsAirSystem_Impl::setHeatingLimit(const std::string& heatingLimit) { bool result = setString(OS_ZoneHVAC_IdealLoadsAirSystemFields::HeatingLimit, heatingLimit); return result; } @@ -461,7 +461,7 @@ namespace model { OS_ASSERT(result); } - bool ZoneHVACIdealLoadsAirSystem_Impl::setCoolingLimit(std::string coolingLimit) { + bool ZoneHVACIdealLoadsAirSystem_Impl::setCoolingLimit(const std::string& coolingLimit) { bool result = setString(OS_ZoneHVAC_IdealLoadsAirSystemFields::CoolingLimit, coolingLimit); return result; } @@ -511,9 +511,9 @@ namespace model { OS_ASSERT(result); } - bool ZoneHVACIdealLoadsAirSystem_Impl::setHeatingAvailabilitySchedule(Schedule& schedule) { + bool ZoneHVACIdealLoadsAirSystem_Impl::setHeatingAvailabilitySchedule(Schedule& heatingAvailabilitySchedule) { bool result = setSchedule(OS_ZoneHVAC_IdealLoadsAirSystemFields::HeatingAvailabilityScheduleName, "ZoneHVACIdealLoadsAirSystem", - "Heating Availability", schedule); + "Heating Availability", heatingAvailabilitySchedule); return result; } @@ -522,9 +522,9 @@ namespace model { OS_ASSERT(result); } - bool ZoneHVACIdealLoadsAirSystem_Impl::setCoolingAvailabilitySchedule(Schedule& schedule) { + bool ZoneHVACIdealLoadsAirSystem_Impl::setCoolingAvailabilitySchedule(Schedule& coolingAvailabilitySchedule) { bool result = setSchedule(OS_ZoneHVAC_IdealLoadsAirSystemFields::CoolingAvailabilityScheduleName, "ZoneHVACIdealLoadsAirSystem", - "Cooling Availability", schedule); + "Cooling Availability", coolingAvailabilitySchedule); return result; } @@ -533,7 +533,7 @@ namespace model { OS_ASSERT(result); } - bool ZoneHVACIdealLoadsAirSystem_Impl::setDehumidificationControlType(std::string dehumidificationControlType) { + bool ZoneHVACIdealLoadsAirSystem_Impl::setDehumidificationControlType(const std::string& dehumidificationControlType) { bool result = setString(OS_ZoneHVAC_IdealLoadsAirSystemFields::DehumidificationControlType, dehumidificationControlType); return result; } @@ -553,7 +553,7 @@ namespace model { OS_ASSERT(result); } - bool ZoneHVACIdealLoadsAirSystem_Impl::setHumidificationControlType(std::string humidificationControlType) { + bool ZoneHVACIdealLoadsAirSystem_Impl::setHumidificationControlType(const std::string& humidificationControlType) { bool result = setString(OS_ZoneHVAC_IdealLoadsAirSystemFields::HumidificationControlType, humidificationControlType); return result; } @@ -580,7 +580,7 @@ namespace model { OS_ASSERT(result); } - bool ZoneHVACIdealLoadsAirSystem_Impl::setDemandControlledVentilationType(std::string demandControlledVentilationType) { + bool ZoneHVACIdealLoadsAirSystem_Impl::setDemandControlledVentilationType(const std::string& demandControlledVentilationType) { bool result = setString(OS_ZoneHVAC_IdealLoadsAirSystemFields::DemandControlledVentilationType, demandControlledVentilationType); return result; } @@ -590,7 +590,7 @@ namespace model { OS_ASSERT(result); } - bool ZoneHVACIdealLoadsAirSystem_Impl::setOutdoorAirEconomizerType(std::string outdoorAirEconomizerType) { + bool ZoneHVACIdealLoadsAirSystem_Impl::setOutdoorAirEconomizerType(const std::string& outdoorAirEconomizerType) { bool result = setString(OS_ZoneHVAC_IdealLoadsAirSystemFields::OutdoorAirEconomizerType, outdoorAirEconomizerType); return result; } @@ -600,7 +600,7 @@ namespace model { OS_ASSERT(result); } - bool ZoneHVACIdealLoadsAirSystem_Impl::setHeatRecoveryType(std::string heatRecoveryType) { + bool ZoneHVACIdealLoadsAirSystem_Impl::setHeatRecoveryType(const std::string& heatRecoveryType) { bool result = setString(OS_ZoneHVAC_IdealLoadsAirSystemFields::HeatRecoveryType, heatRecoveryType); return result; } @@ -1053,7 +1053,7 @@ namespace model { getImpl()->resetMinimumCoolingSupplyAirHumidityRatio(); } - bool ZoneHVACIdealLoadsAirSystem::setHeatingLimit(std::string heatingLimit) { + bool ZoneHVACIdealLoadsAirSystem::setHeatingLimit(const std::string& heatingLimit) { return getImpl()->setHeatingLimit(heatingLimit); } @@ -1085,7 +1085,7 @@ namespace model { getImpl()->autosizeMaximumSensibleHeatingCapacity(); } - bool ZoneHVACIdealLoadsAirSystem::setCoolingLimit(std::string coolingLimit) { + bool ZoneHVACIdealLoadsAirSystem::setCoolingLimit(const std::string& coolingLimit) { return getImpl()->setCoolingLimit(coolingLimit); } @@ -1133,7 +1133,7 @@ namespace model { getImpl()->resetCoolingAvailabilitySchedule(); } - bool ZoneHVACIdealLoadsAirSystem::setDehumidificationControlType(std::string dehumidificationControlType) { + bool ZoneHVACIdealLoadsAirSystem::setDehumidificationControlType(const std::string& dehumidificationControlType) { return getImpl()->setDehumidificationControlType(dehumidificationControlType); } @@ -1149,7 +1149,7 @@ namespace model { getImpl()->resetCoolingSensibleHeatRatio(); } - bool ZoneHVACIdealLoadsAirSystem::setHumidificationControlType(std::string humidificationControlType) { + bool ZoneHVACIdealLoadsAirSystem::setHumidificationControlType(const std::string& humidificationControlType) { return getImpl()->setHumidificationControlType(humidificationControlType); } @@ -1165,7 +1165,7 @@ namespace model { getImpl()->resetDesignSpecificationOutdoorAirObject(); } - bool ZoneHVACIdealLoadsAirSystem::setDemandControlledVentilationType(std::string demandControlledVentilationType) { + bool ZoneHVACIdealLoadsAirSystem::setDemandControlledVentilationType(const std::string& demandControlledVentilationType) { return getImpl()->setDemandControlledVentilationType(demandControlledVentilationType); } @@ -1173,7 +1173,7 @@ namespace model { getImpl()->resetDemandControlledVentilationType(); } - bool ZoneHVACIdealLoadsAirSystem::setOutdoorAirEconomizerType(std::string outdoorAirEconomizerType) { + bool ZoneHVACIdealLoadsAirSystem::setOutdoorAirEconomizerType(const std::string& outdoorAirEconomizerType) { return getImpl()->setOutdoorAirEconomizerType(outdoorAirEconomizerType); } @@ -1181,7 +1181,7 @@ namespace model { getImpl()->resetOutdoorAirEconomizerType(); } - bool ZoneHVACIdealLoadsAirSystem::setHeatRecoveryType(std::string heatRecoveryType) { + bool ZoneHVACIdealLoadsAirSystem::setHeatRecoveryType(const std::string& heatRecoveryType) { return getImpl()->setHeatRecoveryType(heatRecoveryType); } diff --git a/src/model/ZoneHVACIdealLoadsAirSystem.hpp b/src/model/ZoneHVACIdealLoadsAirSystem.hpp index 58f94071fd7..98859cfe437 100644 --- a/src/model/ZoneHVACIdealLoadsAirSystem.hpp +++ b/src/model/ZoneHVACIdealLoadsAirSystem.hpp @@ -183,7 +183,7 @@ namespace model { void resetMinimumCoolingSupplyAirHumidityRatio(); - bool setHeatingLimit(std::string heatingLimit); + bool setHeatingLimit(const std::string& heatingLimit); void resetHeatingLimit(); @@ -199,7 +199,7 @@ namespace model { void autosizeMaximumSensibleHeatingCapacity(); - bool setCoolingLimit(std::string coolingLimit); + bool setCoolingLimit(const std::string& coolingLimit); void resetCoolingLimit(); @@ -223,7 +223,7 @@ namespace model { void resetCoolingAvailabilitySchedule(); - bool setDehumidificationControlType(std::string dehumidificationControlType); + bool setDehumidificationControlType(const std::string& dehumidificationControlType); void resetDehumidificationControlType(); @@ -231,7 +231,7 @@ namespace model { void resetCoolingSensibleHeatRatio(); - bool setHumidificationControlType(std::string humidificationControlType); + bool setHumidificationControlType(const std::string& humidificationControlType); void resetHumidificationControlType(); @@ -239,15 +239,15 @@ namespace model { void resetDesignSpecificationOutdoorAirObject(); - bool setDemandControlledVentilationType(std::string demandControlledVentilationType); + bool setDemandControlledVentilationType(const std::string& demandControlledVentilationType); void resetDemandControlledVentilationType(); - bool setOutdoorAirEconomizerType(std::string outdoorAirEconomizerType); + bool setOutdoorAirEconomizerType(const std::string& outdoorAirEconomizerType); void resetOutdoorAirEconomizerType(); - bool setHeatRecoveryType(std::string heatRecoveryType); + bool setHeatRecoveryType(const std::string& heatRecoveryType); void resetHeatRecoveryType(); diff --git a/src/model/ZoneHVACIdealLoadsAirSystem_Impl.hpp b/src/model/ZoneHVACIdealLoadsAirSystem_Impl.hpp index 585f7e5df96..04ddf382add 100644 --- a/src/model/ZoneHVACIdealLoadsAirSystem_Impl.hpp +++ b/src/model/ZoneHVACIdealLoadsAirSystem_Impl.hpp @@ -195,7 +195,7 @@ namespace model { void resetMinimumCoolingSupplyAirHumidityRatio(); - bool setHeatingLimit(std::string heatingLimit); + bool setHeatingLimit(const std::string& heatingLimit); void resetHeatingLimit(); @@ -211,7 +211,7 @@ namespace model { void autosizeMaximumSensibleHeatingCapacity(); - bool setCoolingLimit(std::string coolingLimit); + bool setCoolingLimit(const std::string& coolingLimit); void resetCoolingLimit(); @@ -235,7 +235,7 @@ namespace model { void resetCoolingAvailabilitySchedule(); - bool setDehumidificationControlType(std::string dehumidificationControlType); + bool setDehumidificationControlType(const std::string& dehumidificationControlType); void resetDehumidificationControlType(); @@ -243,7 +243,7 @@ namespace model { void resetCoolingSensibleHeatRatio(); - bool setHumidificationControlType(std::string humidificationControlType); + bool setHumidificationControlType(const std::string& humidificationControlType); void resetHumidificationControlType(); @@ -251,15 +251,15 @@ namespace model { void resetDesignSpecificationOutdoorAirObject(); - bool setDemandControlledVentilationType(std::string demandControlledVentilationType); + bool setDemandControlledVentilationType(const std::string& demandControlledVentilationType); void resetDemandControlledVentilationType(); - bool setOutdoorAirEconomizerType(std::string outdoorAirEconomizerType); + bool setOutdoorAirEconomizerType(const std::string& outdoorAirEconomizerType); void resetOutdoorAirEconomizerType(); - bool setHeatRecoveryType(std::string heatRecoveryType); + bool setHeatRecoveryType(const std::string& heatRecoveryType); void resetHeatRecoveryType(); diff --git a/src/nano/nano_observer.hpp b/src/nano/nano_observer.hpp index 1f1de379d67..8388b61c54e 100644 --- a/src/nano/nano_observer.hpp +++ b/src/nano/nano_observer.hpp @@ -32,6 +32,7 @@ class Observer SSNode* node = head; SSNode* prev = nullptr; // Only delete the first occurrence + // cppcheck-suppress nullPointerRedundantCheck for (; node; prev = node, node = node->next) { if (node->data.delegate == key && node->data.observer == obs) { if (prev) { diff --git a/src/radiance/AnnualIlluminanceMap.cpp b/src/radiance/AnnualIlluminanceMap.cpp index e0313c1af05..7952121bad8 100644 --- a/src/radiance/AnnualIlluminanceMap.cpp +++ b/src/radiance/AnnualIlluminanceMap.cpp @@ -132,14 +132,14 @@ namespace radiance { return; } else { - MonthOfYear month = monthOfYear(lexical_cast(lineVector[0])); + MonthOfYear thisMonth = monthOfYear(lexical_cast(lineVector[0])); unsigned day = lexical_cast(lineVector[1]); double fracDays = lexical_cast(lineVector[2]) / 24.0; // ignore solar angles and global horizontal for now // make the date time - DateTime dateTime(Date(month, day), Time(fracDays)); + DateTime dateTime(Date(thisMonth, day), Time(fracDays)); // matrix we are going to read in Matrix illuminanceMap(M, N); diff --git a/src/radiance/AnnualIlluminanceMap.hpp b/src/radiance/AnnualIlluminanceMap.hpp index 12199885483..618d1452268 100644 --- a/src/radiance/AnnualIlluminanceMap.hpp +++ b/src/radiance/AnnualIlluminanceMap.hpp @@ -62,7 +62,7 @@ namespace radiance { virtual ~AnnualIlluminanceMap() {} /// get the dates and times for which illuminance maps are available - openstudio::DateTimeVector dateTimes() { + openstudio::DateTimeVector dateTimes() const { return m_dateTimes; } //openstudio::DateTime::ConstVec dateTimes() const {return openstudio::DateTime::ConstVec(m_dateTimes.begin(), m_dateTimes.end());} diff --git a/src/utilities/bcl/BCL.cpp b/src/utilities/bcl/BCL.cpp index fbcc722919c..90e863e5026 100644 --- a/src/utilities/bcl/BCL.cpp +++ b/src/utilities/bcl/BCL.cpp @@ -320,8 +320,7 @@ std::string BCLCost::referenceComponentId() const { return m_referenceComponentId; } -BCLSearchResult::BCLSearchResult(const pugi::xml_node& componentElement) { - m_componentType = componentElement.name(); +BCLSearchResult::BCLSearchResult(const pugi::xml_node& componentElement) : m_componentType{componentElement.name()} { auto uidElement = componentElement.child("uuid"); auto versionIdElement = componentElement.child("vuuid"); @@ -396,7 +395,7 @@ BCLSearchResult::BCLSearchResult(const pugi::xml_node& componentElement) { auto attributeElement = attributesElement.child("attribute"); while (attributeElement) { if (attributeElement.first_child()) { - std::string name = attributeElement.child("name").text().as_string(); + std::string att_name = attributeElement.child("name").text().as_string(); std::string value = attributeElement.child("value").text().as_string(); std::string datatype = attributeElement.child("datatype").text().as_string(); @@ -408,28 +407,28 @@ BCLSearchResult::BCLSearchResult(const pugi::xml_node& componentElement) { if (datatype == "float" && doubleValue) { if (units.empty()) { - Attribute attr(name, *doubleValue); + Attribute attr(att_name, *doubleValue); m_attributes.push_back(attr); } else { - Attribute attr(name, *doubleValue, units); + Attribute attr(att_name, *doubleValue, units); m_attributes.push_back(attr); } } else if (datatype == "int" && intValue) { if (units.empty()) { - Attribute attr(name, *intValue); + Attribute attr(att_name, *intValue); m_attributes.push_back(attr); } else { - Attribute attr(name, *intValue, units); + Attribute attr(att_name, *intValue, units); m_attributes.push_back(attr); } } // Assume string else { if (units.empty()) { - Attribute attr(name, value); + Attribute attr(att_name, value); m_attributes.push_back(attr); } else { - Attribute attr(name, value, units); + Attribute attr(att_name, value, units); m_attributes.push_back(attr); } //LOG(Error, "Error: Unrecognized attribute datatype \"" << datatype << "\""); diff --git a/src/utilities/bcl/BCLMeasure.cpp b/src/utilities/bcl/BCLMeasure.cpp index 70539fb69ba..34d3f8a0909 100644 --- a/src/utilities/bcl/BCLMeasure.cpp +++ b/src/utilities/bcl/BCLMeasure.cpp @@ -48,7 +48,7 @@ namespace openstudio { -void BCLMeasure::createDirectory(const openstudio::path& dir) const { +void BCLMeasure::createDirectory(const openstudio::path& dir) { if (exists(dir)) { if (!isEmptyDirectory(dir)) { LOG_AND_THROW("'" << toString(dir) << "' exists but is not an empty directory"); @@ -179,16 +179,19 @@ BCLMeasure::BCLMeasure(const std::string& name, const std::string& className, co } std::string licenseString; + // cppcheck-suppress knownConditionTrueFalse if (!licenseTemplate.empty()) { licenseString = ::openstudio::embedded_files::getFileAsString(licenseTemplate); } std::string readmeString; + // cppcheck-suppress knownConditionTrueFalse if (!readmeTemplate.empty()) { readmeString = ::openstudio::embedded_files::getFileAsString(readmeTemplate); } std::string docString; + // cppcheck-suppress knownConditionTrueFalse if (!docTemplate.empty()) { docString = ::openstudio::embedded_files::getFileAsString(docTemplate); } @@ -662,12 +665,12 @@ void BCLMeasure::setDescription(const std::string& description) { m_bclXML.setDescription(description); } -void BCLMeasure::setModelerDescription(const std::string& description) { - m_bclXML.setModelerDescription(description); +void BCLMeasure::setModelerDescription(const std::string& modelerDescription) { + m_bclXML.setModelerDescription(modelerDescription); } -void BCLMeasure::setArguments(const std::vector& args) { - m_bclXML.setArguments(args); +void BCLMeasure::setArguments(const std::vector& arguments) { + m_bclXML.setArguments(arguments); } void BCLMeasure::setOutputs(const std::vector& outputs) { @@ -972,10 +975,10 @@ bool BCLMeasure::checkForUpdatesFiles() { } if (!m_bclXML.hasFile(srcItemPath)) { - BCLFileReference file(srcItemPath, true); - file.setUsageType("test"); + BCLFileReference fileref(srcItemPath, true); + fileref.setUsageType("test"); result = true; - filesToAdd.push_back(file); + filesToAdd.push_back(fileref); } } } @@ -991,10 +994,10 @@ bool BCLMeasure::checkForUpdatesFiles() { } if (!m_bclXML.hasFile(srcItemPath)) { - BCLFileReference file(srcItemPath, true); - file.setUsageType("resource"); + BCLFileReference fileref(srcItemPath, true); + fileref.setUsageType("resource"); result = true; - filesToAdd.push_back(file); + filesToAdd.push_back(fileref); } } } @@ -1014,10 +1017,10 @@ bool BCLMeasure::checkForUpdatesFiles() { } if (!m_bclXML.hasFile(srcItemPath)) { - BCLFileReference file(srcItemPath, true); - file.setUsageType("doc"); + BCLFileReference fileref(srcItemPath, true); + fileref.setUsageType("doc"); result = true; - filesToAdd.push_back(file); + filesToAdd.push_back(fileref); } } } diff --git a/src/utilities/bcl/BCLMeasure.hpp b/src/utilities/bcl/BCLMeasure.hpp index 0e278f28877..157cc12afb1 100644 --- a/src/utilities/bcl/BCLMeasure.hpp +++ b/src/utilities/bcl/BCLMeasure.hpp @@ -266,11 +266,13 @@ class UTILITIES_API BCLMeasure void incrementVersionId(); /// Update's the ruby measure script to have this new information + // cppcheck-suppress functionConst bool updateMeasureScript(const MeasureType& oldMeasureType, const MeasureType& newMeasureType, const std::string& oldClassName, const std::string& newClassName, const std::string& name, const std::string& description, const std::string& modelerDescription); /// Update's the ruby measure tests to have this new information + // cppcheck-suppress functionConst bool updateMeasureTests(const std::string& oldClassName, const std::string& newClassName); /// get all measures in an input directory @@ -281,7 +283,7 @@ class UTILITIES_API BCLMeasure // configure logging REGISTER_LOGGER("utilities.bcl.BCLMeasure"); - void createDirectory(const openstudio::path& dir) const; + static void createDirectory(const openstudio::path& dir); // based on function in PathHelpers.hpp but checks if file is in this measure bool copyDirectory(const path& source, const path& destination) const; diff --git a/src/utilities/bcl/BCLMeasureArgument.cpp b/src/utilities/bcl/BCLMeasureArgument.cpp index d5f8ac1f6bb..1b64a5e6562 100644 --- a/src/utilities/bcl/BCLMeasureArgument.cpp +++ b/src/utilities/bcl/BCLMeasureArgument.cpp @@ -36,7 +36,8 @@ namespace openstudio { BCLMeasureArgument::BCLMeasureArgument(const pugi::xml_node& element) { - // todo: escape name + // TODO: escape name + // cppcheck-suppress useInitializationList m_name = element.child("name").text().as_string(); m_displayName = element.child("display_name").text().as_string(); diff --git a/src/utilities/bcl/BCLMeasureOutput.cpp b/src/utilities/bcl/BCLMeasureOutput.cpp index 0ac6963f924..23508e88a45 100644 --- a/src/utilities/bcl/BCLMeasureOutput.cpp +++ b/src/utilities/bcl/BCLMeasureOutput.cpp @@ -36,7 +36,8 @@ namespace openstudio { BCLMeasureOutput::BCLMeasureOutput(const pugi::xml_node& element) { - // todo: escape name + // TODO: escape name + // cppcheck-suppress useInitializationList m_name = element.child("name").text().as_string(); m_displayName = element.child("display_name").text().as_string(); @@ -182,10 +183,10 @@ bool BCLMeasureOutput::operator==(const BCLMeasureOutput& other) const { return true; } -std::ostream& operator<<(std::ostream& os, const BCLMeasureOutput& argument) { +std::ostream& operator<<(std::ostream& os, const BCLMeasureOutput& output) { pugi::xml_document doc; auto element = doc.append_child("Output"); - argument.writeValues(element); + output.writeValues(element); doc.save(os, " "); return os; diff --git a/src/utilities/bcl/BCLXML.cpp b/src/utilities/bcl/BCLXML.cpp index 4a2ac974ade..e8f996331f8 100644 --- a/src/utilities/bcl/BCLXML.cpp +++ b/src/utilities/bcl/BCLXML.cpp @@ -39,11 +39,11 @@ namespace openstudio { -BCLXML::BCLXML(const BCLXMLType& bclXMLType) : m_bclXMLType(bclXMLType) { - m_uid = removeBraces(openstudio::createUUID()); - m_versionId = removeBraces(openstudio::createUUID()); - m_versionModified = DateTime::nowUTC().toISO8601(); -} +BCLXML::BCLXML(const BCLXMLType& bclXMLType) + : m_bclXMLType(bclXMLType), + m_uid{removeBraces(openstudio::createUUID())}, + m_versionId{removeBraces(openstudio::createUUID())}, + m_versionModified{DateTime::nowUTC().toISO8601()} {} BCLXML::BCLXML(const openstudio::path& xmlPath) : m_path(openstudio::filesystem::system_complete(xmlPath)) { if (!openstudio::filesystem::exists(xmlPath)) { @@ -135,9 +135,7 @@ BCLXML::BCLXML(const openstudio::path& xmlPath) : m_path(openstudio::filesystem: if (m_bclXMLType == BCLXMLType::MeasureXML) { m_modelerDescription = decodeString(element.child("modeler_description").text().as_string()); - } - if (m_bclXMLType == BCLXMLType::MeasureXML) { subelement = element.child("arguments"); if (subelement) { for (auto& arg : subelement.children("argument")) { @@ -149,7 +147,7 @@ BCLXML::BCLXML(const openstudio::path& xmlPath) : m_path(openstudio::filesystem: } } - auto subelement = element.child("outputs"); + subelement = element.child("outputs"); if (subelement) { for (auto& outputElement : subelement.children("output")) { if (outputElement.first_child()) { @@ -204,7 +202,7 @@ BCLXML::BCLXML(const openstudio::path& xmlPath) : m_path(openstudio::filesystem: std::string fileName = fileElement.child("filename").text().as_string(); //std::string fileType = fileElement.firstChildElement("filetype").firstChild().nodeValue().toStdString(); std::string usageType = fileElement.child("usage_type").text().as_string(); - std::string checksum = fileElement.child("checksum").text().as_string(); + std::string checkSum = fileElement.child("checksum").text().as_string(); openstudio::path path; ; @@ -220,19 +218,19 @@ BCLXML::BCLXML(const openstudio::path& xmlPath) : m_path(openstudio::filesystem: path = m_path.parent_path() / toPath(fileName); } - BCLFileReference file(path); - file.setSoftwareProgram(softwareProgram); - file.setSoftwareProgramVersion(softwareProgramVersion); + BCLFileReference fileref(path); + fileref.setSoftwareProgram(softwareProgram); + fileref.setSoftwareProgramVersion(softwareProgramVersion); if (minCompatibleVersion) { - file.setMinCompatibleVersion(*minCompatibleVersion); + fileref.setMinCompatibleVersion(*minCompatibleVersion); } if (maxCompatibleVersion) { - file.setMaxCompatibleVersion(*maxCompatibleVersion); + fileref.setMaxCompatibleVersion(*maxCompatibleVersion); } - file.setUsageType(usageType); - file.setChecksum(checksum); + fileref.setUsageType(usageType); + fileref.setChecksum(checkSum); - m_files.push_back(file); + m_files.push_back(fileref); } else { break; @@ -469,9 +467,9 @@ void BCLXML::setDescription(const std::string& description) { m_description = escapeString(description); } -void BCLXML::setModelerDescription(const std::string& description) { +void BCLXML::setModelerDescription(const std::string& modelerDescription) { incrementVersionId(); - m_modelerDescription = escapeString(description); + m_modelerDescription = escapeString(modelerDescription); } void BCLXML::setArguments(const std::vector& arguments) { @@ -653,9 +651,7 @@ bool BCLXML::save() const { element = docElement.append_child("modeler_description"); text = element.text(); text.set(escapeString(m_modelerDescription).c_str()); - } - if (m_bclXMLType == BCLXMLType::MeasureXML) { element = docElement.append_child("arguments"); for (const BCLMeasureArgument& argument : m_arguments) { auto argumentElement = element.append_child("argument"); @@ -673,6 +669,8 @@ bool BCLXML::save() const { element = docElement.append_child("provenances"); // write tags + // provenances isn't written so element above is not used... so ignore it here + // cppcheck-suppress redundantAssignment element = docElement.append_child("tags"); for (const std::string& tag : m_tags) { auto tagElement = element.append_child("tag"); diff --git a/src/utilities/bcl/LocalBCL.cpp b/src/utilities/bcl/LocalBCL.cpp index dd4ed44e0cf..e9fb1201876 100644 --- a/src/utilities/bcl/LocalBCL.cpp +++ b/src/utilities/bcl/LocalBCL.cpp @@ -186,12 +186,12 @@ openstudio::filesystem::path LocalBCL::dbPath() const { return m_libraryPath / m_dbName; } -std::string LocalBCL::columnText(const unsigned char* column) const { +std::string LocalBCL::columnText(const unsigned char* column) { return std::string(reinterpret_cast(column)); } // http://sqlite.org/faq.html#q14 -std::string LocalBCL::escape(const std::string& s) const { +std::string LocalBCL::escape(const std::string& s) { return boost::replace_all_copy(s, "'", "''"); } @@ -363,7 +363,7 @@ bool LocalBCL::updateLocalDb() { if (sqlite3_step(sqlStmtPtr) == SQLITE_ROW) { std::string oauthConsumerKey = columnText(sqlite3_column_text(sqlStmtPtr, 0)); - std::string localDbVersion = columnText(sqlite3_column_text(sqlStmtPtr, 1)); + localDbVersion = columnText(sqlite3_column_text(sqlStmtPtr, 1)); sqlite3_finalize(sqlStmtPtr); // If already latest version, do nothing @@ -396,12 +396,12 @@ bool LocalBCL::updateLocalDb() { // Insertion block { - sqlite3_stmt* sqlStmtPtr = nullptr; + sqlite3_stmt* sqlInsertStmtPtr = nullptr; // 1=name, 2=value std::string insert_statement = "INSERT INTO Settings VALUES (?, ?)"; - if (sqlite3_prepare_v2(m_db, insert_statement.c_str(), insert_statement.size(), &sqlStmtPtr, nullptr) != SQLITE_OK) { + if (sqlite3_prepare_v2(m_db, insert_statement.c_str(), insert_statement.size(), &sqlInsertStmtPtr, nullptr) != SQLITE_OK) { LOG(Error, "Error preparing insert statement"); - sqlite3_finalize(sqlStmtPtr); // No-op + sqlite3_finalize(sqlInsertStmtPtr); // No-op rollbackTransaction(); return false; } @@ -415,26 +415,26 @@ bool LocalBCL::updateLocalDb() { bool errorsFound = false; for (const auto& p : vals) { - if (sqlite3_bind_text(sqlStmtPtr, 1, p.first.c_str(), p.first.size(), SQLITE_TRANSIENT) != SQLITE_OK) { + if (sqlite3_bind_text(sqlInsertStmtPtr, 1, p.first.c_str(), p.first.size(), SQLITE_TRANSIENT) != SQLITE_OK) { LOG(Error, "Error binding to the 1st parameter: " << p.first); errorsFound = true; - } else if (sqlite3_bind_text(sqlStmtPtr, 2, p.second.c_str(), p.second.size(), SQLITE_TRANSIENT) != SQLITE_OK) { + } else if (sqlite3_bind_text(sqlInsertStmtPtr, 2, p.second.c_str(), p.second.size(), SQLITE_TRANSIENT) != SQLITE_OK) { LOG(Error, "Error binding to the 2nd parameter: " << p.second); errorsFound = true; - } else if (sqlite3_step(sqlStmtPtr) != SQLITE_DONE) { + } else if (sqlite3_step(sqlInsertStmtPtr) != SQLITE_DONE) { LOG(Error, "Error executing prepared statement"); errorsFound = true; } if (errorsFound) { // Rollback changes - sqlite3_finalize(sqlStmtPtr); // No-op + sqlite3_finalize(sqlInsertStmtPtr); // No-op rollbackTransaction(); return false; } // Reset the statement to allow binding variables on the next iteration - sqlite3_reset(sqlStmtPtr); + sqlite3_reset(sqlInsertStmtPtr); } sqlite3_finalize(sqlStmtPtr); @@ -1016,6 +1016,7 @@ std::vector LocalBCL::searchMeasures(const std::string& searchTerm, /// Class members +// cppcheck-suppress constParameter bool LocalBCL::addComponent(BCLComponent& component) { //Check for uid if (m_db && !component.uid().empty() && !component.versionId().empty()) { @@ -1036,18 +1037,20 @@ bool LocalBCL::addComponent(BCLComponent& component) { return false; } - std::stringstream ss; - ss << "INSERT INTO Components (uid, version_id, name, description, date_added, date_modified) " - << "VALUES('" << escape(uid) << "', '" << escape(versionId) << "', '" << escape(component.name()) << "', '" << escape(component.description()) - << "', datetime('now','localtime'), datetime('now','localtime'));"; + { + std::stringstream ss; + ss << "INSERT INTO Components (uid, version_id, name, description, date_added, date_modified) " + << "VALUES('" << escape(uid) << "', '" << escape(versionId) << "', '" << escape(component.name()) << "', '" + << escape(component.description()) << "', datetime('now','localtime'), datetime('now','localtime'));"; - statement = ss.str(); + statement = ss.str(); - if (sqlite3_exec(m_db, statement.c_str(), nullptr, nullptr, nullptr) != SQLITE_OK) { - // Rollback changes - LOG(Error, "addComponent: statement failed, rolling back: " << statement); - rollbackTransaction(); - return false; + if (sqlite3_exec(m_db, statement.c_str(), nullptr, nullptr, nullptr) != SQLITE_OK) { + // Rollback changes + LOG(Error, "addComponent: statement failed, rolling back: " << statement); + rollbackTransaction(); + return false; + } } // Insert files @@ -1126,6 +1129,7 @@ bool LocalBCL::addComponent(BCLComponent& component) { return false; } +// cppcheck-suppress constParameter bool LocalBCL::removeComponent(BCLComponent& component) { // if uid is empty or not found in database return false if (!m_db || component.uid().empty() || component.versionId().empty()) { @@ -1197,6 +1201,7 @@ bool LocalBCL::removeComponent(BCLComponent& component) { return true; } +// cppcheck-suppress constParameter bool LocalBCL::addMeasure(BCLMeasure& measure) { // if uid is empty or not found in database return false @@ -1220,21 +1225,22 @@ bool LocalBCL::addMeasure(BCLMeasure& measure) { return false; } - std::stringstream ss; - ss << "INSERT INTO Measures (uid, version_id, name, description, modeler_description, date_added, date_modified) " - << "VALUES('" << escape(uid) << "', '" << escape(versionId) << "', '" << escape(measure.name()) << "', '" << escape(measure.description()) - << "', '" << escape(measure.description()) << "'" - << ", datetime('now','localtime'), datetime('now','localtime'));"; + { + std::stringstream ss; + ss << "INSERT INTO Measures (uid, version_id, name, description, modeler_description, date_added, date_modified) " + << "VALUES('" << escape(uid) << "', '" << escape(versionId) << "', '" << escape(measure.name()) << "', '" << escape(measure.description()) + << "', '" << escape(measure.description()) << "'" + << ", datetime('now','localtime'), datetime('now','localtime'));"; - statement = ss.str(); + statement = ss.str(); - if (sqlite3_exec(m_db, statement.c_str(), nullptr, nullptr, nullptr) != SQLITE_OK) { - // Rollback changes - LOG(Error, "addMeasure: statement failed, rolling back: " << statement); - rollbackTransaction(); - return false; + if (sqlite3_exec(m_db, statement.c_str(), nullptr, nullptr, nullptr) != SQLITE_OK) { + // Rollback changes + LOG(Error, "addMeasure: statement failed, rolling back: " << statement); + rollbackTransaction(); + return false; + } } - // Insert files statement = "DELETE FROM Files WHERE uid='" + escape(uid) + "' AND version_id='" + escape(versionId) + "'"; if (sqlite3_exec(m_db, statement.c_str(), nullptr, nullptr, nullptr) != SQLITE_OK) { @@ -1305,6 +1311,7 @@ bool LocalBCL::addMeasure(BCLMeasure& measure) { return commitTransaction(); } +// cppcheck-suppress constParameter bool LocalBCL::removeMeasure(BCLMeasure& measure) { // if uid is empty if (!m_db || measure.uid().empty() || measure.versionId().empty()) { @@ -1553,13 +1560,13 @@ std::string LocalBCL::prodAuthKey() const { return m_prodAuthKey; } -bool LocalBCL::setProdAuthKey(const std::string& authKey) { +bool LocalBCL::setProdAuthKey(const std::string& prodAuthKey) { if (!m_db) { return false; } RemoteBCL remoteBCL; - if (!remoteBCL.setProdAuthKey(authKey)) { + if (!remoteBCL.setProdAuthKey(prodAuthKey)) { LOG(Error, "prodAuthKey was rejected by RemoteBCL."); return false; } @@ -1571,7 +1578,7 @@ bool LocalBCL::setProdAuthKey(const std::string& authKey) { return false; } - std::string statement = "UPDATE Settings SET data='" + escape(authKey) + "' WHERE name='prodAuthKey'"; + std::string statement = "UPDATE Settings SET data='" + escape(prodAuthKey) + "' WHERE name='prodAuthKey'"; if (sqlite3_exec(m_db, statement.c_str(), nullptr, nullptr, nullptr) != SQLITE_OK) { // Rollback changes LOG(Error, "Cannot update prodAuthKey, rolling back."); @@ -1581,7 +1588,7 @@ bool LocalBCL::setProdAuthKey(const std::string& authKey) { bool result = commitTransaction(); if (result) { // Store key - m_prodAuthKey = authKey; + m_prodAuthKey = prodAuthKey; } return result; } @@ -1590,7 +1597,7 @@ std::string LocalBCL::devAuthKey() const { return m_devAuthKey; } -bool LocalBCL::setDevAuthKey(const std::string& authKey) { +bool LocalBCL::setDevAuthKey(const std::string& devAuthKey) { if (!m_db) { return false; @@ -1598,12 +1605,12 @@ bool LocalBCL::setDevAuthKey(const std::string& authKey) { RemoteBCL remoteBCL; - if (!remoteBCL.setDevAuthKey(authKey)) { + if (!remoteBCL.setDevAuthKey(devAuthKey)) { LOG(Error, "devAuthKey was rejected by RemoteBCL."); return false; } // Store key - m_devAuthKey = authKey; + m_devAuthKey = devAuthKey; //Overwrite devAuthKey in database // Start a transaction, so we can handle failures without messing up the database @@ -1611,7 +1618,7 @@ bool LocalBCL::setDevAuthKey(const std::string& authKey) { return false; } - std::string statement = "UPDATE Settings SET data='" + escape(authKey) + "' WHERE name='devAuthKey'"; + std::string statement = "UPDATE Settings SET data='" + escape(devAuthKey) + "' WHERE name='devAuthKey'"; if (sqlite3_exec(m_db, statement.c_str(), nullptr, nullptr, nullptr) != SQLITE_OK) { // Rollback changes LOG(Error, "Cannot update devAuthKey, rolling back.") @@ -1621,7 +1628,7 @@ bool LocalBCL::setDevAuthKey(const std::string& authKey) { bool result = commitTransaction(); if (result) { // Store key - m_devAuthKey = authKey; + m_devAuthKey = devAuthKey; } return result; } diff --git a/src/utilities/bcl/LocalBCL.hpp b/src/utilities/bcl/LocalBCL.hpp index c4edc35cf0e..17ca74bc04f 100644 --- a/src/utilities/bcl/LocalBCL.hpp +++ b/src/utilities/bcl/LocalBCL.hpp @@ -110,12 +110,15 @@ class UTILITIES_API LocalBCL : public BCL bool addComponent(BCLComponent& component); /// Remove a component from the local library and delete its directory + // cppcheck-suppress constParameter bool removeComponent(BCLComponent& component); /// Add a measure to the local library + // cppcheck-suppress constParameter bool addMeasure(BCLMeasure& measure); /// Remove a measure from the local library and delete its directory + // cppcheck-suppress constParameter bool removeMeasure(BCLMeasure& measure); /// Search for components with attributes matching those in searchTerms @@ -161,12 +164,12 @@ class UTILITIES_API LocalBCL : public BCL bool validateProdAuthKey(const std::string& authKey); bool validateDevAuthKey(const std::string& authKey); - std::string escape(const std::string& s) const; + static std::string escape(const std::string& s); std::set> attributeSearch(const std::vector>& searchTerms, const std::string& componentType) const; - std::string formatString(double d, unsigned prec = 15); + static std::string formatString(double d, unsigned prec = 15); static std::shared_ptr& instanceInternal(); @@ -185,7 +188,7 @@ class UTILITIES_API LocalBCL : public BCL std::string m_sqliteFilename; // Helper function to retrieve a string - std::string columnText(const unsigned char* column) const; + static std::string columnText(const unsigned char* column); // Begins a transaction, checking for return code. If failed, does nothing but logs and returns false bool beginTransaction(); diff --git a/src/utilities/bcl/RemoteBCL.cpp b/src/utilities/bcl/RemoteBCL.cpp index 156647632f1..67ca7228a99 100644 --- a/src/utilities/bcl/RemoteBCL.cpp +++ b/src/utilities/bcl/RemoteBCL.cpp @@ -57,7 +57,7 @@ pugi::xml_node RemoteQueryResponse::root() const { // TODO: please note that you should use getClient everywhere after instead of instantiating your own http_client_config // as it will allow us to change http_client_config (SSL settings etc) in only one place -web::http::client::http_client RemoteBCL::getClient(const std::string& url) const { +web::http::client::http_client RemoteBCL::getClient(const std::string& url) { web::http::client::http_client_config config; // bcl.nrel.gov can be slow to respond to client requests so bump the default of 30 seconds to 60 to account for lengthy response time. // this is timeout is for each send and receive operation on the client and not the entire client session. @@ -91,12 +91,14 @@ void RemoteBCL::DownloadFile::write(const std::vector& data) { m_ofs.write(reinterpret_cast(data.data()), data.size()); } -RemoteBCL::RemoteBCL() : m_numResultsPerQuery(10), m_apiVersion("2.0") { - m_prodAuthKey = LocalBCL::instance().prodAuthKey(); - m_devAuthKey = LocalBCL::instance().devAuthKey(); - validProdAuthKey = false; - validDevAuthKey = false; - +RemoteBCL::RemoteBCL() + : m_prodAuthKey(LocalBCL::instance().prodAuthKey()), + m_devAuthKey(LocalBCL::instance().devAuthKey()), + m_numResultsPerQuery(10), + m_lastTotalResults(0), + m_apiVersion("2.0"), + validProdAuthKey(false), + validDevAuthKey(false) { useRemoteProductionUrl(); } @@ -330,7 +332,7 @@ void RemoteBCL::updateMeasures() { /// Blocking class members /////////////////////////////////////////////////////////////////////////// -bool RemoteBCL::isOnline() const { +bool RemoteBCL::isOnline() { try { auto ip = getClient("https://checkip.amazonaws.com/") .request(web::http::methods::GET) @@ -376,11 +378,11 @@ std::string RemoteBCL::remoteUrl() const { return m_remoteUrl; } -std::string RemoteBCL::remoteProductionUrl() const { +std::string RemoteBCL::remoteProductionUrl() { return std::string(REMOTE_PRODUCTION_SERVER); } -std::string RemoteBCL::remoteDevelopmentUrl() const { +std::string RemoteBCL::remoteDevelopmentUrl() { return std::string(REMOTE_DEVELOPMENT_SERVER); } @@ -813,7 +815,7 @@ boost::optional RemoteBCL::processReply(const std::string& return boost::none; } -boost::optional RemoteBCL::processMetaSearchResponse(const RemoteQueryResponse& remoteQueryResponse) const { +boost::optional RemoteBCL::processMetaSearchResponse(const RemoteQueryResponse& remoteQueryResponse) { auto root = remoteQueryResponse.root(); if (root) { @@ -828,7 +830,7 @@ boost::optional RemoteBCL::processMetaSearchResponse(const return boost::none; } -std::vector RemoteBCL::processSearchResponse(const RemoteQueryResponse& remoteQueryResponse) const { +std::vector RemoteBCL::processSearchResponse(const RemoteQueryResponse& remoteQueryResponse) { std::vector searchResults; auto root = remoteQueryResponse.root(); @@ -890,6 +892,7 @@ void RemoteBCL::onDownloadComplete() { } if (xmlPath) { + // cppcheck-suppress shadowVariable path src = xmlPath->parent_path(); path dest = src.parent_path(); openstudio::filesystem::remove(dest / toPath("DISCLAIMER.txt")); diff --git a/src/utilities/bcl/RemoteBCL.hpp b/src/utilities/bcl/RemoteBCL.hpp index ead95fc4224..a64b4961d97 100644 --- a/src/utilities/bcl/RemoteBCL.hpp +++ b/src/utilities/bcl/RemoteBCL.hpp @@ -125,7 +125,7 @@ class UTILITIES_API RemoteBCL : public BCL //@{ /// Returns true if there is an internet connection - bool isOnline() const; + static bool isOnline(); /// Returns the last downloaded component if there is one boost::optional lastComponentDownload() const; @@ -143,10 +143,10 @@ class UTILITIES_API RemoteBCL : public BCL std::string remoteUrl() const; /// Get the remote production url - std::string remoteProductionUrl() const; + static std::string remoteProductionUrl(); /// Get the remote development url - std::string remoteDevelopmentUrl() const; + static std::string remoteDevelopmentUrl(); /// Use the development production server url void useRemoteDevelopmentUrl(); @@ -237,9 +237,9 @@ class UTILITIES_API RemoteBCL : public BCL boost::optional processReply(const std::string& reply); - boost::optional processMetaSearchResponse(const RemoteQueryResponse& remoteQueryResponse) const; + static boost::optional processMetaSearchResponse(const RemoteQueryResponse& remoteQueryResponse); - std::vector processSearchResponse(const RemoteQueryResponse& remoteQueryResponse) const; + static std::vector processSearchResponse(const RemoteQueryResponse& remoteQueryResponse); void onDownloadComplete(); @@ -250,7 +250,7 @@ class UTILITIES_API RemoteBCL : public BCL // members // A helper function to prepare a client, allowing us to change the http_client_config in one place only - web::http::client::http_client getClient(const std::string& url) const; + static web::http::client::http_client getClient(const std::string& url); boost::optional> m_httpResponse; diff --git a/src/utilities/core/Compare.cpp b/src/utilities/core/Compare.cpp index 365f612b013..9caa0c5fee5 100644 --- a/src/utilities/core/Compare.cpp +++ b/src/utilities/core/Compare.cpp @@ -288,7 +288,7 @@ bool VersionString::isNextVersion(const VersionString& nextVersionCandidate) con // now major.minor.patch v. major.minor or major.minor.patch v. major.minor.0 // strip out patch numbers - + // cppcheck-suppress duplicateCondition if (variantOnThis.patch()) { variantOnThis = VersionString(variantOnThis.major(), variantOnThis.minor()); } diff --git a/src/utilities/core/Compare.hpp b/src/utilities/core/Compare.hpp index 01f770c4829..d54dc4b00c7 100644 --- a/src/utilities/core/Compare.hpp +++ b/src/utilities/core/Compare.hpp @@ -171,7 +171,7 @@ class UTILITIES_API VersionString bool isNextVersion(const VersionString& nextVersionCandidate) const; private: - bool parseVersionString(const std::string& str); + bool parseVersionString(const std::string& version); std::string m_str; int m_major; int m_minor; diff --git a/src/utilities/core/FileLogSink.cpp b/src/utilities/core/FileLogSink.cpp index 1a0d1de2f57..795864b7e4e 100644 --- a/src/utilities/core/FileLogSink.cpp +++ b/src/utilities/core/FileLogSink.cpp @@ -38,8 +38,8 @@ namespace openstudio { namespace detail { - FileLogSink_Impl::FileLogSink_Impl(const openstudio::path& path) : m_path(path) { - m_ofs = boost::shared_ptr(new openstudio::filesystem::ofstream(path)); + FileLogSink_Impl::FileLogSink_Impl(const openstudio::path& path) + : m_path{path}, m_ofs{boost::shared_ptr(new openstudio::filesystem::ofstream(path))} { this->setStream(m_ofs); this->enable(); } diff --git a/src/utilities/core/FilesystemHelpers.hpp b/src/utilities/core/FilesystemHelpers.hpp index 1fa6ca1d63e..ccc6f91e790 100644 --- a/src/utilities/core/FilesystemHelpers.hpp +++ b/src/utilities/core/FilesystemHelpers.hpp @@ -36,7 +36,7 @@ namespace openstudio { namespace filesystem { /// reads entire file from the current read position until the end of file /// and returns as std::vector - UTILITIES_API std::vector read(openstudio::filesystem::ifstream& t_path); + UTILITIES_API std::vector read(openstudio::filesystem::ifstream& t_file); /// reads entire file from the current read position until the end of file /// and returns as std::vector @@ -71,7 +71,7 @@ namespace filesystem { /// "/systemtemppath/{base_name}-id" /// where `id` is unique identifier determined by the runtime. /// \returns path created or empty path if creation failed - UTILITIES_API openstudio::path create_temporary_directory(const openstudio::path& base_name); + UTILITIES_API openstudio::path create_temporary_directory(const openstudio::path& basename); /// Returns the current user's home path UTILITIES_API openstudio::path home_path(); diff --git a/src/utilities/core/LogMessage.hpp b/src/utilities/core/LogMessage.hpp index 27cbca626a8..5b18f3dbfd9 100644 --- a/src/utilities/core/LogMessage.hpp +++ b/src/utilities/core/LogMessage.hpp @@ -74,7 +74,7 @@ class UTILITIES_API LogMessage { public: /// constructor - LogMessage(LogLevel logLevel, const std::string& channel, const std::string& message); + LogMessage(LogLevel logLevel, const std::string& logChannel, const std::string& logMessage); /// parse logText and get log messages static std::vector parseLogText(const std::string& logText); diff --git a/src/utilities/core/LogSink.cpp b/src/utilities/core/LogSink.cpp index e94cb9f4a55..2d3b51b1d7b 100644 --- a/src/utilities/core/LogSink.cpp +++ b/src/utilities/core/LogSink.cpp @@ -43,9 +43,7 @@ namespace openstudio { namespace detail { - LogSink_Impl::LogSink_Impl() : m_mutex{}, m_threadId{} { - m_sink = boost::shared_ptr(new LogSinkBackend()); - } + LogSink_Impl::LogSink_Impl() : m_mutex{}, m_threadId{}, m_sink{boost::shared_ptr(new LogSinkBackend())} {} LogSink_Impl::~LogSink_Impl() {} diff --git a/src/utilities/core/LogSink.hpp b/src/utilities/core/LogSink.hpp index 6a97a09e77f..a1ddd663d26 100644 --- a/src/utilities/core/LogSink.hpp +++ b/src/utilities/core/LogSink.hpp @@ -72,10 +72,10 @@ class UTILITIES_API LogSink boost::optional channelRegex() const; /// set the regular expression to match log channels - void setChannelRegex(const boost::regex& filter); + void setChannelRegex(const boost::regex& channelRegex); /// set the regular expression to match log channels - void setChannelRegex(const std::string& filter); + void setChannelRegex(const std::string& channelRegex); /// reset the regular expression to match log channels void resetChannelRegex(); diff --git a/src/utilities/core/LogSink_Impl.hpp b/src/utilities/core/LogSink_Impl.hpp index 82f8904949f..7c7bbfb3eb6 100644 --- a/src/utilities/core/LogSink_Impl.hpp +++ b/src/utilities/core/LogSink_Impl.hpp @@ -72,10 +72,10 @@ namespace detail { boost::optional channelRegex() const; /// set the regular expression to match log channels - void setChannelRegex(const boost::regex& filter); + void setChannelRegex(const boost::regex& channelRegex); /// set the regular expression to match log channels - void setChannelRegex(const std::string& filter); + void setChannelRegex(const std::string& channelRegex); /// reset the regular expression to match log channels void resetChannelRegex(); @@ -114,7 +114,7 @@ namespace detail { boost::optional m_logLevel; boost::optional m_channelRegex; - bool m_autoFlush; + bool m_autoFlush = false; std::thread::id m_threadId; boost::shared_ptr m_sink; }; diff --git a/src/utilities/core/Path.cpp b/src/utilities/core/Path.cpp index 0430443b692..f99ceab9fe7 100644 --- a/src/utilities/core/Path.cpp +++ b/src/utilities/core/Path.cpp @@ -66,6 +66,7 @@ std::string toString(const path& p) { return s; #endif + // cppcheck-suppress duplicateBreak return p.generic_string(); } diff --git a/src/utilities/core/String.cpp b/src/utilities/core/String.cpp index 15e69d87b72..657a62004af 100644 --- a/src/utilities/core/String.cpp +++ b/src/utilities/core/String.cpp @@ -90,14 +90,14 @@ std::string toString(std::istream& s) { /// Hence these ifdef workarounds https://stackoverflow.com/questions/32055357/visual-studio-c-2015-stdcodecvt-with-char16-t-or-char32-t /// -std::wstring toWString(const std::string& q) { +std::wstring toWString(const std::string& s) { #if _MSC_VER >= 1900 std::wstring_convert, wchar_t> convert; - const auto u16_conv = convert.from_bytes(q); + const auto u16_conv = convert.from_bytes(s); return {u16_conv.begin(), u16_conv.end()}; #else std::wstring_convert, char16_t> convert; - const auto u16_conv = convert.from_bytes(q); + const auto u16_conv = convert.from_bytes(s); return {u16_conv.begin(), u16_conv.end()}; #endif } diff --git a/src/utilities/core/String.hpp b/src/utilities/core/String.hpp index f96e20357ab..41f6df4d2a7 100644 --- a/src/utilities/core/String.hpp +++ b/src/utilities/core/String.hpp @@ -49,7 +49,7 @@ UTILITIES_API std::string toString(const std::string& s); UTILITIES_API std::string toString(const char* s); /** wstring to std::string. */ -UTILITIES_API std::string toString(const std::wstring& w); +UTILITIES_API std::string toString(const std::wstring& utf16_string); /** string to std::wstring. */ UTILITIES_API std::wstring toWString(const std::string& s); diff --git a/src/utilities/core/StringHelpers.hpp b/src/utilities/core/StringHelpers.hpp index b937d3c306d..971c6102403 100644 --- a/src/utilities/core/StringHelpers.hpp +++ b/src/utilities/core/StringHelpers.hpp @@ -150,7 +150,7 @@ namespace string_conversions { UTILITIES_API std::string number(std::uint32_t, int base = 10); UTILITIES_API std::string number(std::int64_t, int base = 10); UTILITIES_API std::string number(std::uint64_t, int base = 10); - UTILITIES_API std::string number(double, FloatFormat format = FloatFormat::general, int presision = 6); + UTILITIES_API std::string number(double, FloatFormat format = FloatFormat::general, int precision = 6); template boost::optional to_no_throw(const InputType& inp) { diff --git a/src/utilities/core/System.cpp b/src/utilities/core/System.cpp index ef1b7c54db9..bc81c379a4e 100644 --- a/src/utilities/core/System.cpp +++ b/src/utilities/core/System.cpp @@ -77,6 +77,7 @@ void System::msleep(int msecs) { while (remainingtime > 0) { // TODO: QT-Separation-Move //bool didwork = openstudio::Application::instance().processEvents(remainingtime); + // cppcheck-suppress variableScope bool didwork = false; remainingtime = msecs - (int)(boost::posix_time::microsec_clock::universal_time() - start).total_milliseconds(); // std::cout << "time " << msecs << " remainingtime " << remainingtime << std::endl; @@ -84,6 +85,7 @@ void System::msleep(int msecs) { int timetosleep = 0; if (remainingtime > 0) { + // cppcheck-suppress knownConditionTrueFalse if (didwork) { timetosleep = 1; // it was working, let it keep processing after a yield } else { diff --git a/src/utilities/core/test/ApplicationPathHelpers_GTest.cpp b/src/utilities/core/test/ApplicationPathHelpers_GTest.cpp index f5da6d00580..3b2f8b87dd5 100644 --- a/src/utilities/core/test/ApplicationPathHelpers_GTest.cpp +++ b/src/utilities/core/test/ApplicationPathHelpers_GTest.cpp @@ -49,10 +49,9 @@ // A wrapper to implement setenv on Windows like on Unix, using _putenv internally int setenv(const char* name, const char* value, int overwrite) { - int errcode = 0; if (!overwrite) { size_t envsize = 0; - errcode = getenv_s(&envsize, NULL, 0, name); + int errcode = getenv_s(&envsize, NULL, 0, name); if (errcode || envsize) return errcode; } return _putenv_s(name, value); @@ -136,6 +135,7 @@ TEST(ApplicationPathHelpers, findInSystemPath) { // From PathHelpers too. Ensure that completeAndNormalize keeps resolving symlinks until found TEST(ApplicationPathHelpers, completeAndNormalizeMultipleSymlinks) { + // cppcheck-suppress knownConditionTrueFalse if (!IsElevated()) { SKIP(completeAndNormalizeMultipleSymlinks); } @@ -188,7 +188,7 @@ TEST(ApplicationPathHelpers, completeAndNormalizeMultipleSymlinks) { symlink_path = path_subdir / toPath("5.symlink_relative_pardir"); pointsTo = toPath("..") / prev_path.filename(); boost::filesystem::create_symlink(pointsTo, symlink_path); - prev_path = symlink_path; + // prev_path = symlink_path; toClean.push_back(symlink_path); openstudio::path foundPath = completeAndNormalize(symlink_path); diff --git a/src/utilities/core/test/Finder_GTest.cpp b/src/utilities/core/test/Finder_GTest.cpp index 246a4afcbca..985f343f0d5 100644 --- a/src/utilities/core/test/Finder_GTest.cpp +++ b/src/utilities/core/test/Finder_GTest.cpp @@ -82,6 +82,7 @@ TEST(Finder, NameFinder_Ptr) { NameFinder finder("Billy"); // not found + // cppcheck-suppress knownEmptyContainer VectorType::const_iterator it = find_if(haystack.begin(), haystack.end(), finder); EXPECT_TRUE(haystack.end() == it); @@ -143,6 +144,7 @@ TEST(Finder, NameFinder_POD) { NameFinder finder("Billy"); // not found + // cppcheck-suppress knownEmptyContainer VectorType::const_iterator it = find_if(haystack.begin(), haystack.end(), finder); EXPECT_TRUE(haystack.end() == it); diff --git a/src/utilities/core/test/Logger_GTest.cpp b/src/utilities/core/test/Logger_GTest.cpp index aeaaf42b118..650109b6814 100644 --- a/src/utilities/core/test/Logger_GTest.cpp +++ b/src/utilities/core/test/Logger_GTest.cpp @@ -101,6 +101,7 @@ void classLogging() { g.logError(); } +// cppcheck-suppress syntaxError TEST(LoggerTest, LogLevel_Formatting) { std::stringstream ss; diff --git a/src/utilities/core/test/Optional_GTest.cpp b/src/utilities/core/test/Optional_GTest.cpp index 2a2acb9f1f7..9e6499bc3e6 100644 --- a/src/utilities/core/test/Optional_GTest.cpp +++ b/src/utilities/core/test/Optional_GTest.cpp @@ -70,6 +70,7 @@ TEST(OptionalTest, builtInTypes) { EXPECT_EQ(2.0, d2); } +// cppcheck-suppress syntaxError TEST(OptionalTest, stdTypes) { std::stringstream ss; diff --git a/src/utilities/core/test/System_GTest.cpp b/src/utilities/core/test/System_GTest.cpp index f606c88b180..14633822299 100644 --- a/src/utilities/core/test/System_GTest.cpp +++ b/src/utilities/core/test/System_GTest.cpp @@ -36,6 +36,7 @@ using openstudio::Time; TEST(System, IdleTime) { // system idle time should not be unset for platforms it is implemented on + // cppcheck-suppress unreadVariable boost::optional