Don’t really consider this a request; consider it a hypothetical request in the form of a monologue, and help me reach my conclusion
Would it be too much to add a pair of callbacks to changebroadcaster, so we can be notified just before and just after the messages are sent to the listeners?
I have a system of ‘aspectflags’, so I can know which major aspects have changed in my object. When i get a change message, I can check to see which aspects are flagged as dirty and only update the relevant ui parts. However, clearing these flags isn’t something I can really do in the callback, as another listener may care about that part too; if that is the case, the only time I can safely clear the flags is at the point where the last listener has been notified.
Of course, I guess I could instead pass a pointer to some dummy ‘aspect’ variable as the change source… When I get a change message I can check against that exposed member of my source; only problem there is that I might not only be listening for that source object - also, that would mean multiple messages, whereas if several aspects change at once using the first method, they could be coalesced into a single message. Also, a dummy member is a little abstract a concept and not quite as intuitive.
So, I ask ‘what would the wise one do?’. I know i could make a different message handler, but everything else about changebroadcaster is bang on so i’m simply being a combination of lazy and greedy. like a big fat sloth.