c++ class design