GCC Code Coverage Report


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

src/model/MeterCustomDecrement_Impl.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_IMPL_HPP
7 #define MODEL_METERCUSTOMDECREMENT_IMPL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ModelObject_Impl.hpp"
11
12 namespace openstudio {
13
14 class FuelType;
15
16 namespace model {
17
18 namespace detail {
19
20 /** MeterCustomDecrement_Impl is a ModelObject_Impl that is the implementation class for MeterCustomDecrement.*/
21 class MODEL_API MeterCustomDecrement_Impl : public ModelObject_Impl
22 {
23
24 public:
25 /** @name Constructors and Destructors */
26 //@{
27
28 // constructor
29 MeterCustomDecrement_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
30
31 // construct from workspace
32 MeterCustomDecrement_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
33
34 // clone copy constructor
35 MeterCustomDecrement_Impl(const MeterCustomDecrement_Impl& other, Model_Impl* model, bool keepHandle);
36
37 // virtual destructor
38 8 virtual ~MeterCustomDecrement_Impl() override = default;
39
40 //@}
41 /** @name Virtual Methods */
42 //@{
43
44 virtual const std::vector<std::string>& outputVariableNames() const override;
45
46 virtual IddObjectType iddObjectType() const override;
47
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
75 void resetFuelType();
76
77 bool setSourceMeterName(const std::string& sourceMeterName);
78
79 // Add a new (Key, Var) group
80 bool addKeyVarGroup(const std::string& keyName, const std::string& outputVariableorMeterName);
81
82 // Remove the (Key, Var) group at given index
83 bool removeKeyVarGroup(unsigned groupIndex);
84
85 // Remove all the (Key, Var) groups
86 void removeAllKeyVarGroups();
87
88 // Lower level functions
89 /** Set the Key Name at index. Indexing starts at 0. */
90 bool setKeyName(unsigned index, const std::string& str);
91
92 /** Set the Output Variable of Meter Name at index. Indexing starts at 0. */
93 bool setOutputVariableorMeterName(unsigned index, const std::string& str);
94
95 //@}
96 /** @name Other */
97 //@{
98
99 //@}
100 /** @name Type Casting */
101 //@{
102
103 //@}
104 protected:
105 private:
106 REGISTER_LOGGER("openstudio.model.MeterCustomDecrement");
107 };
108
109 } // namespace detail
110
111 } // namespace model
112 } // namespace openstudio
113
114 #endif // MODEL_METERCUSTOMDECREMENT_IMPL_HPP
115