Refactor for better multi-read support. Each read is now held separately, with

F_DESYNC being deprecated, and FluxSource returns an iterator which can be used
to retry reads.
This commit is contained in:
David Given
2022-03-07 00:07:42 +01:00
parent 78186d8a45
commit 96214bf3fd
25 changed files with 347 additions and 146 deletions

View File

@@ -30,7 +30,7 @@ struct CwfTrack
uint8_t length[4]; // little-endian
};
class CwfFluxSource : public FluxSource
class CwfFluxSource : public TrivialFluxSource
{
public:
CwfFluxSource(const CwfFluxSourceProto& config):
@@ -79,11 +79,11 @@ public:
}
public:
std::unique_ptr<Fluxmap> readFlux(int track, int side)
std::unique_ptr<const Fluxmap> readSingleFlux(int track, int side)
{
const auto& p = _trackOffsets.find(std::make_pair(track, side));
if (p == _trackOffsets.end())
return std::unique_ptr<Fluxmap>();
return std::make_unique<const Fluxmap>();
off_t pos = p->second.first;;
size_t length = p->second.second;