command pattern c++