diff --git a/arch/amiga/encoder.cc b/arch/amiga/encoder.cc index 4521e1e4..5743de13 100644 --- a/arch/amiga/encoder.cc +++ b/arch/amiga/encoder.cc @@ -110,7 +110,7 @@ public: } public: - std::unique_ptr encode(std::shared_ptr& layout, + std::unique_ptr encode(std::shared_ptr& layout, const std::vector>& sectors, const Image& image) override { diff --git a/arch/apple2/encoder.cc b/arch/apple2/encoder.cc index 4c92d3a0..5d0e27d4 100644 --- a/arch/apple2/encoder.cc +++ b/arch/apple2/encoder.cc @@ -36,7 +36,7 @@ private: const Apple2EncoderProto& _config; public: - std::unique_ptr encode(std::shared_ptr& layout, + std::unique_ptr encode(std::shared_ptr& layout, const std::vector>& sectors, const Image& image) override { diff --git a/arch/brother/encoder.cc b/arch/brother/encoder.cc index b48a3a4b..aa0dd3b4 100644 --- a/arch/brother/encoder.cc +++ b/arch/brother/encoder.cc @@ -108,7 +108,7 @@ public: public: std::unique_ptr encode( - std::shared_ptr& layout, + std::shared_ptr& layout, const std::vector>& sectors, const Image& image) override { diff --git a/arch/c64/encoder.cc b/arch/c64/encoder.cc index 4dbaee6f..82d02821 100644 --- a/arch/c64/encoder.cc +++ b/arch/c64/encoder.cc @@ -175,7 +175,7 @@ public: } public: - std::unique_ptr encode(std::shared_ptr& layout, + std::unique_ptr encode(std::shared_ptr& layout, const std::vector>& sectors, const Image& image) override { diff --git a/arch/ibm/encoder.cc b/arch/ibm/encoder.cc index e28cc883..1b796838 100644 --- a/arch/ibm/encoder.cc +++ b/arch/ibm/encoder.cc @@ -107,7 +107,7 @@ private: } public: - std::unique_ptr encode(std::shared_ptr& layout, + std::unique_ptr encode(std::shared_ptr& layout, const std::vector>& sectors, const Image& image) override { diff --git a/arch/macintosh/encoder.cc b/arch/macintosh/encoder.cc index 9b20ed1a..f3519a83 100644 --- a/arch/macintosh/encoder.cc +++ b/arch/macintosh/encoder.cc @@ -220,7 +220,7 @@ public: } public: - std::unique_ptr encode(std::shared_ptr& layout, + std::unique_ptr encode(std::shared_ptr& layout, const std::vector>& sectors, const Image& image) override { diff --git a/arch/micropolis/encoder.cc b/arch/micropolis/encoder.cc index f26a1cc4..1b8b820c 100644 --- a/arch/micropolis/encoder.cc +++ b/arch/micropolis/encoder.cc @@ -77,7 +77,7 @@ public: { } - std::unique_ptr encode(std::shared_ptr& layout, + std::unique_ptr encode(std::shared_ptr& layout, const std::vector>& sectors, const Image& image) override { diff --git a/arch/northstar/encoder.cc b/arch/northstar/encoder.cc index 89aa2197..dbb9dfde 100644 --- a/arch/northstar/encoder.cc +++ b/arch/northstar/encoder.cc @@ -128,7 +128,7 @@ public: { } - std::unique_ptr encode(std::shared_ptr& layout, + std::unique_ptr encode(std::shared_ptr& layout, const std::vector>& sectors, const Image& image) override { diff --git a/arch/tids990/encoder.cc b/arch/tids990/encoder.cc index ea2bdd0d..2e2226d6 100644 --- a/arch/tids990/encoder.cc +++ b/arch/tids990/encoder.cc @@ -60,7 +60,7 @@ private: } public: - std::unique_ptr encode(std::shared_ptr& layout, + std::unique_ptr encode(std::shared_ptr& layout, const std::vector>& sectors, const Image& image) override { diff --git a/arch/victor9k/encoder.cc b/arch/victor9k/encoder.cc index cc839e02..a5f91681 100644 --- a/arch/victor9k/encoder.cc +++ b/arch/victor9k/encoder.cc @@ -164,7 +164,7 @@ private: } public: - std::unique_ptr encode(std::shared_ptr& layout, + std::unique_ptr encode(std::shared_ptr& layout, const std::vector>& sectors, const Image& image) override { diff --git a/lib/decoders/decoders.cc b/lib/decoders/decoders.cc index bdb180b6..db47103a 100644 --- a/lib/decoders/decoders.cc +++ b/lib/decoders/decoders.cc @@ -61,7 +61,7 @@ std::unique_ptr Decoder::create(const DecoderProto& config) } std::shared_ptr Decoder::decodeToSectors( - std::shared_ptr fluxmap, std::shared_ptr& layout) + std::shared_ptr fluxmap, std::shared_ptr& layout) { _trackdata = std::make_shared(); _trackdata->fluxmap = fluxmap; @@ -222,7 +222,7 @@ uint64_t Decoder::readRaw64() } std::set Decoder::requiredSectors( - std::shared_ptr& layout) const + std::shared_ptr& layout) const { const auto trackLayout = Layout::getLayoutOfTrackPhysical(layout->physicalTrack, layout->physicalSide); diff --git a/lib/decoders/decoders.h b/lib/decoders/decoders.h index 76b9ccd5..a50430d2 100644 --- a/lib/decoders/decoders.h +++ b/lib/decoders/decoders.h @@ -51,7 +51,7 @@ public: public: std::shared_ptr decodeToSectors( std::shared_ptr fluxmap, - std::shared_ptr& location); + std::shared_ptr& location); void pushRecord( const Fluxmap::Position& start, const Fluxmap::Position& end); @@ -90,7 +90,7 @@ public: } virtual std::set requiredSectors( - std::shared_ptr& location) const; + std::shared_ptr& location) const; protected: virtual void beginTrack(){}; diff --git a/lib/encoders/encoders.cc b/lib/encoders/encoders.cc index b24d87e3..0584bd74 100644 --- a/lib/encoders/encoders.cc +++ b/lib/encoders/encoders.cc @@ -57,13 +57,13 @@ nanoseconds_t Encoder::calculatePhysicalClockPeriod( } std::shared_ptr Encoder::getSector( - std::shared_ptr& layout, const Image& image, unsigned sectorId) + std::shared_ptr& layout, const Image& image, unsigned sectorId) { return image.get(layout->logicalTrack, layout->logicalSide, sectorId); } std::vector> Encoder::collectSectors( - std::shared_ptr& trackLayout, const Image& image) + std::shared_ptr& trackLayout, const Image& image) { std::vector> sectors; diff --git a/lib/encoders/encoders.h b/lib/encoders/encoders.h index 82f161d2..6e5d9b04 100644 --- a/lib/encoders/encoders.h +++ b/lib/encoders/encoders.h @@ -17,12 +17,12 @@ public: public: virtual std::shared_ptr getSector( - std::shared_ptr&, const Image& image, unsigned sectorId); + std::shared_ptr&, const Image& image, unsigned sectorId); virtual std::vector> collectSectors( - std::shared_ptr&, const Image& image); + std::shared_ptr&, const Image& image); - virtual std::unique_ptr encode(std::shared_ptr& layout, + virtual std::unique_ptr encode(std::shared_ptr& layout, const std::vector>& sectors, const Image& image) = 0; diff --git a/lib/flux.h b/lib/flux.h index aa0d7165..dafd664d 100644 --- a/lib/flux.h +++ b/lib/flux.h @@ -6,7 +6,7 @@ class Fluxmap; class Sector; class Image; -class Track; +class TrackInfo; struct Record { @@ -18,7 +18,7 @@ struct Record struct TrackDataFlux { - std::shared_ptr layout; + std::shared_ptr layout; std::shared_ptr fluxmap; std::vector> records; std::vector> sectors; @@ -26,7 +26,7 @@ struct TrackDataFlux struct TrackFlux { - std::shared_ptr layout; + std::shared_ptr layout; std::vector> trackDatas; std::set> sectors; }; diff --git a/lib/layout.cc b/lib/layout.cc index 5b18d461..8311f2fb 100644 --- a/lib/layout.cc +++ b/lib/layout.cc @@ -4,7 +4,7 @@ #include "lib/environment.h" #include -static Local, std::shared_ptr>> +static Local, std::shared_ptr>> layoutCache; static unsigned getTrackStep() @@ -38,7 +38,7 @@ unsigned Layout::remapSideLogicalToPhysical(unsigned lside) return lside ^ config.layout().swap_sides(); } -std::vector> Layout::computeLocations() +std::vector> Layout::computeLocations() { std::set tracks; if (config.has_tracks()) @@ -52,7 +52,7 @@ std::vector> Layout::computeLocations() else heads = iterate(0, config.layout().sides()); - std::vector> locations; + std::vector> locations; for (unsigned logicalTrack : tracks) { for (unsigned logicalHead : heads) @@ -125,13 +125,13 @@ std::vector Layout::expandSectorList( return sectors; } -std::shared_ptr Layout::getLayoutOfTrack( +std::shared_ptr Layout::getLayoutOfTrack( unsigned logicalTrack, unsigned logicalSide) { auto& layout = (*layoutCache)[std::make_pair(logicalTrack, logicalSide)]; if (!layout) { - layout = std::make_shared(); + layout = std::make_shared(); LayoutProto::LayoutdataProto layoutdata; for (const auto& f : config.layout().layoutdata()) @@ -190,7 +190,7 @@ std::shared_ptr Layout::getLayoutOfTrack( return layout; } -std::shared_ptr Layout::getLayoutOfTrackPhysical( +std::shared_ptr Layout::getLayoutOfTrackPhysical( unsigned physicalTrack, unsigned physicalSide) { return getLayoutOfTrack(remapTrackPhysicalToLogical(physicalTrack), diff --git a/lib/layout.h b/lib/layout.h index 4f4282cd..8780da36 100644 --- a/lib/layout.h +++ b/lib/layout.h @@ -4,7 +4,7 @@ #include "lib/flux.h" class SectorListProto; -class Track; +class TrackInfo; class Layout { @@ -25,7 +25,7 @@ public: /* Uses the layout and current track and heads settings to determine * which Locations are going to be read from or written to. 8/ */ - static std::vector> computeLocations(); + static std::vector> computeLocations(); /* Returns a series of pairs representing the filesystem * ordering of the disk, in logical numbers. */ @@ -33,11 +33,11 @@ public: unsigned guessedTracks = 0, unsigned guessedSides = 0); /* Returns the layout of a given track. */ - static std::shared_ptr getLayoutOfTrack( + static std::shared_ptr getLayoutOfTrack( unsigned logicalTrack, unsigned logicalHead); /* Returns the layout of a given track via physical location. */ - static std::shared_ptr getLayoutOfTrackPhysical( + static std::shared_ptr getLayoutOfTrackPhysical( unsigned physicalTrack, unsigned physicalSide); /* Expand a SectorList into the actual sector IDs. */ @@ -45,14 +45,14 @@ public: const SectorListProto& sectorsProto); }; -class Track { +class TrackInfo { public: - Track() {} + TrackInfo() {} private: /* Can't copy. */ - Track(const Track&); - Track& operator=(const Track&); + TrackInfo(const TrackInfo&); + TrackInfo& operator=(const TrackInfo&); public: unsigned numTracks = 0; diff --git a/lib/readerwriter.cc b/lib/readerwriter.cc index 6a273136..b751a598 100644 --- a/lib/readerwriter.cc +++ b/lib/readerwriter.cc @@ -156,7 +156,7 @@ static std::set> collectSectors( BadSectorsState combineRecordAndSectors(TrackFlux& trackFlux, Decoder& decoder, - std::shared_ptr& layout) + std::shared_ptr& layout) { std::set> track_sectors; @@ -182,7 +182,7 @@ BadSectorsState combineRecordAndSectors(TrackFlux& trackFlux, } ReadResult readGroup(FluxSourceIteratorHolder& fluxSourceIteratorHolder, - std::shared_ptr& layout, + std::shared_ptr& layout, TrackFlux& trackFlux, Decoder& decoder) { @@ -224,9 +224,9 @@ ReadResult readGroup(FluxSourceIteratorHolder& fluxSourceIteratorHolder, void writeTracks(FluxSink& fluxSink, std::function( - std::shared_ptr& layout)> producer, - std::function& layout)> verifier, - std::vector>& layouts) + std::shared_ptr& layout)> producer, + std::function& layout)> verifier, + std::vector>& layouts) { Logger() << BeginOperationLogMessage{"Encoding and writing to disk"}; @@ -294,11 +294,11 @@ void writeTracks(FluxSink& fluxSink, void writeTracks(FluxSink& fluxSink, Encoder& encoder, const Image& image, - std::vector>& layouts) + std::vector>& layouts) { writeTracks( fluxSink, - [&](std::shared_ptr& layout) + [&](std::shared_ptr& layout) { auto sectors = encoder.collectSectors(layout, image); return encoder.encode(layout, sectors, image); @@ -315,16 +315,16 @@ void writeTracksAndVerify(FluxSink& fluxSink, FluxSource& fluxSource, Decoder& decoder, const Image& image, - std::vector>& locations) + std::vector>& locations) { writeTracks( fluxSink, - [&](std::shared_ptr& layout) + [&](std::shared_ptr& layout) { auto sectors = encoder.collectSectors(layout, image); return encoder.encode(layout, sectors, image); }, - [&](std::shared_ptr& layout) + [&](std::shared_ptr& layout) { auto trackFlux = std::make_shared(); trackFlux->layout = layout; @@ -381,7 +381,7 @@ void writeDiskCommand(const Image& image, FluxSink& fluxSink, Decoder* decoder, FluxSource* fluxSource, - std::vector>& locations) + std::vector>& locations) { if (fluxSource && decoder) writeTracksAndVerify( @@ -405,7 +405,7 @@ void writeRawDiskCommand(FluxSource& fluxSource, FluxSink& fluxSink) auto locations = Layout::computeLocations(); writeTracks( fluxSink, - [&](std::shared_ptr& layout) + [&](std::shared_ptr& layout) { return fluxSource .readFlux(layout->physicalTrack, layout->physicalSide) @@ -420,7 +420,7 @@ void writeRawDiskCommand(FluxSource& fluxSource, FluxSink& fluxSink) std::shared_ptr readAndDecodeTrack(FluxSource& fluxSource, Decoder& decoder, - std::shared_ptr& layout) + std::shared_ptr& layout) { auto trackFlux = std::make_shared(); trackFlux->layout = layout; diff --git a/lib/readerwriter.h b/lib/readerwriter.h index a03a5b18..c89f5068 100644 --- a/lib/readerwriter.h +++ b/lib/readerwriter.h @@ -11,7 +11,7 @@ class Fluxmap; class Image; class ImageReader; class ImageWriter; -class Track; +class TrackInfo; class TrackFlux; extern void measureDiskRotation( @@ -19,15 +19,15 @@ extern void measureDiskRotation( extern void writeTracks(FluxSink& fluxSink, const std::function( - std::shared_ptr& layout)> producer, - std::vector>& locations); + std::shared_ptr& layout)> producer, + std::vector>& locations); extern void writeTracksAndVerify(FluxSink& fluxSink, Encoder& encoder, FluxSource& fluxSource, Decoder& decoder, const Image& image, - std::vector>& locations); + std::vector>& locations); extern void fillBitmapTo(std::vector& bitmap, unsigned& cursor, @@ -39,7 +39,7 @@ extern void writeDiskCommand(const Image& image, FluxSink& fluxSink, Decoder* decoder, FluxSource* fluxSource, - std::vector>& locations); + std::vector>& locations); extern void writeDiskCommand(const Image& image, Encoder& encoder, @@ -51,7 +51,7 @@ extern void writeRawDiskCommand(FluxSource& fluxSource, FluxSink& fluxSink); extern std::shared_ptr readAndDecodeTrack(FluxSource& fluxSource, Decoder& decoder, - std::shared_ptr& layout); + std::shared_ptr& layout); extern std::shared_ptr readDiskCommand( FluxSource& fluxsource, Decoder& decoder); diff --git a/lib/sector.cc b/lib/sector.cc index 57dcf513..07a59d8d 100644 --- a/lib/sector.cc +++ b/lib/sector.cc @@ -10,7 +10,7 @@ Sector::Sector(const LogicalLocation& location): physicalSide(Layout::remapSideLogicalToPhysical(location.logicalSide)) {} -Sector::Sector(std::shared_ptr& layout, unsigned sectorId): +Sector::Sector(std::shared_ptr& layout, unsigned sectorId): LogicalLocation({ layout->logicalTrack, layout->logicalSide, sectorId }), physicalTrack(layout->physicalTrack), physicalSide(layout->physicalSide) diff --git a/lib/sector.h b/lib/sector.h index 6ca617fb..d5fd269e 100644 --- a/lib/sector.h +++ b/lib/sector.h @@ -5,7 +5,7 @@ #include "fluxmap.h" class Record; -class Track; +class TrackInfo; struct LogicalLocation { @@ -65,7 +65,7 @@ struct Sector : public LogicalLocation Sector() {} - Sector(std::shared_ptr& layout, unsigned sectorId=0); + Sector(std::shared_ptr& layout, unsigned sectorId=0); Sector(const LogicalLocation& location); diff --git a/lib/vfs/fluxsectorinterface.cc b/lib/vfs/fluxsectorinterface.cc index 480f7139..3e4ef294 100644 --- a/lib/vfs/fluxsectorinterface.cc +++ b/lib/vfs/fluxsectorinterface.cc @@ -56,7 +56,7 @@ public: void flushChanges() override { - std::vector> locations; + std::vector> locations; for (const auto& trackid : _changedTracks) { diff --git a/src/gui/fluxviewercontrol.cc b/src/gui/fluxviewercontrol.cc index cb2a848b..047ad74b 100644 --- a/src/gui/fluxviewercontrol.cc +++ b/src/gui/fluxviewercontrol.cc @@ -434,7 +434,7 @@ void FluxViewerControl::ShowSectorMenu(std::shared_ptr sector) PopupMenu(&menu, _mouseX, _mouseY); } -void FluxViewerControl::ShowRecordMenu(std::shared_ptr& layout, +void FluxViewerControl::ShowRecordMenu(std::shared_ptr& layout, std::shared_ptr record) { wxMenu menu; @@ -502,7 +502,7 @@ void FluxViewerControl::DisplayRawData(std::shared_ptr sector) TextViewerWindow::Create(this, title, s.str())->Show(); } -void FluxViewerControl::DisplayRawData(std::shared_ptr& layout, +void FluxViewerControl::DisplayRawData(std::shared_ptr& layout, std::shared_ptr record) { std::stringstream s; diff --git a/src/gui/fluxviewercontrol.h b/src/gui/fluxviewercontrol.h index 35c21325..d3fbac5c 100644 --- a/src/gui/fluxviewercontrol.h +++ b/src/gui/fluxviewercontrol.h @@ -8,7 +8,7 @@ class wxScrollBar; class wxScrollEvent; class Sector; class Record; -class Track; +class TrackInfo; class FluxViewerControl : public wxWindow { @@ -27,11 +27,11 @@ public: private: void UpdateScale(); void ShowSectorMenu(std::shared_ptr sector); - void ShowRecordMenu(std::shared_ptr& layout, + void ShowRecordMenu(std::shared_ptr& layout, std::shared_ptr record); void DisplayDecodedData(std::shared_ptr sector); void DisplayRawData(std::shared_ptr sector); - void DisplayRawData(std::shared_ptr& layout, + void DisplayRawData(std::shared_ptr& layout, std::shared_ptr record); private: