I am searching for a good feedback pattern – concept, perhaps the question could be asked differently, let me know please. Will try to describe it.
Basically what I am looking for is the right way of making a good feedback concept. For example Trigger object triggers a function from other Target object for which Triggerobject has some kind of expectations (maybe more then one parameter). This triggered call can also make more function calls from different kind of objects, so they would all need some kind of access to give there response to Trigger object with result parameters which Trigger object would then compare with expected ones and react upon receiving them.
I need a good concept since it must be possible to spread the functionality over the whole system. If it matters, Source code is written in C++ Qt.
I would suggest Observer pattern.
Basically there is an
Observableobjects which maintains a set ofObserverswhich are registered to that object to listen on some action. WhenObservableobject make such an action,Observersare notified that an action was made and can react on it.So in your case the
Triggerwould be anObservableobject andTargetobjects would beObservers.Targetobjects can be registered onTriggerobject and can react (make feedback) onTriggeraction.