- Gof/Command . . . . 11 matches
예를 들어 PasteCommand는 clipboard에 있는 text를 Document에 붙이는 기능을 지원한다. PasteCommand 의 receiver는 인스턴스화할때 설정되어있는 Docuemnt객체이다. Execute 명령은 해당 명령의 receiver인 Document의 Paste operation 을 invoke 한다.
* ConcreteCommand (PasteCommand, OpenCommand)
여기 보여지는 C++ code는 Motivation 섹션의 Command 크래스에 대한 대강의 구현이다. 우리는 OpenCommand, PasteCommand 와 MacroCommand를 정의할 것이다. 먼저 추상 Commmand class 는 이렇다.
PasteCommand 는 receiver로서 Document객체를 넘겨받아야 한다. receiver는 PasteCommand의 constructor의 parameter로서 받는다.
class PasteCommand : public Command {
PasteCommand (Document*);
PasteCommand::PasteCommand (Document* doc) {
void PasteCommand::Execute () {
Found 1 matching page out of 7540 total pages (5000 pages are searched)
You can also click here to search title.