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/utilities/units/WhUnit_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 UTILITIES_UNITS_WHUNIT_IMPL_HPP
7 #define UTILITIES_UNITS_WHUNIT_IMPL_HPP
8
9 #include "../UtilitiesAPI.hpp"
10 #include "Unit_Impl.hpp"
11
12 namespace openstudio {
13 namespace detail {
14
15 /** WhUnit_Impl is a Unit_Impl that is the implementation class for WhUnit.*/
16 class UTILITIES_API WhUnit_Impl : public Unit_Impl
17 {
18 public:
19 /** @name Constructors and Destructors */
20 //@{
21
22 /** Default constructor. Example: \verbatim
23 WhUnit myEnergy(WhExpnt(1,1),3,"Wh");
24 std::cout << myEnergy; // produces "kWh" \endverbatim
25 *
26 * \param[in] exponents holds the exponents for each base unit.
27 * \param[in] scaleExponent exponent for scale. For instance 3 for kilo.
28 * \param[in] prettyString optional string to use in place of standardString. */
29 WhUnit_Impl(const WhExpnt& exponents = WhExpnt(), int scaleExponent = 0, const std::string& prettyString = "");
30
31 /** Alternate constructor. Specify the abbreviation of the scale, rather than its
32 * exponent. Example: \verbatim
33 WhUnit myEnergy("k",WhExpnt(1,1),"Wh");
34 std::cout << myEnergy; // produces "kWh" \endverbatim
35 *
36 * \param[in] scaleAbbreviation is string equal to a scale abbreviation. For instance
37 * "k" for kilo.
38 * \param[in] exponents holds the exponents for each base unit.
39 * \param[in] prettyString optional string to use in place of standardString. */
40 WhUnit_Impl(const std::string& scaleAbbreviation, const WhExpnt& exponents = WhExpnt(), const std::string& prettyString = "");
41
42 75528 virtual ~WhUnit_Impl() override = default;
43
44 /** Deep copy constructor. */
45 virtual Unit clone() const override;
46
47 //@}
48 /** @name Base Units and Scale */
49 //@{
50
51 /** Throws if baseUnit is not a valid for WhUnit. */
52 virtual void setBaseUnitExponent(const std::string& baseUnit, int exponent) override;
53
54 //@}
55 private:
56 − REGISTER_LOGGER("openstudio.units.WhUnit");
57 };
58
59 } // namespace detail
60
61 } // namespace openstudio
62
63 #endif // UTILITIES_UNITS_WHUNIT_IMPL_HPP
64