forked from huihut/interview
-
Notifications
You must be signed in to change notification settings - Fork 1
/
concrete_product.h
72 lines (63 loc) · 917 Bytes
/
concrete_product.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// Created by xiemenghui on 2018/7/20.
//
#ifndef DESIGNPATTERN_CONCRETE_PRODUCT_H
#define DESIGNPATTERN_CONCRETE_PRODUCT_H
#include "product.h"
/********** 汽车 **********/
// 奔驰
class BenzCar : public ICar
{
public:
string Name()
{
return "Benz Car";
}
};
// 宝马
class BmwCar : public ICar
{
public:
string Name()
{
return "Bmw Car";
}
};
// 奥迪
class AudiCar : public ICar
{
public:
string Name()
{
return "Audi Car";
}
};
/********** 自行车 **********/
// 奔驰
class BenzBike : public IBike
{
public:
string Name()
{
return "Benz Bike";
}
};
// 宝马
class BmwBike : public IBike
{
public:
string Name()
{
return "Bmw Bike";
}
};
// 奥迪
class AudiBike : public IBike
{
public:
string Name()
{
return "Audi Bike";
}
};
#endif //DESIGNPATTERN_CONCRETE_PRODUCT_H