The Obsever pattern (or something similar) using a global update() function in C++?
<p>I am creating an MVC application in C++ and I want the lower level model classes to be able to update the GUI with simple text to display output to the reader. I don't want to have to pass around function or object pointers as it would get messy and I would have to pass them around all over the place. What I essentially want is the equivalent to 'cout' for a console GUI - some sort of global function that can be called to update the GUI from anywhere without having to know anything about the GUI.</p>

<p>I've mentioned the Observer pattern in the title because it sounds a lot like that - the GUI could subscribe to this global object or function in someway and listen for when it is called. However, I'm not specifically looking for a solution using Observer.</p>

<p>People have mentioned signals and slots to me but surely, unless global, you are still required to 'pass things around' to allow objects to emit the signals. Again, a global point of reference would be helpful.</p>

<p>How can I do this while ensuring that good design principles are adhered to?</p>
