src/model/RunPeriodControlDaylightSavingTime_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_RUNPERIODCONTROLDAYLIGHTSAVINGTIME_IMPL_HPP | ||
| 7 | #define MODEL_RUNPERIODCONTROLDAYLIGHTSAVINGTIME_IMPL_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ModelObject_Impl.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | |||
| 14 | class Date; | ||
| 15 | class MonthOfYear; | ||
| 16 | class NthDayOfWeekInMonth; | ||
| 17 | class DayOfWeek; | ||
| 18 | |||
| 19 | namespace model { | ||
| 20 | |||
| 21 | namespace detail { | ||
| 22 | |||
| 23 | /** RunPeriodControlDaylightSavingTime_Impl is a ModelObject_Impl that is the implementation class for RunPeriodControlDaylightSavingTime.*/ | ||
| 24 | class MODEL_API RunPeriodControlDaylightSavingTime_Impl : public ModelObject_Impl | ||
| 25 | { | ||
| 26 | public: | ||
| 27 | /** @name Constructors and Destructors */ | ||
| 28 | //@{ | ||
| 29 | |||
| 30 | RunPeriodControlDaylightSavingTime_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle); | ||
| 31 | |||
| 32 | RunPeriodControlDaylightSavingTime_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 33 | |||
| 34 | RunPeriodControlDaylightSavingTime_Impl(const RunPeriodControlDaylightSavingTime_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 35 | |||
| 36 | 43 | virtual ~RunPeriodControlDaylightSavingTime_Impl() override = default; | |
| 37 | |||
| 38 | //@} | ||
| 39 | |||
| 40 | virtual boost::optional<ParentObject> parent() const override; | ||
| 41 | |||
| 42 | virtual bool setParent(ParentObject& newParent) override; | ||
| 43 | |||
| 44 | virtual const std::vector<std::string>& outputVariableNames() const override; | ||
| 45 | |||
| 46 | virtual IddObjectType iddObjectType() const override; | ||
| 47 | |||
| 48 | /** @name Getters */ | ||
| 49 | //@{ | ||
| 50 | |||
| 51 | openstudio::Date startDate() const; | ||
| 52 | |||
| 53 | boost::optional<openstudio::NthDayOfWeekInMonth> startNthDayOfWeekInMonth() const; | ||
| 54 | |||
| 55 | openstudio::Date endDate() const; | ||
| 56 | |||
| 57 | boost::optional<openstudio::NthDayOfWeekInMonth> endNthDayOfWeekInMonth() const; | ||
| 58 | |||
| 59 | //@} | ||
| 60 | /** @name Setters */ | ||
| 61 | //@{ | ||
| 62 | |||
| 63 | bool setStartDate(const std::string& startDate); | ||
| 64 | bool setStartDate(const openstudio::MonthOfYear& monthOfYear, unsigned day); | ||
| 65 | bool setStartDate(const openstudio::NthDayOfWeekInMonth& nth, const openstudio::DayOfWeek& dayOfWeek, | ||
| 66 | const openstudio::MonthOfYear& monthOfYear); | ||
| 67 | |||
| 68 | bool setEndDate(const std::string& endDate); | ||
| 69 | bool setEndDate(const openstudio::MonthOfYear& monthOfYear, unsigned day); | ||
| 70 | bool setEndDate(const openstudio::NthDayOfWeekInMonth& nth, const openstudio::DayOfWeek& dayOfWeek, const openstudio::MonthOfYear& monthOfYear); | ||
| 71 | |||
| 72 | // ensure that this object does not contain the date 2/29 | ||
| 73 | void ensureNoLeapDays(); | ||
| 74 | |||
| 75 | //@} | ||
| 76 | protected: | ||
| 77 | private: | ||
| 78 | openstudio::Date getDate(const std::string& text) const; | ||
| 79 | |||
| 80 | boost::optional<openstudio::NthDayOfWeekInMonth> getNthDayOfWeekInMonth(const std::string& text) const; | ||
| 81 | |||
| 82 | − | REGISTER_LOGGER("openstudio.model.RunPeriodControlDaylightSavingTime"); | |
| 83 | }; | ||
| 84 | |||
| 85 | } // namespace detail | ||
| 86 | |||
| 87 | } // namespace model | ||
| 88 | } // namespace openstudio | ||
| 89 | |||
| 90 | #endif // MODEL_RUNPERIODCONTROLDAYLIGHTSAVINGTIME_IMPL_HPP | ||
| 91 |