Propagator: add a bit of documentation comments

This commit is contained in:
Olivier Goffart 2014-11-18 17:54:53 +01:00
parent 1113980b20
commit 9a6710e330

View file

@ -41,31 +41,52 @@ class Account;
class SyncJournalDb; class SyncJournalDb;
class OwncloudPropagator; class OwncloudPropagator;
/**
* @class PropagatorJob
* @brief the base class of propagator jobs
*
* This can either be a job, or a container for jobs.
* If it is a composite jobs, it then inherits from PropagateDirectory
*
*
*/
class PropagatorJob : public QObject { class PropagatorJob : public QObject {
Q_OBJECT Q_OBJECT
protected: protected:
OwncloudPropagator *_propagator; OwncloudPropagator *_propagator;
public: public:
explicit PropagatorJob(OwncloudPropagator* propagator) : _propagator(propagator), _state(NotYetStarted) {}
enum JobState { enum JobState {
NotYetStarted, NotYetStarted,
Running, Running,
Finished Finished
}; };
JobState _state;
enum JobParallelism { enum JobParallelism {
/** Jobs can be run in parallel to this job */
FullParallelism, FullParallelism,
/** This job do not support parallelism, and no other job shall
be started until this one has finished */
WaitForFinished, WaitForFinished,
/** This job support paralelism with other jobs in the same directory, but it should
not be paralelized with jobs in other directories (typically a move operation) */
WaitForFinishedInParentDirectory WaitForFinishedInParentDirectory
}; };
JobState _state; virtual JobParallelism parallelism() { return FullParallelism; }
explicit PropagatorJob(OwncloudPropagator* propagator) : _propagator(propagator), _state(NotYetStarted) {}
public slots: public slots:
virtual JobParallelism parallelism() { return FullParallelism; }
virtual void abort() {} virtual void abort() {}
/** Starts this job, or a new subjob
* returns true if a job was started.
*/
virtual bool scheduleNextJob() = 0; virtual bool scheduleNextJob() = 0;
signals: signals:
/** /**
@ -79,9 +100,8 @@ signals:
void completed(const SyncFileItem &); void completed(const SyncFileItem &);
/** /**
* Emitted when all the sub-jobs have been scheduled and * Emitted when all the sub-jobs have been finished and
* we are ready and more jobs might be started * more jobs might be started (so scheduleNextJob can/must be called again)
* This signal is not always emitted.
*/ */
void ready(); void ready();