-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProxy.h
43 lines (32 loc) · 912 Bytes
/
Proxy.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
//============================================================================
// Name : Proxy.h
// Created on : 12.04.2020
// Author : Tokmakov Andrey
// Version : 1.0
// Copyright : Your copyright notice
// Description : Proxy tests
//============================================================================
#ifndef PROXY_PATTERN_TESTS__H_
#define PROXY_PATTERN_TESTS__H_
#include <iostream>
#include <memory>
namespace Proxy_Pattern_Tests {
class ICar {
public:
virtual ~ICar();
virtual void DriveCar() noexcept = 0;
};
class Car : public ICar {
public:
void DriveCar() noexcept override;
};
class ProxyCar : public ICar {
private:
std::unique_ptr<ICar> real_car_ = std::make_unique<Car>();
int driver_age_;
public:
ProxyCar(int driver_age);
void DriveCar() noexcept override;
};
}
#endif /* PROXY_PATTERN_TESTS__H_ */