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/MeterCustom.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_METERCUSTOM_HPP
7 #define MODEL_METERCUSTOM_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ModelObject.hpp"
11
12 //#include <memory>
13
14 namespace openstudio {
15
16 class FuelType;
17
18 namespace model {
19
20 namespace detail {
21
22 class MeterCustom_Impl;
23
24 } // namespace detail
25
26 /** MeterCustom is a ModelObject that wraps the OpenStudio IDD object 'OS:Meter:Custom'. */
27 class MODEL_API MeterCustom : public ModelObject
28 {
29 public:
30 /** @name Constructors and Destructors */
31 //@{
32
33 // Constructs a new MeterCustom object in the model.
34 explicit MeterCustom(const Model& model);
35
36 4 virtual ~MeterCustom() override = default;
37 // Default the copy and move operators because the virtual dtor is explicit
38 ✗ MeterCustom(const MeterCustom& other) = default;
39 1 MeterCustom(MeterCustom&& other) = default;
40 ✗ MeterCustom& operator=(const MeterCustom&) = default;
41 ✗ MeterCustom& operator=(MeterCustom&&) = default;
42
43 //@}
44
45 static IddObjectType iddObjectType();
46
47 static std::vector<std::string> fuelTypeValues();
48
49 /** @name Getters */
50 //@{
51
52 boost::optional<std::string> fuelType() const;
53
54 // Return a vector of (Key, Var) pairs
55 std::vector<std::pair<std::string, std::string>> keyVarGroups();
56
57 // Return the number of (KeyName, OutputVariableorMeterName) groups
58 unsigned numKeyVarGroups() const;
59
60 // Lower Level functions
61 /** Get the Key Name at index. Indexing starts at 0. */
62 boost::optional<std::string> keyName(unsigned index) const;
63
64 /** Get the Output Variable of Meter Name at index. Indexing starts at 0. */
65 boost::optional<std::string> outputVariableorMeterName(unsigned index) const;
66
67 //@}
68 /** @name Setters */
69 //@{
70
71 bool setFuelType(const FuelType& fuelType);
72 bool setFuelType(const std::string& fuelType);
73
74 void resetFuelType();
75
76 // Add a new (Key, Var) group
77 bool addKeyVarGroup(const std::string& keyName, const std::string& outputVariableorMeterName);
78
79 // Remove the (Key, Var) group at given index
80 bool removeKeyVarGroup(unsigned groupIndex);
81
82 // Remove all the (Key, Var) groups
83 void removeAllKeyVarGroups();
84
85 // Lower level functions
86 /** Set the Key Name at index. Indexing starts at 0. */
87 bool setKeyName(unsigned index, const std::string& str);
88
89 /** Set the Output Variable of Meter Name at index. Indexing starts at 0. */
90 bool setOutputVariableorMeterName(unsigned index, const std::string& str);
91
92 //@}
93 /** @name Other */
94 //@{
95
96 //@}
97 /** @name Type Casting */
98 //@{
99
100 //@}
101 protected:
102 /// @cond
103 using ImplType = detail::MeterCustom_Impl;
104
105 explicit MeterCustom(std::shared_ptr<detail::MeterCustom_Impl> impl);
106
107 friend class detail::MeterCustom_Impl;
108 friend class Model;
109 friend class IdfObject;
110 friend class openstudio::detail::IdfObject_Impl;
111 /// @endcond
112 private:
113 std::shared_ptr<detail::MeterCustom_Impl> m_impl;
114
115 − REGISTER_LOGGER("openstudio.model.MeterCustom");
116 };
117
118 /** \relates MeterCustom*/
119 using OptionalMeterCustom = boost::optional<MeterCustom>;
120
121 /** \relates MeterCustom*/
122 using MeterCustomVector = std::vector<MeterCustom>;
123
124 } // namespace model
125 } // namespace openstudio
126
127 #endif // MODEL_METERCUSTOM_HPP
128