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.
blast_formatter.h
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  * blast_formatter.h
24  *
25  * Created on: 8 Jan 2016
26  * Author: billy
27  */
28 
29 #ifndef BLAST_FORMATTER_H_
30 #define BLAST_FORMATTER_H_
31 
32 #include "blast_service_api.h"
33 #include "jansson.h"
34 
35 
36 // forward declarations
37 struct BlastServiceData;
38 
39 
48 {
49 public:
50  BlastFormatter ();
51 
55  virtual ~BlastFormatter ();
56 
66  static char *GetConvertedOutputFilename (const char * const filename_s, const uint32 output_format_code);
67 
76  virtual char *GetConvertedOutput (const char *job_id_s, const uint32 output_format_code, const char *custom_format_s, const struct BlastServiceData *data_p) = 0;
77 
78 
79  static bool IsCustomisableOutputFormat (const uint32 output_format_code);
80 };
81 
82 
94 {
95 public:
103  static SystemBlastFormatter *Create (const json_t *config_p);
104 
105  static const char * const SBF_LOG_SUFFIX_S;
106 
110  virtual ~SystemBlastFormatter ();
111 
122  virtual char *GetConvertedOutput (const char *job_id_s, const uint32 output_format_code, const char *custom_format_s, const BlastServiceData *data_p);
123 
124 
125  static char *GetOutputFormatAsString (const uint32 output_format_code, const char *custom_output_formats_s);
126 
127 
128 
129 protected:
132 
133  bool SaveCommandLine (const char *filename_s, const char *command_line_s);
134 
135 
136 private:
143  SystemBlastFormatter (const char * const blast_format_command_s);
144 
145 };
146 
147 #endif /* BLAST_FORMATTER_H_ */
SystemBlastFormatter::sbf_blast_formatter_command_s
const char * sbf_blast_formatter_command_s
The command line executable used to convert between the different formats.
Definition: blast_formatter.h:131
BlastServiceData
The configuration data for the Blast Service.
Definition: blast_service.h:143
blast_service_api.h
SystemBlastFormatter::SBF_LOG_SUFFIX_S
static const char *const SBF_LOG_SUFFIX_S
Definition: blast_formatter.h:105
BLAST_SERVICE_LOCAL
#define BLAST_SERVICE_LOCAL
Definition: blast_service_api.h:48
SystemBlastFormatter
This class calls a command line executable to convert a blast job between the available different for...
Definition: blast_formatter.h:93
BlastFormatter::GetConvertedOutput
virtual char * GetConvertedOutput(const char *job_id_s, const uint32 output_format_code, const char *custom_format_s, const struct BlastServiceData *data_p)=0
The function to get the converted output as a c-style string.
BlastFormatter
This class is for converting the output of a blast job between the available different formats.
Definition: blast_formatter.h:47