GCC Code Coverage Report


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

src/model/LifeCycleCost_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_LIFECYCLECOST_IMPL_HPP
7 #define MODEL_LIFECYCLECOST_IMPL_HPP
8
9 #include "ParentObject_Impl.hpp"
10 #include "LifeCycleCost.hpp"
11
12 #include "../utilities/core/Optional.hpp"
13
14 namespace openstudio {
15 namespace model {
16
17 class SpaceLoadDefinition;
18
19 namespace detail {
20
21 class MODEL_API LifeCycleCost_Impl : public ModelObject_Impl
22 {
23
24 public:
25 // constructor
26 LifeCycleCost_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
27
28 // construct from workspace
29 LifeCycleCost_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
30
31 // clone copy constructor
32 LifeCycleCost_Impl(const LifeCycleCost_Impl& other, Model_Impl* model, bool keepHandle);
33
34 // virtual destructor
35 85 virtual ~LifeCycleCost_Impl() override = default;
36
37 ✗ virtual IddObjectType iddObjectType() const override {
38 ✗ return LifeCycleCost::iddObjectType();
39 }
40
41 virtual const std::vector<std::string>& outputVariableNames() const override;
42
43 /** @name Getters */
44 //@{
45
46 std::string category() const;
47
48 std::string itemType() const;
49
50 ModelObject item() const;
51
52 double cost() const;
53
54 std::vector<std::string> validCostUnitsValues() const;
55
56 std::string costUnits() const;
57
58 std::string startOfCosts() const;
59 bool isStartOfCostsDefaulted() const;
60
61 int yearsFromStart() const;
62 bool isYearsFromStartDefaulted() const;
63 int monthsFromStart() const;
64 bool isMonthsFromStartDefaulted() const;
65
66 int repeatPeriodYears() const;
67 bool isRepeatPeriodYearsDefaulted() const;
68 int repeatPeriodMonths() const;
69 bool isRepeatPeriodMonthsDefaulted() const;
70
71 //@}
72 /** @name Setters */
73 //@{
74
75 bool setCategory(const std::string& category);
76
77 bool setCost(double cost);
78
79 bool setCostUnits(const std::string& costUnits);
80
81 bool setStartOfCosts(const std::string& startOfCosts);
82 void resetStartOfCosts();
83
84 bool setYearsFromStart(int yearsFromStart);
85 void resetYearsFromStart();
86 bool setMonthsFromStart(int monthsFromStart);
87 void resetMonthsFromStart();
88
89 bool setRepeatPeriodYears(int repeatPeriodYears);
90 void resetRepeatPeriodYears();
91 bool setRepeatPeriodMonths(int repeatPeriodMonths);
92 void resetRepeatPeriodMonths();
93
94 //@}
95
96 double totalCost() const;
97
98 bool convertToCostPerEach();
99
100 boost::optional<int> costedQuantity() const;
101
102 boost::optional<double> costedArea() const;
103
104 boost::optional<int> costedThermalZones() const;
105
106 private:
107 REGISTER_LOGGER("openstudio.model.LifeCycleCost");
108
109 //double getArea(const SpaceLoadInstance& spaceLoadInstance) const;
110 //double getArea(const SpaceLoadDefinition& spaceLoadDefinition) const;
111 };
112
113 } // namespace detail
114 } // namespace model
115 } // namespace openstudio
116
117 #endif // MODEL_LIFECYCLECOST_IMPL_HPP
118