21template<
class ModelInterface>
46template<
class ModelInterface>
49 Q_ASSERT(objectIndex >= 0);
50 Q_ASSERT(objectIndex < GetModelCount());
52 return dynamic_cast<ModelInterface*
>(GetObservedModel(objectIndex));
56template<
class ModelInterface>
59 Q_ASSERT(objectIndex >= 0);
60 Q_ASSERT(objectIndex < GetModelCount());
62 return dynamic_cast<ModelInterface*
>(GetObservedModel(objectIndex));
68template<
class ModelInterface>
71 ModelInterface* objectPtr =
dynamic_cast<ModelInterface*
>(modelPtr);
72 if (objectPtr ==
NULL){
76 return BaseClass::OnModelAttached(modelPtr, changeMask);
Basic implementation of a multiple model observer.
Common interface for model objects, that supports Model/Observer design pattern.
Basic implementation of a multiple model observer.
ModelInterface * GetObjectPtr(int objectIndex) const
Get instance of observed object.
CMultiModelObserverBase BaseClass
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.
ModelInterface * GetObservedObject(int objectIndex) const
Get instance of observed object.
Set of change flags (its IDs).
This namespace containes basic implementation of Model/Observer design pattern This package is system...