GCC Code Coverage Report


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

src/utilities/data/EndUses.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 UTILITIES_DATA_ENDUSES_HPP
7 #define UTILITIES_DATA_ENDUSES_HPP
8
9 #include "../UtilitiesAPI.hpp"
10 #include "Attribute.hpp"
11 #include "DataEnums.hpp"
12
13 namespace openstudio {
14
15 /** EndUses is wrapper around Attribute for storing information about end uses.
16 */
17 class UTILITIES_API EndUses
18 {
19 public:
20 /// Returns the expected name for attributes of this type, 'EndUses'.
21 static std::string attributeName();
22
23 /// get units for fuel type
24 static std::string getUnitsForFuelType(const EndUseFuelType& fuelType);
25
26 /// get list of all fuel types
27 static std::vector<EndUseFuelType> fuelTypes();
28
29 /// get list of all categories
30 static std::vector<EndUseCategoryType> categories();
31
32 /// Creates an EndUses wrapper around attribute if it is correctly formatted.
33 static boost::optional<EndUses> fromAttribute(const Attribute& attribute);
34
35 /// Constructs a new end uses attribute
36 EndUses();
37
38 /// Returns the attribute
39 Attribute attribute() const;
40
41 /// add an end use
42 void addEndUse(double value, const EndUseFuelType& fuelType, const EndUseCategoryType& category, const std::string& subCategory = "General");
43
44 /// get end use value
45 double getEndUse(const EndUseFuelType& fuelType, const EndUseCategoryType& category, const std::string& subCategory) const;
46
47 /// get end use value across sub categories
48 double getEndUse(const EndUseFuelType& fuelType, const EndUseCategoryType& category) const;
49
50 /// get end use value across fuel types
51 double getEndUseByCategory(const EndUseCategoryType& category, const std::string& subCategory) const;
52
53 /// get end use value across fuel types and sub categories
54 double getEndUseByCategory(const EndUseCategoryType& category) const;
55
56 /// get end use value across categories and sub categories
57 double getEndUseByFuelType(const EndUseFuelType& fuelType) const;
58
59 /// get list of all sub cateogories
60 std::vector<std::string> subCategories() const;
61
62 private:
63 EndUses(const Attribute& attribute);
64
65 Attribute m_attribute;
66
67 − REGISTER_LOGGER("openstudio.EndUses");
68 };
69
70 } // namespace openstudio
71
72 #endif // UTILITIES_DATA_ENDUSES_HPP
73