OpenStudio:utilities
Loading...
Searching...
No Matches
openstudio::WorkspaceObjectWatcher Class Reference

#include <WorkspaceObjectWatcher.hpp>

+ Inheritance diagram for openstudio::WorkspaceObjectWatcher:

Public Member Functions

virtual void clearState () override
 reset relationshipChanged and removedFromWorkspace as well as flags from IdfObjectWatcher
 
virtual void onRelationshipChange (int index, Handle newHandle, Handle oldHandle)
 called each time a pointer field changes if watcher enabled
 
virtual void onRemoveFromWorkspace (Handle handle)
 called when the object is removed from its workspace if watcher enabled
 
void relationshipChange (int index, Handle newHandle, Handle oldHandle)
 
bool relationshipChanged () const
 true if a pointer field changed
 
bool removedFromWorkspace () const
 true if the object was removed from its workspace
 
void removedFromWorkspace (const Handle &handle)
 
 WorkspaceObjectWatcher (const WorkspaceObject &workspaceObject)
 constructor with IdfObject to watch
 
virtual ~WorkspaceObjectWatcher ()=default
 virtual destructor
 
- Public Member Functions inherited from openstudio::IdfObjectWatcher
void change ()
 
void dataChange ()
 
bool dataChanged () const
 if dirty, then true if data field changed, false if some other change
 
bool dirty () const
 true if object has changed
 
bool disable ()
 
void enable ()
 enable the watcher
 
bool enabled () const
 is the watcher currently enabled
 
 IdfObjectWatcher (const IdfObject &idfObject)
 constructor with IdfObject to watch
 
void nameChange ()
 
bool nameChanged () const
 if dirty, then true if name field changed, false otherwise
 
virtual void onBecomeClean ()
 called after dirty transitions from true to false if watcher enabled
 
virtual void onBecomeDirty ()
 called after dirty transitions from false to true if watcher enabled
 
virtual void onChangeIdfObject ()
 called each time the IdfObject changes if watcher enabled
 
virtual void onDataFieldChange ()
 called each time one of the IdfObject's data fields changes if watcher enabled
 
virtual void onNameChange ()
 called each time the IdfObject's name changes if watcher enabled
 
virtual ~IdfObjectWatcher ()=default
 virtual destructor
 

Protected Attributes

bool m_relationshipChanged
 
bool m_removedFromWorkspace
 
- Protected Attributes inherited from openstudio::IdfObjectWatcher
bool m_dataChanged
 
bool m_dirty
 
bool m_enabled
 
bool m_nameChanged
 

Constructor & Destructor Documentation

◆ WorkspaceObjectWatcher()

openstudio::WorkspaceObjectWatcher::WorkspaceObjectWatcher ( const WorkspaceObject & workspaceObject)

constructor with IdfObject to watch

◆ ~WorkspaceObjectWatcher()

virtual openstudio::WorkspaceObjectWatcher::~WorkspaceObjectWatcher ( )
virtualdefault

virtual destructor

Member Function Documentation

◆ clearState()

virtual void openstudio::WorkspaceObjectWatcher::clearState ( )
overridevirtual

reset relationshipChanged and removedFromWorkspace as well as flags from IdfObjectWatcher

Reimplemented from openstudio::IdfObjectWatcher.

◆ onRelationshipChange()

virtual void openstudio::WorkspaceObjectWatcher::onRelationshipChange ( int index,
Handle newHandle,
Handle oldHandle )
virtual

called each time a pointer field changes if watcher enabled

◆ onRemoveFromWorkspace()

virtual void openstudio::WorkspaceObjectWatcher::onRemoveFromWorkspace ( Handle handle)
virtual

called when the object is removed from its workspace if watcher enabled

◆ relationshipChange()

void openstudio::WorkspaceObjectWatcher::relationshipChange ( int index,
Handle newHandle,
Handle oldHandle )

◆ relationshipChanged()

bool openstudio::WorkspaceObjectWatcher::relationshipChanged ( ) const

true if a pointer field changed

◆ removedFromWorkspace() [1/2]

bool openstudio::WorkspaceObjectWatcher::removedFromWorkspace ( ) const

true if the object was removed from its workspace

◆ removedFromWorkspace() [2/2]

void openstudio::WorkspaceObjectWatcher::removedFromWorkspace ( const Handle & handle)

Member Data Documentation

◆ m_relationshipChanged

bool openstudio::WorkspaceObjectWatcher::m_relationshipChanged
protected

◆ m_removedFromWorkspace

bool openstudio::WorkspaceObjectWatcher::m_removedFromWorkspace
protected