Implementations of this interface should provide life-cycle functions as well as functions which satisfy the BlastSeqSrc interface.
These functions must have C linkage, as these functions are invoked by the BlastSeqSrc framework. An initialization function must also be provided, this is intended to be invoked by client code which wants to use a specific BlastSeqSrc implementation through the BlastSeqSrc interface. For example, MyDatabaseFormat implementation would define the following functions:
- Initialization function
Complete type definition of Blast Sequence Source ADT.
- Life-cycle functions
- BlastSeqSrc interface
extern "C" {
void MyDatabaseFormatSetNumberOfThreads(int);
Int4 MyDatabaseFormatGetNumSeqs(
void*,
void*);
Int4 MyDatabaseFormatGetNumSeqsStats(
void*,
void*);
Int4 MyDatabaseFormatGetMaxSeqLen(
void*,
void*);
Int4 MyDatabaseFormatGetMinSeqLen(
void*,
void*);
Int4 MyDatabaseFormatGetAvgSeqLen(
void*,
void*);
Int8 MyDatabaseFormatGetTotLen(
void*,
void*);
Int8 MyDatabaseFormatGetTotLenStats(
void*,
void*);
const char* MyDatabaseFormatGetName(void*, void*);
Boolean MyDatabaseFormatGetIsProt(
void*,
void*);
Int4 MyDatabaseFormatGetSeqLen(
void*,
void*);
Int4 MyDatabaseFormatResetChunkIterator(
void*);
}
int16_t Int2
2-byte (16-bit) signed integer
int32_t Int4
4-byte (32-bit) signed integer
int64_t Int8
8-byte (64-bit) signed integer
Uint1 Boolean
bool replacment for C
Structure used as the second argument to functions satisfying the GetSeqBlkFnPtr signature,...
Complete type definition of Blast Sequence Source Iterator.
Since the life-cycle and BlastSeqSrc interface functions above are called by the BlastSeqSrc framework (BlastSeqSrc* functions declared in blast_seqsrc.h), no exceptions should be thrown in C++ implementations. When not obvious, please see the required signature's documentation for determining what to implement (see blast_seqsrc_impl.h).
For ease of maintenance, please follow the following conventions:
- Client implementations' initialization function should be called
XBlastSeqSrcInit
, where X
is the name of the implementation
- Client implementations should reside in a file named
seqsrc_X
.[hc] or seqsrc_X
.[ch]pp, where X
is the name of the implementation.