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/WorkspaceObjectWatcher.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_WORKSPACEOBJECTWATCHER_HPP
7 #define UTILITIES_IDF_WORKSPACEOBJECTWATCHER_HPP
8
9 #include <utilities/idf/IdfObjectWatcher.hpp>
10 #include <utilities/idf/WorkspaceObject.hpp>
11
12 namespace openstudio {
13
14 class UTILITIES_API WorkspaceObjectWatcher : public IdfObjectWatcher
15 {
16 public:
17 /// constructor with IdfObject to watch
18 WorkspaceObjectWatcher(const WorkspaceObject& workspaceObject);
19
20 /// virtual destructor
21 14 virtual ~WorkspaceObjectWatcher() = default;
22
23 /// true if a pointer field changed
24 bool relationshipChanged() const;
25
26 /// true if the object was removed from its workspace
27 bool removedFromWorkspace() const;
28
29 /// reset relationshipChanged and removedFromWorkspace as well as flags from IdfObjectWatcher
30 virtual void clearState() override;
31
32 /// called each time a pointer field changes if watcher enabled
33 virtual void onRelationshipChange(int index, Handle newHandle, Handle oldHandle);
34
35 /// called when the object is removed from its workspace if watcher enabled
36 virtual void onRemoveFromWorkspace(Handle handle);
37
38 // public slots:
39
40 void relationshipChange(int index, Handle newHandle, Handle oldHandle);
41
42 void removedFromWorkspace(const Handle& handle);
43
44 protected:
45 bool m_relationshipChanged;
46 bool m_removedFromWorkspace;
47 };
48
49 } // namespace openstudio
50
51 #endif // UTILITIES_IDF_WORKSPACEOBJECTWATCHER_HPP
52