An attempt to simulate a simple multitasking system using C++ classes