Skip to main content
AndrewM
Associate III
November 11, 2019
Question

Why are ModelListener::model and Model::modelListener data members declared protected rather than private?

  • November 11, 2019
  • 1 reply
  • 552 views

I notice that both ModelListener::model and Model::modelListener data members are declared protected rather than private.

This would indicate the provision for inheriting from ModelListener and/or Model.

Under what circumstances might one want to do that and more importantly, how would that work in terms of memory allocation?

ie how would one organise for TouchGFX to allocate the derived class instances?

This topic has been closed for replies.

1 reply

Martin KJELDSEN
Principal III
January 9, 2020

I think, initially, the idea was that you could have sub models that inherited from the Model class, but in reality this is not the best or easiest solution - So you could say that they might as well be private.

/Martin