GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 72.5% 29 / 0 / 40
Functions: 81.2% 13 / 0 / 16
Branches: 50.0% 12 / 0 / 24

src/model/OutputControlTimestamp.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 "OutputControlTimestamp.hpp"
7 #include "OutputControlTimestamp_Impl.hpp"
8
9 #include "Model.hpp"
10 #include "Model_Impl.hpp"
11
12 #include <utilities/idd/IddFactory.hxx>
13 #include <utilities/idd/IddEnums.hxx>
14 #include <utilities/idd/OS_OutputControl_Timestamp_FieldEnums.hxx>
15
16 #include "../utilities/core/Assert.hpp"
17
18 namespace openstudio {
19 namespace model {
20
21 namespace detail {
22
23 5 OutputControlTimestamp_Impl::OutputControlTimestamp_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
24 5 : ModelObject_Impl(idfObject, model, keepHandle) {
25
4/6
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 5 times.
✗ Branch 13 not taken.
5 OS_ASSERT(idfObject.iddObject().type() == OutputControlTimestamp::iddObjectType());
26 5 }
27
28 ✗ OutputControlTimestamp_Impl::OutputControlTimestamp_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model,
29 ✗ bool keepHandle)
30 ✗ : ModelObject_Impl(other, model, keepHandle) {
31 ✗ OS_ASSERT(other.iddObject().type() == OutputControlTimestamp::iddObjectType());
32 ✗ }
33
34 4 OutputControlTimestamp_Impl::OutputControlTimestamp_Impl(const OutputControlTimestamp_Impl& other, Model_Impl* model, bool keepHandle)
35 4 : ModelObject_Impl(other, model, keepHandle) {}
36
37 ✗ const std::vector<std::string>& OutputControlTimestamp_Impl::outputVariableNames() const {
38 ✗ static std::vector<std::string> result;
39 ✗ if (result.empty()) {
40 }
41 ✗ return result;
42 }
43
44 ✗ IddObjectType OutputControlTimestamp_Impl::iddObjectType() const {
45 ✗ return OutputControlTimestamp::iddObjectType();
46 }
47
48 7 bool OutputControlTimestamp_Impl::iso8601Format() const {
49 7 return getBooleanFieldValue(OS_OutputControl_TimestampFields::ISO8601Format);
50 }
51
52 7 bool OutputControlTimestamp_Impl::timestampAtBeginningOfInterval() const {
53 7 return getBooleanFieldValue(OS_OutputControl_TimestampFields::TimestampatBeginningofInterval);
54 }
55
56 11 bool OutputControlTimestamp_Impl::setISO8601Format(bool iso8601Format) {
57 11 return setBooleanFieldValue(OS_OutputControl_TimestampFields::ISO8601Format, iso8601Format);
58 }
59
60 11 bool OutputControlTimestamp_Impl::setTimestampAtBeginningOfInterval(bool timestampAtBeginningOfInterval) {
61 11 return setBooleanFieldValue(OS_OutputControl_TimestampFields::TimestampatBeginningofInterval, timestampAtBeginningOfInterval);
62 }
63
64 } // namespace detail
65
66 7750 IddObjectType OutputControlTimestamp::iddObjectType() {
67
1/1
✓ Branch 1 taken 7750 times.
7750 return IddObjectType(IddObjectType::OS_OutputControl_Timestamp);
68 }
69
70 7 bool OutputControlTimestamp::iso8601Format() const {
71
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::OutputControlTimestamp_Impl>()->iso8601Format();
72 }
73
74 7 bool OutputControlTimestamp::timestampAtBeginningOfInterval() const {
75
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::OutputControlTimestamp_Impl>()->timestampAtBeginningOfInterval();
76 }
77
78 11 bool OutputControlTimestamp::setISO8601Format(bool iso8601Format) {
79
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::OutputControlTimestamp_Impl>()->setISO8601Format(iso8601Format);
80 }
81
82 11 bool OutputControlTimestamp::setTimestampAtBeginningOfInterval(bool timestampAtBeginningOfInterval) {
83
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::OutputControlTimestamp_Impl>()->setTimestampAtBeginningOfInterval(timestampAtBeginningOfInterval);
84 }
85
86 /// @cond
87
1/1
✓ Branch 3 taken 8 times.
8 OutputControlTimestamp::OutputControlTimestamp(std::shared_ptr<detail::OutputControlTimestamp_Impl> impl) : ModelObject(std::move(impl)) {}
88 5 OutputControlTimestamp::OutputControlTimestamp(Model& model) : ModelObject(OutputControlTimestamp::iddObjectType(), model) {
89 // This is a required-field, so pick one...
90 // Same defaults as EnergyPlus IDD
91
1/1
✓ Branch 1 taken 5 times.
5 setISO8601Format(false);
92
1/1
✓ Branch 1 taken 5 times.
5 setTimestampAtBeginningOfInterval(false);
93 5 }
94
95 /// @endcond
96
97 } // namespace model
98 } // namespace openstudio
99