GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 40.0% 2 / 1 / 6
Functions: 40.0% 2 / 1 / 6
Branches: -% 0 / 1 / 1

src/model/OutputTableMonthly.hpp
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 #ifndef MODEL_OUTPUTTABLEMONTHLY_HPP
7 #define MODEL_OUTPUTTABLEMONTHLY_HPP
8
9 #include <model/ModelAPI.hpp>
10 #include "ModelObject.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 namespace detail {
16
17 class OutputTableMonthly_Impl;
18
19 } // namespace detail
20
21 class MODEL_API MonthlyVariableGroup
22 {
23 public:
24 MonthlyVariableGroup(std::string variableOrMeterName, std::string aggregationType = "SumOrAverage");
25
26 std::string variableOrMeterName() const;
27 std::string aggregationType() const;
28
29 bool isAggregationTypeAdvanced() const;
30
31 bool operator==(const MonthlyVariableGroup& other) const;
32 bool operator!=(const MonthlyVariableGroup& other) const;
33
34 private:
35 std::string m_variableOrMeterName;
36 std::string m_aggregationType;
37 − REGISTER_LOGGER("openstudio.model.MonthlyVariableGroup");
38 };
39
40 // Overload operator<<
41 MODEL_API std::ostream& operator<<(std::ostream& out, const openstudio::model::MonthlyVariableGroup& monthlyVariableGroup);
42
43 /** OutputTableMonthly is a ModelObject that wraps the OpenStudio IDD object 'OS:Output:Table:Monthly'. */
44 class MODEL_API OutputTableMonthly : public ModelObject
45 {
46 public:
47 /** @name Constructors and Destructors */
48 //@{
49
50 explicit OutputTableMonthly(const Model& model);
51
52 306 virtual ~OutputTableMonthly() override = default;
53 // Default the copy and move operators because the virtual dtor is explicit
54 ✗ OutputTableMonthly(const OutputTableMonthly& other) = default;
55 60 OutputTableMonthly(OutputTableMonthly&& other) = default;
56 ✗ OutputTableMonthly& operator=(const OutputTableMonthly&) = default;
57 ✗ OutputTableMonthly& operator=(OutputTableMonthly&&) = default;
58
59 //@}
60
61 static IddObjectType iddObjectType();
62
63 static std::vector<std::string> aggregationTypeValues();
64 static std::vector<std::string> validAggregationTypes();
65 static bool isAggregationTypeValid(const std::string& aggregationType);
66 static bool isAggregationTypeAdvanced(const std::string& aggregationType);
67 static const std::vector<std::string>& advancedAggregationTypes();
68
69 /// Factory method to create a OutputTableMonthly by looking up characteristics in the embedded database (from E+ datasets/StandardReports.idf)
70 /// by its name.
71 /// Please use the OutputTableMonthly::validStandardReportNames() static method to look up the valid names
72 // as it will throw if it cannot find it
73 static OutputTableMonthly fromStandardReports(const Model& model, const std::string& standardReportName);
74 static const std::vector<std::string>& validStandardReportNames();
75
76 /** @name Getters */
77 //@{
78
79 int digitsAfterDecimal() const;
80
81 //@}
82 /** @name Setters */
83 //@{
84
85 bool setDigitsAfterDecimal(int digitsAfterDecimal);
86
87 //@}
88 /** @name Other */
89 //@{
90
91 // Handle this object's extensible fields.
92
93 std::vector<MonthlyVariableGroup> monthlyVariableGroups() const;
94
95 unsigned int numberofMonthlyVariableGroups() const;
96
97 boost::optional<unsigned> monthlyVariableGroupIndex(const MonthlyVariableGroup& monthlyVariableGroup) const;
98 boost::optional<MonthlyVariableGroup> getMonthlyVariableGroup(unsigned groupIndex) const;
99
100 bool addMonthlyVariableGroup(const MonthlyVariableGroup& monthlyVariableGroup);
101
102 // Convenience fucntion that will create a MonthlyVariableGroup
103 bool addMonthlyVariableGroup(std::string variableOrMeterName, std::string aggregationType = "SumOrAverage");
104
105 bool addMonthlyVariableGroups(const std::vector<MonthlyVariableGroup>& monthlyVariableGroups);
106 bool removeMonthlyVariableGroup(unsigned groupIndex);
107 void removeAllMonthlyVariableGroups();
108
109 //@}
110 protected:
111 /// @cond
112 using ImplType = detail::OutputTableMonthly_Impl;
113
114 explicit OutputTableMonthly(std::shared_ptr<detail::OutputTableMonthly_Impl> impl);
115
116 friend class detail::OutputTableMonthly_Impl;
117 friend class Model;
118 friend class IdfObject;
119 friend class openstudio::detail::IdfObject_Impl;
120 /// @endcond
121 private:
122 REGISTER_LOGGER("openstudio.model.OutputTableMonthly");
123 };
124
125 /** \relates OutputTableMonthly*/
126 using OptionalOutputTableMonthly = boost::optional<OutputTableMonthly>;
127
128 /** \relates OutputTableMonthly*/
129 using OutputTableMonthlyVector = std::vector<OutputTableMonthly>;
130
131 } // namespace model
132 } // namespace openstudio
133
134 #endif // MODEL_OUTPUTTABLEMONTHLY_HPP
135