I'm developing on an embedded platform using C++14 and I'm trying to design an event bus for task to task communications. I've structured by hierarchy such that the super class is of type Event * and my sub-classes are classes such as button events, logging, comms, etc. Now because I'm working on such a small embedded platform (STM32), I only want to store an array list of Event * types within the event bus and when a task submits an event for another task to consume, all I need to do is cast the Event * to the appropriate type for consuming. However, I want to avoid the situation of having huge case statements to figure out which type to cast the Event * to, as it'll be another thing to change when I add more user events to the system.
What features (if any) does C++14 offer to avoid such as situation. I'm currently reading into typeid() operator. I've also disabled RTTI too.
Thanks