|
ACF $AcfVersion:0$
|
Reflects the changes of observed objects as changes of some other object (over istd::IChangeable), typically delegated to itself. More...
#include <CModelUpdateBridge.h>
Public Types | |
| enum | UpdateFlags { UF_DELEGATED = 0x1 , UF_SOURCE = 0x2 } |
| Flags to control the change set using for the change notification of the target object. More... | |
Public Member Functions | |
| CModelUpdateBridge (istd::IChangeable *changeablePtr, int updateFlags=UF_DELEGATED) | |
| virtual | ~CModelUpdateBridge () |
| imod::IModel * | GetObservedModel (int modelIndex) const |
Get access to connected model with the index index. | |
| int | GetModelCount () const |
| Gets the number of connected models. | |
| void | EnsureModelsDetached () |
| Remove all observed models from this bridge. | |
| virtual bool | IsModelAttached (const imod::IModel *modelPtr) const override |
| Checks if the specified model is currently attached to this observer. | |
| virtual bool | OnModelAttached (imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override |
| Callback invoked when an observable model is about to be attached to this observer. | |
| virtual bool | OnModelDetached (imod::IModel *modelPtr) override |
| Callback invoked when an observable model is about to be detached from this observer. | |
| virtual void | BeforeUpdate (imod::IModel *modelPtr) override |
| Callback invoked before an update of the observer's content occurs. | |
| virtual void | AfterUpdate (imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override |
| Callback invoked after an update of the observer's content occurs. | |
Public Member Functions inherited from istd::IPolymorphic | |
| virtual | ~IPolymorphic () |
Reflects the changes of observed objects as changes of some other object (over istd::IChangeable), typically delegated to itself.
In other words: it allows to connect as observer to multiple models and call BeginChanges and EndChanges on some its changes.
Definition at line 27 of file CModelUpdateBridge.h.
Flags to control the change set using for the change notification of the target object.
Definition at line 33 of file CModelUpdateBridge.h.
|
explicit |
|
virtual |
|
overridevirtual |
Callback invoked after an update of the observer's content occurs.
This is the primary notification method where observers react to model changes. It's called after the model has finished updating its state. The implementation should examine the changeSet to determine what changed and update accordingly.
| modelPtr | Pointer to the model that has changed |
| changeSet | Contains information about what changed in the model. Use changeSet.Contains(changeId) to check for specific changes. The changeSet respects the mask specified in OnModelAttached(). |
Implements imod::IObserver.
Reimplemented in iqtgui::CCommandsMultiplexerComp.
|
overridevirtual |
Callback invoked before an update of the observer's content occurs.
This method is called at the start of a model update cycle, before any data actually changes. It allows the observer to prepare for the update, such as saving current state for comparison or disabling UI updates temporarily.
| modelPtr | Pointer to the model that is about to change |
Implements imod::IObserver.
Reimplemented in iqtgui::CCommandsMultiplexerComp.
| void imod::CModelUpdateBridge::EnsureModelsDetached | ( | ) |
Remove all observed models from this bridge.
| int imod::CModelUpdateBridge::GetModelCount | ( | ) | const |
Gets the number of connected models.
| imod::IModel * imod::CModelUpdateBridge::GetObservedModel | ( | int | modelIndex | ) | const |
Get access to connected model with the index index.
|
overridevirtual |
Checks if the specified model is currently attached to this observer.
This method allows querying whether a specific model is being observed, or whether any model at all is attached.
| modelPtr | Pointer to the model object to check. If nullptr, checks whether any model is attached to this observer. |
Implements imod::IObserver.
|
overridevirtual |
Callback invoked when an observable model is about to be attached to this observer.
This method is called by the model when attempting to establish an observer relationship. The implementation should:
| modelPtr | Pointer to the model object being attached. Never nullptr. |
| changeMask | Output parameter where the observer specifies which change types it wants to be notified about. Set the appropriate change flags using changeMask.Set(changeId). An empty mask means the observer wants all changes. |
Implements imod::IObserver.
|
overridevirtual |
Callback invoked when an observable model is about to be detached from this observer.
This method is called when the observer-model relationship is being terminated, either explicitly or because the model is being destroyed. The implementation should clean up any state or resources related to this model.
| modelPtr | Pointer to the model object being detached |
Implements imod::IObserver.