Several Patterns for Handling States in C++