[yellowstone] Add a way to retrieve to denali client from yellowstone

This commit is contained in:
Drew Galbraith 2023-07-05 16:03:20 -07:00
parent b83385dfa6
commit 29d9923f5a
10 changed files with 99 additions and 7 deletions

View file

@ -16,3 +16,22 @@ class DenaliClient {
private:
glcr::UniquePtr<EndpointClient> endpoint_;
};
class ScopedDenaliClient : protected DenaliClient {
public:
ScopedDenaliClient(glcr::UniquePtr<EndpointClient> endpoint,
uint64_t device_id, uint64_t lba_offset)
: DenaliClient(glcr::Move(endpoint)),
device_id_(device_id),
lba_offset_(lba_offset) {}
glcr::ErrorOr<MappedMemoryRegion> ReadSectors(uint64_t lba,
uint64_t num_sectors) {
return DenaliClient::ReadSectors(device_id_, lba_offset_ + lba,
num_sectors);
}
private:
uint64_t device_id_;
uint64_t lba_offset_;
};