Changeset View
Changeset View
Standalone View
Standalone View
src/dynamic/BiasSolver.h
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 73 | public: | |||
---|---|---|---|---|---|
83 | BiasSolver( int n, BiasPtr bias, Meta::TrackList context ); | 83 | BiasSolver( int n, BiasPtr bias, Meta::TrackList context ); | ||
84 | 84 | | |||
85 | ~BiasSolver(); | 85 | ~BiasSolver(); | ||
86 | 86 | | |||
87 | /// Returns the playlist generated after the job has finished. | 87 | /// Returns the playlist generated after the job has finished. | ||
88 | Meta::TrackList solution(); | 88 | Meta::TrackList solution(); | ||
89 | 89 | | |||
90 | /// Politely asks the thread to give up and finish ASAP. | 90 | /// Politely asks the thread to give up and finish ASAP. | ||
91 | void requestAbort(); | 91 | virtual void requestAbort() override; | ||
92 | 92 | | |||
93 | /** | 93 | /** | ||
94 | * Returns true if the solver was successful, false if it was | 94 | * Returns true if the solver was successful, false if it was | ||
95 | * aborted or encountered some other error. | 95 | * aborted or encountered some other error. | ||
96 | */ | 96 | */ | ||
97 | virtual bool success() const; | 97 | virtual bool success() const override; | ||
98 | 98 | | |||
99 | /** | 99 | /** | ||
100 | * Choose whether the BiasSolver instance should delete itself after the query. | 100 | * Choose whether the BiasSolver instance should delete itself after the query. | ||
101 | * By passing true the instance will delete itself after emitting done, failed. | 101 | * By passing true the instance will delete itself after emitting done, failed. | ||
102 | * Otherwise it is the responsibility of the owner to delete the instance | 102 | * Otherwise it is the responsibility of the owner to delete the instance | ||
103 | * when it is not needed anymore. | 103 | * when it is not needed anymore. | ||
104 | * | 104 | * | ||
105 | * Defaults to false, i.e. the BiasSolver instance will not delete itself. | 105 | * Defaults to false, i.e. the BiasSolver instance will not delete itself. | ||
106 | */ | 106 | */ | ||
107 | void setAutoDelete( bool autoDelete ); | 107 | void setAutoDelete( bool autoDelete ); | ||
108 | 108 | | |||
109 | /** | 109 | /** | ||
110 | * Return the universe set (a list of the uid of every track being | 110 | * Return the universe set (a list of the uid of every track being | ||
111 | * considered) being used. | 111 | * considered) being used. | ||
112 | */ | 112 | */ | ||
113 | static const QList<QByteArray>& universe(); | 113 | static const QList<QByteArray>& universe(); | ||
114 | 114 | | |||
115 | /** | 115 | /** | ||
116 | * Mark the universe set as out of date (i.e. it needs to be | 116 | * Mark the universe set as out of date (i.e. it needs to be | ||
117 | * updated). | 117 | * updated). | ||
118 | */ | 118 | */ | ||
119 | static void outdateUniverse(); | 119 | static void outdateUniverse(); | ||
120 | 120 | | |||
121 | protected: | 121 | protected: | ||
122 | void run(ThreadWeaver::JobPointer self = QSharedPointer<ThreadWeaver::Job>(), ThreadWeaver::Thread *thread = 0) Q_DECL_OVERRIDE; | 122 | void run(ThreadWeaver::JobPointer self = QSharedPointer<ThreadWeaver::Job>(), ThreadWeaver::Thread *thread = 0) override; | ||
123 | void defaultBegin(const ThreadWeaver::JobPointer& job, ThreadWeaver::Thread *thread) Q_DECL_OVERRIDE; | 123 | void defaultBegin(const ThreadWeaver::JobPointer& job, ThreadWeaver::Thread *thread) override; | ||
124 | void defaultEnd(const ThreadWeaver::JobPointer& job, ThreadWeaver::Thread *thread) Q_DECL_OVERRIDE; | 124 | void defaultEnd(const ThreadWeaver::JobPointer& job, ThreadWeaver::Thread *thread) override; | ||
125 | 125 | | |||
126 | Q_SIGNALS: | 126 | Q_SIGNALS: | ||
127 | /** a job must implement the following signals for the progress bar | 127 | /** a job must implement the following signals for the progress bar | ||
128 | BiasedPlaylist set's us as progress sender in startSolver. | 128 | BiasedPlaylist set's us as progress sender in startSolver. | ||
129 | */ | 129 | */ | ||
130 | 130 | | |||
131 | /** Sets the total steps for the progress bar (which is always 100 for the bias solver). | 131 | /** Sets the total steps for the progress bar (which is always 100 for the bias solver). | ||
132 | This signal is never emitted as the BiasedPlaylist already registers us with | 132 | This signal is never emitted as the BiasedPlaylist already registers us with | ||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |