#include <IdfObjectWatcher.hpp>
Public Member Functions | |
void | change () |
virtual void | clearState () |
reset dirty, dataChanged, and nameChanged More... | |
void | dataChange () |
bool | dataChanged () const |
if dirty, then true if data field changed, false if some other change More... | |
bool | dirty () const |
true if object has changed More... | |
bool | disable () |
void | enable () |
enable the watcher More... | |
bool | enabled () const |
is the watcher currently enabled More... | |
IdfObjectWatcher (const IdfObject &idfObject) | |
constructor with IdfObject to watch More... | |
void | nameChange () |
bool | nameChanged () const |
if dirty, then true if name field changed, false otherwise 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 | onChangeIdfObject () |
called each time the IdfObject changes if watcher enabled More... | |
virtual void | onDataFieldChange () |
called each time one of the IdfObject's data fields changes if watcher enabled More... | |
virtual void | onNameChange () |
called each time the IdfObject's name changes if watcher enabled More... | |
virtual | ~IdfObjectWatcher () |
virtual destructor More... | |
Protected Attributes | |
bool | m_dataChanged |
bool | m_dirty |
bool | m_enabled |
bool | m_nameChanged |
IdfObjectWatcher watches an IdfObject for signals emitted on changes.
These signals will cause the watcher to mark the IdfObject as dirty. The dirty flag will persist until reset by the user. Virtual methods onChangeIdfObject and onDataFieldChange are also available to override. The former is called every time the IdfObject changes in any way; the latter is called whenever a data field changes (not triggered by comment changes, and is superceded by onRelationshipChange for WorkspaceObject pointer fields.) 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.
IdfObjectWatcher is 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::IdfObjectWatcher::IdfObjectWatcher | ( | const IdfObject & | idfObject | ) |
constructor with IdfObject to watch
|
virtual |
virtual destructor
void openstudio::IdfObjectWatcher::change | ( | ) |
|
virtual |
reset dirty, dataChanged, and nameChanged
Reimplemented in openstudio::WorkspaceObjectWatcher.
void openstudio::IdfObjectWatcher::dataChange | ( | ) |
bool openstudio::IdfObjectWatcher::dataChanged | ( | ) | const |
if dirty, then true if data field changed, false if some other change
bool openstudio::IdfObjectWatcher::dirty | ( | ) | const |
true if object has changed
bool openstudio::IdfObjectWatcher::disable | ( | ) |
void openstudio::IdfObjectWatcher::enable | ( | ) |
enable the watcher
bool openstudio::IdfObjectWatcher::enabled | ( | ) | const |
is the watcher currently enabled
void openstudio::IdfObjectWatcher::nameChange | ( | ) |
bool openstudio::IdfObjectWatcher::nameChanged | ( | ) | const |
if dirty, then true if name field changed, false otherwise
|
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 each time one of the IdfObject's data fields changes if watcher enabled
|
virtual |
called each time the IdfObject's name changes if watcher enabled
|
protected |
|
protected |
|
protected |
|
protected |