Roll requiredSectors into readerwriter.cc.

This commit is contained in:
David Given
2022-09-16 00:26:02 +02:00
parent d0fb85e712
commit 201fd22861
3 changed files with 14 additions and 21 deletions

View File

@@ -61,7 +61,8 @@ std::unique_ptr<Decoder> Decoder::create(const DecoderProto& config)
}
std::shared_ptr<TrackDataFlux> Decoder::decodeToSectors(
std::shared_ptr<const Fluxmap> fluxmap, std::shared_ptr<const TrackInfo>& trackInfo)
std::shared_ptr<const Fluxmap> fluxmap,
std::shared_ptr<const TrackInfo>& trackInfo)
{
_trackdata = std::make_shared<TrackDataFlux>();
_trackdata->fluxmap = fluxmap;
@@ -220,16 +221,3 @@ uint64_t Decoder::readRaw64()
{
return toBytes(readRawBits(64)).reader().read_be64();
}
std::set<LogicalLocation> Decoder::requiredSectors(
std::shared_ptr<const TrackInfo>& trackInfo) const
{
const auto trackLayout =
Layout::getLayoutOfTrackPhysical(trackInfo->physicalTrack, trackInfo->physicalSide);
std::set<LogicalLocation> results;
for (unsigned sectorId : trackLayout->logicalSectorOrder)
results.insert(LogicalLocation{
trackLayout->logicalTrack, trackLayout->logicalSide, sectorId});
return results;
}