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/ScheduleInterval.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_SCHEDULEINTERVAL_HPP
7 #define MODEL_SCHEDULEINTERVAL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "Schedule.hpp"
11
12 namespace openstudio {
13
14 class TimeSeries;
15
16 namespace model {
17
18 namespace detail {
19 class ScheduleInterval_Impl;
20 } // namespace detail
21
22 /** ScheduleInterval is a Schedule that serves as an abstract base class for ScheduleFixedInterval
23 * and ScheduleVariableInterval. ScheduleIntervals may be constructed from TimeSeries, and can return
24 * their values as TimeSeries. */
25 class MODEL_API ScheduleInterval : public Schedule
26 {
27 public:
28 /** @name Constructors and Destructors */
29 //@{
30
31 252 virtual ~ScheduleInterval() override = default;
32 // Default the copy and move operators because the virtual dtor is explicit
33 33 ScheduleInterval(const ScheduleInterval& other) = default;
34 100 ScheduleInterval(ScheduleInterval&& other) = default;
35 ✗ ScheduleInterval& operator=(const ScheduleInterval&) = default;
36 ✗ ScheduleInterval& operator=(ScheduleInterval&&) = default;
37
38 //@}
39
40 static boost::optional<ScheduleInterval> fromTimeSeries(const openstudio::TimeSeries& timeSeries, Model& model);
41
42 /** @name Getters */
43 //@{
44
45 openstudio::TimeSeries timeSeries() const;
46
47 //@}
48 /** @name Setters */
49 //@{
50
51 bool setTimeSeries(const openstudio::TimeSeries& timeSeries);
52
53 //@}
54 protected:
55 using ImplType = detail::ScheduleInterval_Impl;
56
57 friend class Model;
58 friend class openstudio::IdfObject;
59
60 ScheduleInterval(IddObjectType type, const Model& model);
61
62 // constructor
63 explicit ScheduleInterval(std::shared_ptr<detail::ScheduleInterval_Impl> impl);
64
65 private:
66 REGISTER_LOGGER("openstudio.model.ScheduleInterval");
67 };
68
69 /** \relates ScheduleInterval */
70 using OptionalScheduleInterval = boost::optional<ScheduleInterval>;
71
72 /** \relates ScheduleInterval */
73 using ScheduleIntervalVector = std::vector<ScheduleInterval>;
74
75 } // namespace model
76 } // namespace openstudio
77
78 #endif // MODEL_SCHEDULEINTERVAL_HPP
79