Code:
class Console
{
public:
static void createInstance();
static Console* getInstance();
...
...
private:
Console();
virtual ~Console();
Console(const Console &obj);
Console& operator = (const Console &obj);
std::list<std::string> m_Messages;
...
...
};
That's about all that needs shown. createInstance() is called during setup() which is called from the main process. After that getInstance() is used. Upon shutdown the destructor calls clear on m_Messages. Fairly straightforward, somewhat modified, singleton pattern.