Inherits imod::CMultiModelDispatcherBase.
template<typename ModelInterface, typename Parent>
class imtbase::TModelUpdateBinder< ModelInterface, Parent >
Helper for managing data change notifications from sub-models. In the context of an observer of some hierarchical data model it is usefull to have a mechanism for the reaction on changes of a sub-model.
class IAddress: public istd::IChangeable
{
public:
virtual QString GetCity() const = 0;
};
class IUser: public istd::IChangeable
{
public:
virutal const QString GetName() const = 0;
virutal const IAddress* GetAddress() const = 0;
};
class UserObserver: public imod::TSingleModelObserverBase<IUser>
{
public:
virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask);
{
IUser* userPtr = GetObservedObject();
m_addressObserver.RegisterObject(
userPtr->GetAddress(),
&UserObserver::OnAddressUpdated);
}
private:
void OnAddressUpdated(const istd::IChangeable::ChangeSet& changeSet, const IAddress* addressPtr)
{
}
private:
};
Definition at line 59 of file TModelUpdateBinder.h.