-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsmart_array_reader_base.hpp
More file actions
35 lines (27 loc) · 882 Bytes
/
Copy pathsmart_array_reader_base.hpp
File metadata and controls
35 lines (27 loc) · 882 Bytes
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
#pragma once
#include "drive_reader.hpp"
#include "types.hpp"
namespace sg
{
class SmartArrayReaderBase : public DriveReader
{
public:
virtual u64 driveSize() override;
protected:
// Smallest drive in the array
u64 singleDriveSize;
/// @brief Sets size of logical drive, throws std::invalid_argument
/// if provided size is bigger than maximum.
/// @param size size in bytes
/// @param maximumSize maximum size in bytes, if set to 0 then it's ignored
void setSize(u64 size, u64 maximumSize);
/// @brief Sets physical drive offset, use after setting "singleDriveSize".
/// If offset is bigger than single drive sie then std::invalid_argument is thrown
/// @param offset
void setPhysicalDriveOffset(u64 offset);
u64 getPhysicalDriveOffset();
private:
u64 size;
u64 physicalDriveOffset;
};
} // end namespace sg