GCC Code Coverage Report


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

src/model/ScheduleYear_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_SCHEDULEYEAR_IMPL_HPP
7 #define MODEL_SCHEDULEYEAR_IMPL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "Schedule_Impl.hpp"
11
12 namespace openstudio {
13
14 class Date;
15
16 namespace model {
17
18 class ScheduleWeek;
19
20 namespace detail {
21
22 /** ScheduleYear_Impl is a Schedule_Impl that is the implementation class for ScheduleYear.*/
23 class MODEL_API ScheduleYear_Impl : public Schedule_Impl
24 {
25 public:
26 /** @name Constructors and Destructors */
27 //@{
28
29 ScheduleYear_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
30
31 ScheduleYear_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
32
33 ScheduleYear_Impl(const ScheduleYear_Impl& other, Model_Impl* model, bool keepHandle);
34
35 746 virtual ~ScheduleYear_Impl() override = default;
36
37 //@}
38 /** @name Virtual Methods */
39 //@{
40
41 virtual const std::vector<std::string>& outputVariableNames() const override;
42
43 virtual IddObjectType iddObjectType() const override;
44
45 virtual boost::optional<ScheduleTypeLimits> scheduleTypeLimits() const override;
46
47 /** Returns empty vector, because individual ScheduleDay objects will check values() against
48 * bounds. */
49 virtual std::vector<double> values() const override;
50
51 virtual bool setScheduleTypeLimits(const ScheduleTypeLimits& scheduleTypeLimits) override;
52
53 virtual bool resetScheduleTypeLimits() override;
54
55 //@}
56 /** @name Getters */
57 //@{
58
59 /// Returns a vector of dates marking the end of week schedules.
60 /// These dates will be in order and have the same number of elements as scheduleWeeks.
61 // DLM@20111018: This almost needs a RunPeriod as an argument to know the year description?
62 std::vector<openstudio::Date> dates() const;
63
64 /// Returns a vector of week schedules in the same order and with the same number of elements as dates.
65 std::vector<ScheduleWeek> scheduleWeeks() const;
66
67 virtual std::vector<EMSActuatorNames> emsActuatorNames() const override;
68
69 virtual std::vector<std::string> emsInternalVariableNames() const override;
70
71 //@}
72 /** @name Setters */
73 //@{
74
75 /// Sets the given week schedule to be in effect until (inclusive) the date given starting the day after the
76 /// previous date marker or January 1st if no previous date marker exists. Replaces existing scheduleWeek
77 /// for same date if it exists.
78 bool addScheduleWeek(const openstudio::Date& untilDate, const ScheduleWeek& scheduleWeek);
79
80 /// Clear all week schedules from this schedule.
81 void clearScheduleWeeks();
82
83 // ensure that this object does not contain the date 2/29
84 virtual void ensureNoLeapDays() override;
85
86 //@}
87 /** @name Other */
88 //@{
89
90 /// Returns the week schedule in effect at the given date.
91 // DLM@20111018: Eventually allow "Nth day in Month" and other descriptors
92 boost::optional<ScheduleWeek> getScheduleWeek(const openstudio::Date& date) const;
93
94 //@}
95 protected:
96 private:
97 − REGISTER_LOGGER("openstudio.model.ScheduleYear");
98 };
99
100 } // namespace detail
101
102 } // namespace model
103 } // namespace openstudio
104
105 #endif // MODEL_SCHEDULEYEAR_IMPL_HPP
106