-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsyncprocessorprovider.h
41 lines (33 loc) · 1.17 KB
/
syncprocessorprovider.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef SYNCPROCESSORPROVIDER_H
#define SYNCPROCESSORPROVIDER_H
#include "interface.syncprocessorcreator.h"
#include <QObject>
/*!
* \brief The SyncProcessorProvider class is a fabric of sync processors
*
* QML sends required processor typeId from table generated by this class.
* createProcessor function invokes Creator linked to particular typeId.
*/
class SyncProcessorProvider
{
Q_DISABLE_COPY(SyncProcessorProvider)
public:
static SyncProcessorProvider& getInstance();
/*!
* \brief createProcessor
* \param processorTypeId
* \param data - additional data (folder name, connection title, etc)
* \return instance of processor with typeId with interface ISyncProcessor
*/
ISyncProcessor* createProcessor(int processorTypeId, QString data);
/*!
* \brief addCreator registers new creator (and processor type)
* \param creator
*/
void addCreator(ISyncProcessorCreator* creator);
QStringList getAvailableProcessorTypes();
private:
SyncProcessorProvider() {}
QList<ISyncProcessorCreator*> creators;
};
#endif // SYNCPROCESSORPROVIDER_H