forked from yogykwan/design-patterns-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbridge.cc
More file actions
38 lines (28 loc) · 803 Bytes
/
bridge.cc
File metadata and controls
38 lines (28 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// Created by Jennica on 2016/12/29.
//
#include "bridge.h"
#include <iostream>
void HandsetGame::run() {
std::cout << "run game" << std::endl;
}
void HandsetAddressList::run() {
std::cout << "run address list" << std::endl;
}
HandsetBrand::HandsetBrand(HandsetSoft *handset_soft): handset_soft_(handset_soft) {}
HandsetBrandM::HandsetBrandM(HandsetSoft *handset_soft): HandsetBrand(handset_soft) {}
HandsetBrandM::~HandsetBrandM() {
delete handset_soft_;
}
void HandsetBrandM::run() {
std::cout << "handset brand M: ";
handset_soft_->run();
}
HandsetBrandN::HandsetBrandN(HandsetSoft *handset_soft): HandsetBrand(handset_soft) {}
HandsetBrandN::~HandsetBrandN() {
delete handset_soft_;
}
void HandsetBrandN::run() {
std::cout << "handset brand N: ";
handset_soft_->run();
}