-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbridge.h
More file actions
58 lines (49 loc) · 1.11 KB
/
bridge.h
File metadata and controls
58 lines (49 loc) · 1.11 KB
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
#pragma once
#include <iostream>
#include <string>
using namespace std;
class Implemmentation
{
public:
virtual string OperationImplementation() const = 0;
};
class Concrete_Implementation_A : public Implemmentation
{
public:
string OperationImplementation() const override
{
return "Concrete_Implementation_A : result plaform A.\n" ;
}
};
class Concrete_Implementation_B : public Implemmentation
{
public:
string OperationImplementation() const override
{
return "Concrete_Implementation_B: result plaform B.\n" ;
}
};
class Abstraction
{
protected:
Implemmentation* _implementation;
public:
Abstraction(Implemmentation* implementation) : _implementation(implementation)
{
}
virtual string Operation() const
{
return "Abstraction : base operation with \n" + this->_implementation->OperationImplementation();
}
};
class ExtendedAbstraction : public Abstraction
{
public:
ExtendedAbstraction(Implemmentation* implementation) : Abstraction(implementation)
{
}
string Operation() const override
{
return "ExtendedAbstraction : operation with \n" + this->_implementation->OperationImplementation();
}
};