GCC Code Coverage Report


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

src/utilities/idf/IdfObjectDiff_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_IDF_IDFOBJECTDIFF_IMPL_HPP
7 #define UTILITIES_IDF_IDFOBJECTDIFF_IMPL_HPP
8
9 #include "../UtilitiesAPI.hpp"
10
11 #include <boost/optional.hpp>
12
13 #include <string>
14
15 namespace openstudio {
16 namespace detail {
17
18 class UTILITIES_API IdfObjectDiff_Impl
19 {
20 public:
21 IdfObjectDiff_Impl();
22
23 IdfObjectDiff_Impl(boost::optional<unsigned> index, boost::optional<std::string> oldValue, boost::optional<std::string> newValue);
24
25 11767334 virtual ~IdfObjectDiff_Impl() = default;
26
27 /// get the index that changed, uninitialized means no field (e.g. object level comment changed)
28 boost::optional<unsigned> index() const;
29
30 /// returns true if oldValue == newValue
31 bool isNull() const;
32
33 /// get the old value, uninitialized optional means that the field did not previously exist
34 boost::optional<std::string> oldValue() const;
35
36 /// get the new value, uninitialized optional means that the field no longer exists
37 boost::optional<std::string> newValue() const;
38
39 private:
40 boost::optional<unsigned> m_index;
41 boost::optional<std::string> m_oldValue;
42 boost::optional<std::string> m_newValue;
43 };
44
45 } // namespace detail
46 } // namespace openstudio
47
48 #endif // UTILITIES_IDF_IDFOBJECTDIFF_IMPL_HPP
49