C++ state design pattern - change implementations of object states efficiently and exstensibly