Beispiel #1
0
// Caller's respsonsibility to allocate memory
// for string fields, Add() doesn't make copies.
// SaveGFFStrings() makes copies if needed.
void GFFSet::Add(const GFFRecord &Rec)
	{
	if (m_RecordCount > m_RecordBufferSize)
		Quit("GFFSet::Add, m_RecordCount > m_BufferSize");
	if (m_RecordCount == m_RecordBufferSize)
		{
		m_RecordBufferSize += BUFFER_SIZE_INC;
		reall(m_Recs, GFFRecord, m_RecordBufferSize);
		}
	m_Recs[m_RecordCount++] = Rec;
	}
Beispiel #2
0
static void AddCand(const HitData &Hit, IIX &IntervalIndex)
{
    if (CandCount >= CandBufferSize)
    {
        CandBufferSize += 10000;
        Cands = reall(Cands, HitData, CandBufferSize);
    }

    int From;
    int To;
    if (Hit.QueryFrom < Hit.TargetFrom)
    {
        From = Hit.QueryFrom;
        To = Hit.TargetTo;
    }
    else
    {
        From = Hit.TargetFrom;
        To = Hit.TargetTo;
    }

    IntervalIndex.AddGlobal(From, To, CandCount);
    Cands[CandCount++] = Hit;
}