设备类,继承自红黑树节点 DeviceNode Device class inheriting from Red-Black tree node DeviceNode
More...
#include <ramfs.hpp>
设备类,继承自红黑树节点 DeviceNode Device class inheriting from Red-Black tree node DeviceNode
Definition at line 171 of file ramfs.hpp.
◆ Device()
设备构造函数 Device constructor
- Parameters
-
name | 设备名称 Device name |
read_port | 读取端口(默认 ReadPort())Read port (default: ReadPort()) |
write_port | 写入端口(默认 WritePort())Write port (default: WritePort()) |
Definition at line 181 of file ramfs.hpp.
183 {
188
189 UNUSED(read_port);
190 UNUSED(write_port);
191 }
DeviceNode data_
存储的数据 (Stored data).
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值
◆ Read()
读取设备数据 Reads data from the device
- Template Parameters
-
ReadOperation | 读取操作类型 Read operation type |
- Parameters
-
op | 读取操作 Read operation |
data | 读取数据 Data to be read |
- Returns
- ErrorCode 错误码 Error code
Definition at line 202 of file ramfs.hpp.
203 {
204 return data_.read_port(data, std::forward<ReadOperation>(op));
205 }
◆ Write()
向设备写入数据 Writes data to the device
- Template Parameters
-
WriteOperation | 写入操作类型 Write operation type |
- Parameters
-
op | 写入操作 Write operation |
data | 写入数据 Data to be written |
- Returns
- ErrorCode 错误码 Error code
Definition at line 216 of file ramfs.hpp.
217 {
218 return data_.write_port(data, std::forward<WriteOperation>(op));
219 }
◆ device_type
uint32_t LibXR::RamFS::Device::device_type |
The documentation for this class was generated from the following file: