Implementing the BlastHSPFilter interface

BlastHSPFilter interface includes BlastHSPWriter and BlastHSPPipe.

The former is used only in preliminary stage to process BlastHSPList coming directly from scans, whereas the latter can be used in both preliminary and traceback stages to process the already-collected BlastHSPResults.

Implementations of both types are similar. As an example, to implement MyWriter, the following must be declared in hspfilter_mywriter.h and implemented in hspfilter_mywriter.c:

 extern "C" {
 // Introduce data structure to describe MyWriter filtering parameters
 typedef struct BlastHSPMyWriterParams {...} BlastHSPMyWriterParams;
 // Function to create MyWriter filtering parameters.  
 BlastHSPMyWriterParams* 
 BlastHSPMyWriterParamsNew(...);
 // Function to create the BlastWriterInfo structure associated with MyWriter.
 BlastHSPWriterInfo*
 BlastHSPMyWriterInfoNew(BlastHSPMyWriterParams*);
 }

In addition, the following should be implemented in hspfilter_mywriter.c:

 extern "C" {
 // Any auxillary data structures MyWriter may use to store between-call data.
 typedef struct MyWriterData {...} MyWriterData;
 // The following are functions to implement BlastHSPWriter interface.
 // Function to initiate MyWriterData from BlastHSPResults
 static int s_MyWriterInit(void*, BlastHSPResults*);
 // Function to finalize MyWriterData to BlastHSPResults
 static int s_MyWriterFinal(void*, BlastHSPResults*);
 // Function to process BlastHSPList and save results to MyWriterData
 // Must call Blast_HSPListFree() before returning
 static int s_MyWriterRun(void*, BlastHSPList*);
 // Function to free MyWriter.
 // Must free mywriter parameters before returning
 static BlastHSPWriter* s_MyWriterFree(BlastHSPWriter*);
 // Function to create MyWriter.
 static BlastHSPWriter* s_MyWriterNew(void*, BlastQueryInfo*);
 }

Generated on Mon Dec 7 16:01:19 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:35 2009 by modify_doxy.py rev. 173732