GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 66.1% 39 / 0 / 59
Functions: 63.2% 12 / 0 / 19
Branches: 31.3% 21 / 0 / 67

src/model/OutsideSurfaceConvectionAlgorithm.cpp
Line Branch Exec Source
1 /***********************************************************************************************************************
2 * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
3 * See also https://openstudio.net/license
4 ***********************************************************************************************************************/
5
6 #include "OutsideSurfaceConvectionAlgorithm.hpp"
7 #include "OutsideSurfaceConvectionAlgorithm_Impl.hpp"
8 #include "SimulationControl.hpp"
9 #include "SimulationControl_Impl.hpp"
10 #include "Model.hpp"
11 #include "Model_Impl.hpp"
12
13 #include <utilities/idd/IddFactory.hxx>
14
15 #include <utilities/idd/OS_SurfaceConvectionAlgorithm_Outside_FieldEnums.hxx>
16 #include <utilities/idd/IddEnums.hxx>
17
18 #include "../utilities/core/Assert.hpp"
19
20 namespace openstudio {
21 namespace model {
22
23 namespace detail {
24
25 212 OutsideSurfaceConvectionAlgorithm_Impl::OutsideSurfaceConvectionAlgorithm_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
26 212 : ModelObject_Impl(idfObject, model, keepHandle) {
27
4/6
✓ Branch 1 taken 212 times.
✓ Branch 4 taken 212 times.
✓ Branch 7 taken 212 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 212 times.
✗ Branch 13 not taken.
212 OS_ASSERT(idfObject.iddObject().type() == OutsideSurfaceConvectionAlgorithm::iddObjectType());
28 212 }
29
30 40 OutsideSurfaceConvectionAlgorithm_Impl::OutsideSurfaceConvectionAlgorithm_Impl(const openstudio::detail::WorkspaceObject_Impl& other,
31 40 Model_Impl* model, bool keepHandle)
32 40 : ModelObject_Impl(other, model, keepHandle) {
33
4/6
✓ Branch 1 taken 40 times.
✓ Branch 4 taken 40 times.
✓ Branch 7 taken 40 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 40 times.
✗ Branch 13 not taken.
40 OS_ASSERT(other.iddObject().type() == OutsideSurfaceConvectionAlgorithm::iddObjectType());
34 40 }
35
36 107 OutsideSurfaceConvectionAlgorithm_Impl::OutsideSurfaceConvectionAlgorithm_Impl(const OutsideSurfaceConvectionAlgorithm_Impl& other,
37 107 Model_Impl* model, bool keepHandle)
38 107 : ModelObject_Impl(other, model, keepHandle) {}
39
40 // return the parent object in the hierarchy
41 ✗ boost::optional<ParentObject> OutsideSurfaceConvectionAlgorithm_Impl::parent() const {
42 ✗ boost::optional<ParentObject> result(model().getUniqueModelObject<SimulationControl>());
43 ✗ return result;
44 }
45
46 // set the parent, child may have to call methods on the parent
47 ✗ bool OutsideSurfaceConvectionAlgorithm_Impl::setParent(ParentObject& newParent) {
48 ✗ if (newParent.optionalCast<SimulationControl>() && (newParent.model() == model())) {
49 ✗ return true;
50 }
51 ✗ return false;
52 }
53
54 // Get all output variable names that could be associated with this object.
55 1 const std::vector<std::string>& OutsideSurfaceConvectionAlgorithm_Impl::outputVariableNames() const {
56
2/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
1 static const std::vector<std::string> result;
57 1 return result;
58 }
59
60 1 IddObjectType OutsideSurfaceConvectionAlgorithm_Impl::iddObjectType() const {
61 1 return OutsideSurfaceConvectionAlgorithm::iddObjectType();
62 }
63
64 44 std::string OutsideSurfaceConvectionAlgorithm_Impl::algorithm() const {
65
1/1
✓ Branch 1 taken 44 times.
44 boost::optional<std::string> value = getString(OS_SurfaceConvectionAlgorithm_OutsideFields::Algorithm, true);
66
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 44 times.
✗ Branch 4 not taken.
44 OS_ASSERT(value);
67
2/2
✓ Branch 1 taken 44 times.
✓ Branch 4 taken 44 times.
88 return value.get();
68 44 }
69
70 ✗ bool OutsideSurfaceConvectionAlgorithm_Impl::isAlgorithmDefaulted() const {
71 ✗ return isEmpty(OS_SurfaceConvectionAlgorithm_OutsideFields::Algorithm);
72 }
73
74 171 bool OutsideSurfaceConvectionAlgorithm_Impl::setAlgorithm(const std::string& algorithm) {
75 171 bool result = setString(OS_SurfaceConvectionAlgorithm_OutsideFields::Algorithm, algorithm);
76 171 return result;
77 }
78
79 ✗ void OutsideSurfaceConvectionAlgorithm_Impl::resetAlgorithm() {
80 ✗ bool result = setString(OS_SurfaceConvectionAlgorithm_OutsideFields::Algorithm, "");
81 ✗ OS_ASSERT(result);
82 ✗ }
83
84 } // namespace detail
85
86 /// constructor
87 171 OutsideSurfaceConvectionAlgorithm::OutsideSurfaceConvectionAlgorithm(const Model& model)
88 171 : ModelObject(OutsideSurfaceConvectionAlgorithm::iddObjectType(), model) {
89
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 171 times.
✗ Branch 5 not taken.
171 OS_ASSERT(getImpl<detail::OutsideSurfaceConvectionAlgorithm_Impl>());
90
91
2/2
✓ Branch 1 taken 171 times.
✓ Branch 4 taken 171 times.
171 setAlgorithm("DOE-2");
92 171 }
93
94 // constructor
95 103 OutsideSurfaceConvectionAlgorithm::OutsideSurfaceConvectionAlgorithm(std::shared_ptr<detail::OutsideSurfaceConvectionAlgorithm_Impl> impl)
96
1/1
✓ Branch 3 taken 103 times.
103 : ModelObject(std::move(impl)) {}
97
98 9078 IddObjectType OutsideSurfaceConvectionAlgorithm::iddObjectType() {
99
1/1
✓ Branch 1 taken 9078 times.
9078 IddObjectType result(IddObjectType::OS_SurfaceConvectionAlgorithm_Outside);
100 9078 return result;
101 }
102
103 ✗ std::vector<std::string> OutsideSurfaceConvectionAlgorithm::validAlgorithmValues() {
104 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_SurfaceConvectionAlgorithm_OutsideFields::Algorithm);
105 }
106
107 44 std::string OutsideSurfaceConvectionAlgorithm::algorithm() const {
108
1/1
✓ Branch 3 taken 44 times.
44 return getImpl<detail::OutsideSurfaceConvectionAlgorithm_Impl>()->algorithm();
109 }
110
111 ✗ bool OutsideSurfaceConvectionAlgorithm::isAlgorithmDefaulted() const {
112 ✗ return getImpl<detail::OutsideSurfaceConvectionAlgorithm_Impl>()->isAlgorithmDefaulted();
113 }
114
115 171 bool OutsideSurfaceConvectionAlgorithm::setAlgorithm(const std::string& algorithm) {
116
1/1
✓ Branch 3 taken 171 times.
171 return getImpl<detail::OutsideSurfaceConvectionAlgorithm_Impl>()->setAlgorithm(algorithm);
117 }
118
119 ✗ void OutsideSurfaceConvectionAlgorithm::resetAlgorithm() {
120 ✗ getImpl<detail::OutsideSurfaceConvectionAlgorithm_Impl>()->resetAlgorithm();
121 ✗ }
122
123 } // namespace model
124 } // namespace openstudio
125