#include <WorkspaceWatcher.hpp>
Public Member Functions | |
void | change () |
virtual void | clearState () |
resets dirty, objectAdded, and objectRemoved More... | |
bool | dirty () const |
true if workspace has changed More... | |
bool | disable () |
void | enable () |
enable the watcher More... | |
bool | enabled () const |
is the watcher currently enabled More... | |
void | objectAdd (const WorkspaceObject &addedObject, const openstudio::IddObjectType &type, const openstudio::UUID &uuid) |
bool | objectAdded () const |
true if an object has been added More... | |
void | objectRemove (const WorkspaceObject &removedObject, const openstudio::IddObjectType &type, const openstudio::UUID &uuid) |
bool | objectRemoved () const |
true if an object has been removed More... | |
virtual void | onBecomeClean () |
called after dirty transitions from true to false if watcher enabled More... | |
virtual void | onBecomeDirty () |
called after dirty transitions from false to true if watcher enabled More... | |
virtual void | onChangeWorkspace () |
called each time the IdfObject changes if watcher enabled More... | |
virtual void | onObjectAdd (const WorkspaceObject &addedObject) |
called immediately when a new object is added to the workspace if watcher enabled the object may not be fully constructed this may be called when an object is restored after a failed remove More... | |
virtual void | onObjectRemove (const WorkspaceObject &removedObject) |
called immediately before an object is removed from the workspace if watcher enabled the object is still valid when this method is called More... | |
WorkspaceWatcher (const Workspace &workspace) | |
virtual | ~WorkspaceWatcher () |
WorkspaceWatcher watches a Workspace for signals emitted on changes.
This signals will cause the watcher to mark the Workspace as dirty. The dirty flag will persist until reset by the user. A virtual method onChangeWorkspace is also available to override, it is called everytime the Workspace changes. The virtual method onBecomeDirty is called only after dirty transitions from false to true. Alternatively, the virtual method onBecomeClean is called only after dirty transitions from true to false.
WorkspaceWatcher an atypical object because it is designed to be stack allocated. In many cases it would be preferred to connect your own heap allocated object to the Workspace signals directly rather than using this convenience class.
openstudio::WorkspaceWatcher::WorkspaceWatcher | ( | const Workspace & | workspace | ) |
|
virtual |
void openstudio::WorkspaceWatcher::change | ( | ) |
|
virtual |
resets dirty, objectAdded, and objectRemoved
bool openstudio::WorkspaceWatcher::dirty | ( | ) | const |
true if workspace has changed
bool openstudio::WorkspaceWatcher::disable | ( | ) |
void openstudio::WorkspaceWatcher::enable | ( | ) |
enable the watcher
bool openstudio::WorkspaceWatcher::enabled | ( | ) | const |
is the watcher currently enabled
void openstudio::WorkspaceWatcher::objectAdd | ( | const WorkspaceObject & | addedObject, |
const openstudio::IddObjectType & | type, | ||
const openstudio::UUID & | uuid | ||
) |
bool openstudio::WorkspaceWatcher::objectAdded | ( | ) | const |
true if an object has been added
void openstudio::WorkspaceWatcher::objectRemove | ( | const WorkspaceObject & | removedObject, |
const openstudio::IddObjectType & | type, | ||
const openstudio::UUID & | uuid | ||
) |
bool openstudio::WorkspaceWatcher::objectRemoved | ( | ) | const |
true if an object has been removed
|
virtual |
called after dirty transitions from true to false if watcher enabled
|
virtual |
called after dirty transitions from false to true if watcher enabled
|
virtual |
called each time the IdfObject changes if watcher enabled
|
virtual |
called immediately when a new object is added to the workspace if watcher enabled the object may not be fully constructed this may be called when an object is restored after a failed remove
|
virtual |
called immediately before an object is removed from the workspace if watcher enabled the object is still valid when this method is called