1 /**
2  * UGENE - Integrated Bioinformatics Tools.
3  * Copyright (C) 2008-2021 UniPro <ugene@unipro.ru>
4  * http://ugene.net
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301, USA.
20  */
21 
22 #ifndef _U2_GENOME_ALIGNER_WORKER_H_
23 #define _U2_GENOME_ALIGNER_WORKER_H_
24 
25 #include <U2Lang/LocalDomain.h>
26 #include <U2Lang/WorkflowUtils.h>
27 
28 #include "GenomeAlignerIO.h"
29 #include "GenomeAlignerTask.h"
30 
31 namespace U2 {
32 namespace LocalWorkflow {
33 
34 class GenomeAlignerPrompter : public PrompterBase<GenomeAlignerPrompter> {
35     Q_OBJECT
36 public:
37     GenomeAlignerPrompter(Actor *p = 0)
38         : PrompterBase<GenomeAlignerPrompter>(p) {
39     }
40 
41 protected:
42     QString composeRichDoc();
43 };
44 
45 class GenomeAlignerWorker : public BaseWorker {
46     Q_OBJECT
47 public:
48     GenomeAlignerWorker(Actor *a);
49     virtual void init();
50     virtual Task *tick();
51     virtual void cleanup();
52 private slots:
53     void sl_taskFinished();
54 
55 private:
56     DnaAssemblyToRefTaskSettings getSettings(U2OpStatus &os);
57 
58 protected:
59     IntegralBus *inChannel;
60     IntegralBus *output;
61 };
62 
63 class GenomeAlignerWorkerFactory : public DomainFactory {
64 public:
65     static const QString ACTOR_ID;
66     static void init();
GenomeAlignerWorkerFactory()67     GenomeAlignerWorkerFactory()
68         : DomainFactory(ACTOR_ID) {
69     }
createWorker(Actor * a)70     virtual Worker *createWorker(Actor *a) {
71         return new GenomeAlignerWorker(a);
72     }
73     static bool openclEnabled;
74 };
75 
76 }  // namespace LocalWorkflow
77 }  // namespace U2
78 
79 #endif  // GENOME_ALIGNER_WORKER
80