Namings for C++ example are not so good, I understand them as following:
Document
is aReceiver
, the object to apply the commands onReceiver
class acts asInvoker
in terms of provided UML diagram.main
method is aClient
You could take a look at Java example, it is more clean.