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/ComponentWatcher_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_COMPONENTWATCHER_IMPL_HPP
7 #define MODEL_COMPONENTWATCHER_IMPL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ModelObject.hpp"
11 #include "ComponentData.hpp"
12
13 #include "../utilities/core/Logger.hpp"
14
15 #include "../nano/nano_signal_slot.hpp" // Signal-Slot replacement
16
17 namespace openstudio {
18 namespace model {
19
20 class ComponentWatcher;
21
22 namespace detail {
23
24 class MODEL_API ComponentWatcher_Impl
25 : public std::enable_shared_from_this<ComponentWatcher_Impl>
26 , public Nano::Observer
27 {
28
29 public:
30 /** @name Constructors and Destructors */
31 //@{
32
33 ComponentWatcher_Impl(ComponentData& componentData);
34
35 1738 virtual ~ComponentWatcher_Impl() = default;
36
37 //@}
38 /** @name Getters */
39 //@{
40
41 ComponentWatcher componentWatcher() const;
42
43 ComponentData componentData() const;
44
45 //@}
46 /** @name Nano Signals */
47 //@{
48
49 Nano::Signal<void(const ComponentWatcher&)> obsolete;
50
51 void dataChange();
52
53 void nameChange();
54
55 void componentDataChange();
56
57 void relationshipChange(int index, Handle newHandle, Handle oldHandle);
58
59 void objectRemove(const Handle& handleOfRemovedObject);
60
61 void objectAdd(const WorkspaceObject& addedObject, const openstudio::IddObjectType& type, const openstudio::UUID& uuid);
62
63 private:
64 ComponentData m_componentData;
65 std::vector<ModelObject> m_componentObjects;
66
67 void mf_changeComponentVersion();
68
69 void mf_refreshComponentContents(bool logWarnings);
70
71 void mf_removeComponent();
72
73 − REGISTER_LOGGER("openstudio.model.ComponentWatcher");
74 };
75
76 } // namespace detail
77
78 } // namespace model
79 } // namespace openstudio
80
81 #endif // MODEL_COMPONENTWATCHER_IMPL_HPP
82