-
-
Save Izaron/b08dbd3ce343275a027b1ef35491b02b to your computer and use it in GitHub Desktop.
This file contains 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
#pragma once | |
#include <optional> | |
#include <lib/error/error.h> | |
#include <thirdparty/include/tl/expected.hpp> | |
#include "types.h" | |
/* | |
using TByte = uint8_t; | |
using TWord = uint16_t; | |
using TLong = uint32_t; | |
using TAddressType = TLong; | |
using TDataView = std::span<const TByte>; | |
using TDataHolder = std::vector<TByte>; | |
*/ | |
namespace NMemory { | |
class IDevice { | |
public: | |
virtual tl::expected<TDataHolder, TError> Read(TAddressType addr, TAddressType size) = 0; | |
[[nodiscard]] virtual std::optional<TError> Write(TAddressType addr, TDataView data) = 0; | |
}; | |
} // namespace NMemory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment