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/WeatherFile_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_WEATHERFILE_IMPL_HPP
7 #define MODEL_WEATHERFILE_IMPL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ModelObject_Impl.hpp"
11
12 #include "../utilities/core/Path.hpp"
13
14 namespace openstudio {
15
16 class EpwFile;
17 class DayOfWeek;
18
19 namespace model {
20
21 class Site;
22 class WeatherFile;
23
24 namespace detail {
25
26 /** WeatherFile_Impl is a ModelObject_Impl that is the implementation class for WeatherFile.*/
27 class MODEL_API WeatherFile_Impl : public ModelObject_Impl
28 {
29 public:
30 /** @name Constructors and Destructors */
31 //@{
32
33 WeatherFile_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
34
35 WeatherFile_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
36
37 WeatherFile_Impl(const WeatherFile_Impl& other, Model_Impl* model, bool keepHandle);
38
39 113 virtual ~WeatherFile_Impl() override = default;
40
41 //@}
42
43 // return the parent object in the hierarchy
44 virtual boost::optional<ParentObject> parent() const override;
45
46 // set the parent, child may have to call methods on the parent
47 virtual bool setParent(ParentObject& newParent) override;
48
49 // Get all output variable names that could be associated with this object.
50 virtual const std::vector<std::string>& outputVariableNames() const override;
51
52 virtual IddObjectType iddObjectType() const override;
53
54 virtual std::vector<EMSActuatorNames> emsActuatorNames() const override;
55
56 virtual std::vector<std::string> emsInternalVariableNames() const override;
57
58 /** @name Getters */
59 //@{
60
61 std::string city() const;
62
63 std::string stateProvinceRegion() const;
64
65 std::string country() const;
66
67 std::string dataSource() const;
68
69 std::string wMONumber() const;
70
71 double latitude() const;
72
73 double longitude() const;
74
75 double timeZone() const;
76
77 double elevation() const;
78
79 bool isElevationDefaulted() const;
80
81 boost::optional<std::string> url() const;
82
83 boost::optional<openstudio::path> path() const;
84
85 boost::optional<std::string> checksum() const;
86
87 boost::optional<int> startDateActualYear() const;
88
89 boost::optional<DayOfWeek> startDayOfWeek() const;
90
91 //@}
92 /** @name Setters */
93 //@{
94
95 bool setCity(const std::string& city);
96
97 bool setStateProvinceRegion(const std::string& stateProvinceRegion);
98
99 bool setCountry(const std::string& country);
100
101 bool setDataSource(const std::string& dataSource);
102
103 bool setWMONumber(const std::string& wMONumber);
104
105 bool setLatitude(double latitude);
106
107 bool setLongitude(double longitude);
108
109 bool setTimeZone(double timeZone);
110
111 bool setElevation(double elevation);
112
113 void resetElevation();
114
115 //bool setUrl(boost::optional<std::string> url);
116
117 //bool setUrl(const std::string& url);
118
119 //void resetUrl();
120
121 //bool setChecksum(boost::optional<std::string> checksum);
122
123 //bool setChecksum(const std::string& checksum);
124
125 //void resetChecksum();
126
127 //@}
128
129 // get the site
130 boost::optional<Site> site() const;
131
132 /** Load and return the EpwFile, if it can be located. */
133 boost::optional<EpwFile> file(const openstudio::path& dir = openstudio::path()) const;
134
135 /** Save the url as relative to basePath, or just keep the file name and extension if
136 * basePath.empty(). */
137 bool makeUrlRelative(const openstudio::path& basePath = openstudio::path());
138
139 /** Search for file and save the absolute url if successful. */
140 bool makeUrlAbsolute(const openstudio::path& searchDirectory);
141
142 // get environment name as reported in the sql file
143 // environment name = "City StateProvinceRegion Country DataSource WMO#=WMONumber"
144 boost::optional<std::string> environmentName() const;
145
146 protected:
147 private:
148 − REGISTER_LOGGER("openstudio.model.WeatherFile");
149 };
150
151 } // namespace detail
152
153 } // namespace model
154 } // namespace openstudio
155
156 #endif // MODEL_WEATHERFILE_IMPL_HPP
157