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