/// Initializes the data structure and function pointers in a SeqDb based /// BlastSeqSrc. /// @param retval Structure to populate [in] [out] /// @param seqdb Reference to a CSeqDB object [in] static void s_InitNewSeqDbSrc(BlastSeqSrc* retval, TSeqDBData * datap) { _ASSERT(retval); _ASSERT(datap); /* Initialize the BlastSeqSrc structure fields with user-defined function * pointers and seqdb */ _BlastSeqSrcImpl_SetDeleteFnPtr (retval, & s_SeqDbSrcFree); _BlastSeqSrcImpl_SetCopyFnPtr (retval, & s_SeqDbSrcCopy); _BlastSeqSrcImpl_SetDataStructure (retval, (void*) datap); _BlastSeqSrcImpl_SetGetNumSeqs (retval, & s_SeqDbGetNumSeqs); _BlastSeqSrcImpl_SetGetNumSeqsStats(retval, & s_SeqDbGetNumSeqsStats); _BlastSeqSrcImpl_SetGetMaxSeqLen (retval, & s_SeqDbGetMaxLength); _BlastSeqSrcImpl_SetGetMinSeqLen (retval, & s_SeqDbGetMinLength); _BlastSeqSrcImpl_SetGetAvgSeqLen (retval, & s_SeqDbGetAvgLength); _BlastSeqSrcImpl_SetGetTotLen (retval, & s_SeqDbGetTotLen); _BlastSeqSrcImpl_SetGetTotLenStats(retval, & s_SeqDbGetTotLenStats); _BlastSeqSrcImpl_SetGetName (retval, & s_SeqDbGetName); _BlastSeqSrcImpl_SetGetIsProt (retval, & s_SeqDbGetIsProt); _BlastSeqSrcImpl_SetGetSupportsPartialFetching (retval, & s_SeqDbGetSupportsPartialFetching); _BlastSeqSrcImpl_SetSetSeqRange (retval, & s_SeqDbSetRanges); _BlastSeqSrcImpl_SetGetSequence (retval, & s_SeqDbGetSequence); _BlastSeqSrcImpl_SetGetSeqLen (retval, & s_SeqDbGetSeqLen); _BlastSeqSrcImpl_SetIterNext (retval, & s_SeqDbIteratorNext); _BlastSeqSrcImpl_SetResetChunkIterator(retval, & s_SeqDbResetChunkIterator); _BlastSeqSrcImpl_SetReleaseSequence (retval, & s_SeqDbReleaseSequence); _BlastSeqSrcImpl_SetSetNumberOfThreads (retval, & s_SeqDbSetNumberOfThreads); #ifdef KAPPA_PRINT_DIAGNOSTICS _BlastSeqSrcImpl_SetGetGis (retval, & s_SeqDbGetGiList); #endif /* KAPPA_PRINT_DIAGNOSTICS */ }
/** Multi-sequence source constructor * @param retval BlastSeqSrc structure (already allocated) to populate [in] * @param args Pointer to MultiSeqSrcNewArgs structure above [in] * @return Updated bssp structure (with all function pointers initialized) */ static BlastSeqSrc* s_MultiSeqSrcNew(BlastSeqSrc* retval, void* args) { MultiSeqSrcNewArgs* seqsrc_args = (MultiSeqSrcNewArgs*) args; MultiSeqInfo* seq_info = NULL; ASSERT(retval); ASSERT(seqsrc_args); seq_info = s_MultiSeqInfoNew(seqsrc_args->seqloc_list, seqsrc_args->program); /* Initialize the BlastSeqSrc structure fields with user-defined function * pointers and seq_info */ _BlastSeqSrcImpl_SetDeleteFnPtr(retval, &s_MultiSeqSrcFree); _BlastSeqSrcImpl_SetCopyFnPtr(retval, &s_MultiSeqSrcCopy); _BlastSeqSrcImpl_SetDataStructure(retval, (void*) seq_info); _BlastSeqSrcImpl_SetGetNumSeqs(retval, &s_MultiSeqGetNumSeqs); _BlastSeqSrcImpl_SetGetNumSeqsStats(retval, &s_MultiSeqGetNumSeqsStats); _BlastSeqSrcImpl_SetGetMaxSeqLen(retval, &s_MultiSeqGetMaxLength); _BlastSeqSrcImpl_SetGetAvgSeqLen(retval, &s_MultiSeqGetAvgLength); _BlastSeqSrcImpl_SetGetTotLen(retval, &s_MultiSeqGetTotLen); _BlastSeqSrcImpl_SetGetTotLenStats(retval, &s_MultiSeqGetTotLenStats); _BlastSeqSrcImpl_SetGetName(retval, &s_MultiSeqGetName); _BlastSeqSrcImpl_SetGetIsProt(retval, &s_MultiSeqGetIsProt); _BlastSeqSrcImpl_SetGetSequence(retval, &s_MultiSeqGetSequence); _BlastSeqSrcImpl_SetGetSeqLen(retval, &s_MultiSeqGetSeqLen); _BlastSeqSrcImpl_SetIterNext(retval, &s_MultiSeqIteratorNext); _BlastSeqSrcImpl_SetResetChunkIterator(retval, &s_MultiSeqResetChunkIter); _BlastSeqSrcImpl_SetReleaseSequence(retval, &s_MultiSeqReleaseSequence); return retval; }