81 num_elements = (num_elements == 0) ? 10 : num_elements;
108 if ( !batches || !batch ) {
118 if ( !reallocation ) {
134 Int4 current_oid = -1,
i;
150 if (!batches || !hsp_stream) {
#define sfree(x)
Safe free a pointer: belongs to a higher level header.
const size_t kResizeFactor
factor by which these arrays are resized
BlastHSPStreamResultBatch * Blast_HSPStreamResultBatchReset(BlastHSPStreamResultBatch *batch)
free the list of HSPLists within a batch
const int kBlastHSPStream_Eof
Return value when the end of the stream is reached (applicable to read method only)
const int kBlastHSPStream_Success
Standard success return value for BlastHSPStream methods.
BlastHSPStreamResultBatch * Blast_HSPStreamResultBatchInit(Int4 num_hsplists)
create a new batch to hold HSP results
BlastHSPStreamResultBatch * Blast_HSPStreamResultBatchFree(BlastHSPStreamResultBatch *batch)
free a batch of HSP results.
int BlastHSPStreamBatchRead(BlastHSPStream *hsp_stream, BlastHSPStreamResultBatch *batch)
Batch read function for this BlastHSPStream implementation.
static Uint4 s_BlastHSPStreamCountNumOids(const BlastHSPStream *hsp_stream)
int BlastHSPStreamToHSPStreamResultsBatch(BlastHSPStream *hsp_stream, BlastHSPStreamResultsBatchArray **batches)
Extracts all data from the BlastHSPStream into its output parameters.
static BlastHSPStreamResultsBatchArray * s_BlastHSPStreamResultsBatchArrayNew(Uint4 num_elements)
Allocate a new BlastHSPStreamResultsBatchArray with the specified capacity.
static int s_BlastHSPStreamResultsBatchArrayAppend(BlastHSPStreamResultsBatchArray *batches, BlastHSPStreamResultBatch *batch)
Append a value to the array, reallocating it if necessary.
static void s_BlastHSPStreamResultsBatchArrayReset(BlastHSPStreamResultsBatchArray *it)
Reset and free the BlastHSPStreamResultBatch structures contained in the object manipulated by this f...
BlastHSPStreamResultsBatchArray * BlastHSPStreamResultsBatchNew(void)
Creates a BlastHSPStreamResultsBatchArray with a single element.
BlastHSPStreamResultsBatchArray * BlastHSPStreamResultsBatchArrayFree(BlastHSPStreamResultsBatchArray *it)
Releases memory acquired in BlastHSPStreamToHSPStreamResultsBatch.
Private interfaces to support the multi-threaded traceback in conjunction with the BlastHSPStream.
#define BLASTERR_MEMORY
System error: out of memory condition.
#define BLASTERR_INVALIDPARAM
Invalid parameter: possible programmer error or pre-condition not met.
int32_t Int4
4-byte (32-bit) signed integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
Int4 oid
The ordinal id of the subject sequence this HSP list is for.
Int4 num_queries
Number of query sequences.
structure used to hold a collection of hits retrieved from the HSPStream
Structure to extract the contents of the BlastHSPStream for MT traceback processing.
Uint4 num_batches
number of batches populated in the array_of_batches element
BlastHSPStreamResultBatch ** array_of_batches
Array of batches, each corresponding to a single OID with BLAST hits.
Uint4 num_allocated
number of batches allocated in the array_of_batches element
Default implementation of BlastHSPStream.
Int4 num_hsplists
number of HSPlists saved
BlastHSPList ** sorted_hsplists
list of all HSPlists from 'results' combined, sorted in order of decreasing subject OID
BlastHSPResults * results
Structure for saving HSP lists.
voidp calloc(uInt items, uInt size)