![]() |
GM6000 Digital Heater Controller Branch: main
SDX-1330
|
This class implements the Non-volatile storage driver using a collection of NV drivers to provide a 'flat address' space that spans multiple discrete storage chips/media. More...
This class implements the Non-volatile storage driver using a collection of NV drivers to provide a 'flat address' space that spans multiple discrete storage chips/media.
The individual drivers/nv-storage-instance can be different sizes and different physical media.
The interface itself is NOT thread safe. It is the responsibility of the users/clients of the driver to handle any threading issues.
#include <Gang.h>
Public Member Functions | |
Gang (Api *drivers[]) | |
Constructor. | |
bool | start () noexcept |
See Driver::NV::Api. | |
void | stop () noexcept |
See Driver::NV::Api. | |
bool | write (size_t dstOffset, const void *srcData, size_t numBytesToWrite) noexcept |
See Driver::NV::Api. | |
bool | read (size_t srcOffset, void *dstData, size_t numBytesToRead) noexcept |
See Driver::NV::Api. | |
size_t | getNumPages () const noexcept |
See Driver::NV::Api. | |
size_t | getPageSize () const noexcept |
See Driver::NV::Api. | |
size_t | getTotalSize () const noexcept |
See Driver::NV::Api. | |
![]() | |
virtual | ~Api () |
Virtual destructor. | |
Protected Member Functions | |
bool | driverRead (Api **drivers, size_t normalizedSrcOffset, uint8_t *&dstData, size_t &numBytesToRead) noexcept |
Helper method to read data. | |
bool | driverWrite (Api **drivers, size_t normalizedDstOffset, const uint8_t *&srcData, size_t &numBytesToWrite) noexcept |
Helper method to write data. | |
Protected Attributes | |
Api ** | m_drivers |
List of drivers. | |
size_t | m_numPages |
Number of pages. | |
size_t | m_pageSize |
Page size. | |
size_t | m_totalSize |
Total size. | |
bool | m_started |
Started state. | |
Driver::NV::Gang::Gang | ( | Api * | drivers[] | ) |
Constructor.
The 'drivers' argument is a variable length array of pointers to a concrete NV drivers. The last entry in the array must be a nullptr (i.e. end-of-list marker)
|
protectednoexcept |
Helper method to read data.
|
protectednoexcept |
Helper method to write data.
|
virtualnoexcept |
See Driver::NV::Api.
The number of pages is based on the smallest page size from the various ganged drivers that fits within the total available space. When the ganged drivers have pages size that are not multiples of each other, the returned value can be just approximate number of pages.
Implements Driver::NV::Api.
|
virtualnoexcept |
See Driver::NV::Api.
The reported page size is the smallest page size from the various ganged drivers.
Implements Driver::NV::Api.
|
virtualnoexcept |
See Driver::NV::Api.
Reports the total available storage size. This method accurately returns the total amount of storage.
Reimplemented from Driver::NV::Api.
|
virtualnoexcept |
See Driver::NV::Api.
Implements Driver::NV::Api.
|
virtualnoexcept |
See Driver::NV::Api.
Implements Driver::NV::Api.
|
virtualnoexcept |
See Driver::NV::Api.
Implements Driver::NV::Api.
|
virtualnoexcept |
See Driver::NV::Api.
Implements Driver::NV::Api.
|
protected |
List of drivers.
|
protected |
Number of pages.
|
protected |
Page size.
|
protected |
Started state.
|
protected |
Total size.