Created
May 11, 2016 19:17
-
-
Save agustingianni/07c5739439a70815cd95ff9fa9ee010d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AbstractMemory { | |
| public: | |
| AbstractMemory() = default; | |
| ~AbstractMemory() = default; | |
| template <typename T> size_t read(uintptr_t address, T &value) { | |
| return read(address, reinterpret_cast<void *>(&value), sizeof(T)); | |
| } | |
| template <typename T> size_t write(uintptr_t address, T value) { | |
| return write(address, reinterpret_cast<void *>(&value), sizeof(T)); | |
| } | |
| virtual bool map(uintptr_t address, size_t size, unsigned prot) = 0; | |
| virtual size_t read(uintptr_t address, void *buffer, size_t size) = 0; | |
| virtual size_t write(uintptr_t address, const void *buffer, size_t size) = 0; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment