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/MeterCustom_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_METERCUSTOM_IMPL_HPP
7 #define MODEL_METERCUSTOM_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 /** MeterCustom_Impl is a ModelObject_Impl that is the implementation class for MeterCustom.*/
21 class MODEL_API MeterCustom_Impl : public ModelObject_Impl
22 {
23
24 public:
25 /** @name Constructors and Destructors */
26 //@{
27
28 // constructor
29 MeterCustom_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
30
31 // construct from workspace
32 MeterCustom_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
33
34 // clone copy constructor
35 MeterCustom_Impl(const MeterCustom_Impl& other, Model_Impl* model, bool keepHandle);
36
37 // virtual destructor
38 8 virtual ~MeterCustom_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 // 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
73 void resetFuelType();
74
75 // Add a new (Key, Var) group
76 bool addKeyVarGroup(const std::string& keyName, const std::string& outputVariableorMeterName);
77
78 // Remove the (Key, Var) group at given index
79 bool removeKeyVarGroup(unsigned groupIndex);
80
81 // Remove all the (Key, Var) groups
82 void removeAllKeyVarGroups();
83
84 // Lower level functions
85 /** Set the Key Name at index. Indexing starts at 0. */
86 bool setKeyName(unsigned index, const std::string& str);
87
88 /** Set the Output Variable of Meter Name at index. Indexing starts at 0. */
89 bool setOutputVariableorMeterName(unsigned index, const std::string& str);
90
91 //@}
92 /** @name Other */
93 //@{
94
95 //@}
96 /** @name Type Casting */
97 //@{
98
99 //@}
100 protected:
101 private:
102 REGISTER_LOGGER("openstudio.model.MeterCustom");
103 };
104
105 } // namespace detail
106
107 } // namespace model
108 } // namespace openstudio
109
110 #endif // MODEL_METERCUSTOM_IMPL_HPP
111