-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecorator.h
54 lines (37 loc) · 1.05 KB
/
Decorator.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
//============================================================================
// Name : Decorator.h
// Created on :
// Author : Tokmakov Andrey
// Version : 1.0
// Copyright : Your copyright notice
// Description : Decorator tests
//============================================================================
#ifndef DECORATOR_TESTS__H_
#define DECORATOR_TESTS__H_
#include <iostream>
#include <memory>
class IComponent {
public:
virtual void operation() = 0;
virtual ~IComponent() {}
};
class Component : public IComponent {
public:
virtual void operation();
};
class DecoratorOne : public IComponent {
std::shared_ptr<IComponent> m_component;
public:
DecoratorOne(std::shared_ptr<IComponent> component);
virtual void operation();
};
class DecoratorTwo : public IComponent {
std::shared_ptr<IComponent> m_component;
public:
DecoratorTwo(std::shared_ptr<IComponent> component);
virtual void operation();
};
namespace DecoratorTests {
void Test();
}
#endif /* DECORATOR_TESTS__H_ */