Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
threaded_blast_tool.hpp
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
22 /*
23  * threaded_blast_tool.hpp
24  *
25  * Created on: 9 Nov 2015
26  * Author: billy
27  */
28 
29 #ifndef THREADED_BLAST_TOOL_HPP_
30 #define THREADED_BLAST_TOOL_HPP_
31 
32 
33 #include "pthread.h"
34 #include "system_blast_tool.hpp"
35 
42 {
43 public:
44 
55  ThreadedBlastTool (BlastServiceJob *service_job_p, const char *name_s, const char *factory_s, const BlastServiceData *data_p, const char *blast_program_name_s);
56 
60  virtual ~ThreadedBlastTool ();
61 
68  virtual OperationStatus Run ();
69 
79  virtual char *GetResults (BlastFormatter *formatter_p);
80 
89  virtual OperationStatus GetStatus (bool update_flag = true);
90 
91 protected:
93  pthread_t *tbt_thread_p;
94 
96  pthread_mutex_t *tbt_mutex_p;
97 
100 };
101 
102 
103 
104 
105 #endif /* THREADED_BLAST_TOOL_HPP_ */
BlastServiceJob
This datatype stores the ServiceJob and its associated BlastTool.
Definition: blast_service_job.h:66
SystemBlastTool
A class that will run Blast as a system process.
Definition: system_blast_tool.hpp:39
ThreadedBlastTool
A class that will run Blast within a pthread.
Definition: threaded_blast_tool.hpp:41
BlastServiceData
The configuration data for the Blast Service.
Definition: blast_service.h:143
ThreadedBlastTool::tbt_thread_id
int tbt_thread_id
The id of the pthread to run this BlastTool in.
Definition: threaded_blast_tool.hpp:99
system_blast_tool.hpp
SystemBlastTool::GetStatus
virtual OperationStatus GetStatus(bool update_flag=true)
Get the status of a BlastTool.
ThreadedBlastTool::tbt_mutex_p
pthread_mutex_t * tbt_mutex_p
The mutex to use to moderate access to the pthread.
Definition: threaded_blast_tool.hpp:96
BLAST_SERVICE_LOCAL
#define BLAST_SERVICE_LOCAL
Definition: blast_service_api.h:48
OperationStatus
OperationStatus
The current status of an Operation.
Definition: operation.h:96
ThreadedBlastTool::tbt_thread_p
pthread_t * tbt_thread_p
The pthread to run this BlastTool in.
Definition: threaded_blast_tool.hpp:93
ExternalBlastTool::GetResults
virtual char * GetResults(BlastFormatter *formatter_p)
Get the results after the ExternalBlastTool has finished running.
BlastFormatter
This class is for converting the output of a blast job between the available different formats.
Definition: blast_formatter.h:47
SystemBlastTool::Run
virtual OperationStatus Run()
Run this BlastTool.