i'm currently working on a system, which needs an eventhandling. One for a global-state of the system, one for an internal state.
I thought of a class, that has a vector<string:string> that is being appended anytime, a new event is being produced. In this vector the first part would be the type of event (warning, exception etc) and the 2nd part a description. It is not seen as errorhandling, more likely than an eventhandling.
I would use this class then two times, one as instance for the globalevents and one for the internalevents.
Then I would think of implementing a search-function to search for a specific event, and functions for getting specific events, like the first/last/byIndex.
I do not want you to program that thing for me. I just like to hear (more likely read) your opinion on that, or more likely if you have any better ideas.
I think you could be more expressive and save a lotta work with something like an std::map<event_type, uint (*)(void *)> This would map an event to a callback routine handling it.
Could you explain that a bit more?