Definition of the MileageCalculator class.
Definition of the MileageFileHandler class.
Definition of the MileageManager class.
Interface for calculating the mileage of a vehicle.
Interface for reading and writing the mileage of a vehicle to a file.
Class that calculates the total distance traveled based on speed measurements.
Class that manages the mileage file.
MileageManager(const QString &filePath, IMileageCalculator *calculator=nullptr, IMileageFileHandler *fileHandler=nullptr, QObject *parent=nullptr)
Constructs a MileageManager object with the specified file path, calculator, and file handler.
IMileageCalculator * m_calculator
void updateMileage()
Updates the mileage.
QTimer m_persistenceTimer
void mileageUpdated(double mileage)
void shutdown()
Shuts down the MileageManager object.
void initialize()
Initializes the MileageManager object.
void saveMileage()
Saves the mileage to the file.
~MileageManager()
Destructs the MileageManager object.
IMileageFileHandler * m_fileHandler
void onSpeedUpdated(float speed)
Handles the speed updated signal.