C++ command design pattern implements undo redo (CAD system)