diff options
| author | 2018-10-30 05:03:25 +0100 | |
|---|---|---|
| committer | 2018-10-30 00:03:25 -0400 | |
| commit | 7a5eda59146306dedaf3e6f07f97a8c6898543dd (patch) | |
| tree | 78e07b43fb0113f95e1c8e9426d3b394b9524d4e /src/core/memory_hook.h | |
| parent | Merge pull request #1621 from lioncash/ipc (diff) | |
| download | yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.tar.gz yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.tar.xz yuzu-7a5eda59146306dedaf3e6f07f97a8c6898543dd.zip | |
global: Use std::optional instead of boost::optional (#1578)
* get rid of boost::optional
* Remove optional references
* Use std::reference_wrapper for optional references
* Fix clang format
* Fix clang format part 2
* Adressed feedback
* Fix clang format and MacOS build
Diffstat (limited to 'src/core/memory_hook.h')
| -rw-r--r-- | src/core/memory_hook.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/memory_hook.h b/src/core/memory_hook.h index 0269c7ff1..940777107 100644 --- a/src/core/memory_hook.h +++ b/src/core/memory_hook.h | |||
| @@ -5,7 +5,8 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <boost/optional.hpp> | 8 | #include <optional> |
| 9 | |||
| 9 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 10 | 11 | ||
| 11 | namespace Memory { | 12 | namespace Memory { |
| @@ -18,19 +19,19 @@ namespace Memory { | |||
| 18 | * | 19 | * |
| 19 | * A hook may be mapped to multiple regions of memory. | 20 | * A hook may be mapped to multiple regions of memory. |
| 20 | * | 21 | * |
| 21 | * If a boost::none or false is returned from a function, the read/write request is passed through | 22 | * If a std::nullopt or false is returned from a function, the read/write request is passed through |
| 22 | * to the underlying memory region. | 23 | * to the underlying memory region. |
| 23 | */ | 24 | */ |
| 24 | class MemoryHook { | 25 | class MemoryHook { |
| 25 | public: | 26 | public: |
| 26 | virtual ~MemoryHook(); | 27 | virtual ~MemoryHook(); |
| 27 | 28 | ||
| 28 | virtual boost::optional<bool> IsValidAddress(VAddr addr) = 0; | 29 | virtual std::optional<bool> IsValidAddress(VAddr addr) = 0; |
| 29 | 30 | ||
| 30 | virtual boost::optional<u8> Read8(VAddr addr) = 0; | 31 | virtual std::optional<u8> Read8(VAddr addr) = 0; |
| 31 | virtual boost::optional<u16> Read16(VAddr addr) = 0; | 32 | virtual std::optional<u16> Read16(VAddr addr) = 0; |
| 32 | virtual boost::optional<u32> Read32(VAddr addr) = 0; | 33 | virtual std::optional<u32> Read32(VAddr addr) = 0; |
| 33 | virtual boost::optional<u64> Read64(VAddr addr) = 0; | 34 | virtual std::optional<u64> Read64(VAddr addr) = 0; |
| 34 | 35 | ||
| 35 | virtual bool ReadBlock(VAddr src_addr, void* dest_buffer, std::size_t size) = 0; | 36 | virtual bool ReadBlock(VAddr src_addr, void* dest_buffer, std::size_t size) = 0; |
| 36 | 37 | ||