GCC Code Coverage Report


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

src/model/Generator.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_GENERATOR_HPP
7 #define MODEL_GENERATOR_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ParentObject.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class ElectricLoadCenterDistribution;
16
17 namespace detail {
18 class Generator_Impl;
19 }
20
21 /** Generator is the base class for generators. The ratedElectricPowerOutput, availabilitySchedule, and
22 * ratedThermaltoElectricalPowerRatio fields are mapped to fields in the ElectricLoadCenter:Generators object
23 * in EnergyPlus. The ElectricLoadCenter:Generators object does not exist in OpenStudio.
24 */
25 class MODEL_API Generator : public ParentObject
26 {
27
28 public:
29 Generator(IddObjectType type, const Model& model);
30
31 336 virtual ~Generator() override = default;
32 // Default the copy and move operators because the virtual dtor is explicit
33 79 Generator(const Generator& other) = default;
34 95 Generator(Generator&& other) = default;
35 ✗ Generator& operator=(const Generator&) = default;
36 ✗ Generator& operator=(Generator&&) = default;
37
38 std::string generatorObjectType() const;
39
40 boost::optional<double> ratedElectricPowerOutput() const;
41
42 boost::optional<Schedule> availabilitySchedule() const;
43
44 boost::optional<double> ratedThermaltoElectricalPowerRatio() const;
45
46 boost::optional<ElectricLoadCenterDistribution> electricLoadCenterDistribution() const;
47
48 protected:
49 friend class Model;
50 friend class openstudio::IdfObject;
51 friend class openstudio::detail::IdfObject_Impl;
52 friend class detail::Generator_Impl;
53
54 /// @cond
55
56 using ImplType = detail::Generator_Impl;
57
58 explicit Generator(std::shared_ptr<detail::Generator_Impl> impl);
59
60 private:
61 REGISTER_LOGGER("openstudio.model.Generator");
62
63 /// @endcond
64 };
65
66 using OptionalGenerator = boost::optional<Generator>;
67
68 using GeneratorVector = std::vector<Generator>;
69
70 } // namespace model
71 } // namespace openstudio
72
73 #endif // MODEL_GENERATOR_HPP
74