src/model/YearDescription_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_YEARDESCRIPTION_IMPL_HPP | ||
| 7 | #define MODEL_YEARDESCRIPTION_IMPL_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ParentObject_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 | /** YearDescription_Impl is a ParentObject_Impl that is the implementation class for YearDescription.*/ | ||
| 24 | class MODEL_API YearDescription_Impl : public ParentObject_Impl | ||
| 25 | { | ||
| 26 | |||
| 27 | public: | ||
| 28 | /** @name Constructors and Destructors */ | ||
| 29 | //@{ | ||
| 30 | |||
| 31 | YearDescription_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle); | ||
| 32 | |||
| 33 | YearDescription_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 34 | |||
| 35 | YearDescription_Impl(const YearDescription_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 36 | |||
| 37 | 1052 | virtual ~YearDescription_Impl() override = default; | |
| 38 | |||
| 39 | //@} | ||
| 40 | virtual const std::vector<std::string>& outputVariableNames() const override; | ||
| 41 | |||
| 42 | virtual IddObjectType iddObjectType() const override; | ||
| 43 | |||
| 44 | virtual std::vector<ModelObject> children() const override; | ||
| 45 | |||
| 46 | virtual std::vector<IddObjectType> allowableChildTypes() const override; | ||
| 47 | |||
| 48 | /** @name Getters */ | ||
| 49 | //@{ | ||
| 50 | |||
| 51 | boost::optional<int> calendarYear() const; | ||
| 52 | |||
| 53 | std::string dayofWeekforStartDay() const; | ||
| 54 | |||
| 55 | bool isDayofWeekforStartDayDefaulted() const; | ||
| 56 | |||
| 57 | bool isLeapYear() const; | ||
| 58 | |||
| 59 | bool isIsLeapYearDefaulted() const; | ||
| 60 | |||
| 61 | //@} | ||
| 62 | /** @name Setters */ | ||
| 63 | //@{ | ||
| 64 | |||
| 65 | bool setCalendarYear(boost::optional<int> calendarYear); | ||
| 66 | |||
| 67 | void resetCalendarYear(); | ||
| 68 | |||
| 69 | bool setDayofWeekforStartDay(const std::string& dayofWeekforStartDay); | ||
| 70 | |||
| 71 | void resetDayofWeekforStartDay(); | ||
| 72 | |||
| 73 | bool setIsLeapYear(bool isLeapYear); | ||
| 74 | |||
| 75 | void resetIsLeapYear(); | ||
| 76 | |||
| 77 | //@} | ||
| 78 | |||
| 79 | /// Returns assumed year for date calculations. | ||
| 80 | int assumedYear() const; | ||
| 81 | |||
| 82 | /// Returns a date which may be used in this model. | ||
| 83 | /// Will throw if dayOfMonth is not appropriate for monthOfYear. | ||
| 84 | openstudio::Date makeDate(openstudio::MonthOfYear monthOfYear, unsigned dayOfMonth); | ||
| 85 | openstudio::Date makeDate(unsigned monthOfYear, unsigned dayOfMonth); | ||
| 86 | |||
| 87 | /// nth weekday of month generators | ||
| 88 | openstudio::Date makeDate(openstudio::NthDayOfWeekInMonth n, openstudio::DayOfWeek dayOfWeek, openstudio::MonthOfYear monthOfYear); | ||
| 89 | |||
| 90 | /// day of year | ||
| 91 | openstudio::Date makeDate(unsigned dayOfYear); | ||
| 92 | |||
| 93 | protected: | ||
| 94 | private: | ||
| 95 | void updateModelLeapYear(bool wasLeapYear, bool isLeapYear); | ||
| 96 | |||
| 97 | − | REGISTER_LOGGER("openstudio.model.YearDescription"); | |
| 98 | }; | ||
| 99 | |||
| 100 | } // namespace detail | ||
| 101 | |||
| 102 | } // namespace model | ||
| 103 | } // namespace openstudio | ||
| 104 | |||
| 105 | #endif // MODEL_YEARDESCRIPTION_IMPL_HPP | ||
| 106 |