File: ReadReader.cpp

package info (click to toggle)
snap-aligner 2.0.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 6,652 kB
  • sloc: cpp: 41,051; ansic: 5,239; python: 227; makefile: 85; sh: 28
file content (57 lines) | stat: -rw-r--r-- 1,257 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*++

Module Name:

    ReadReader.cpp

Abstract:

    Concrete file reading classes

Environment:

    User mode service.

--*/

#include "stdafx.h"
#include "BigAlloc.h"
#include "Compat.h"
#include "Read.h"
#include "AlignmentResult.h"
#include "FileFormat.h"

class SimpleReadReader : public ReadReader
{
public:
    SimpleReadReader(const FileFormat* i_format, DataReader* i_data, const ReaderContext& i_context)
        : ReadReader(i_context), format(i_format), data(i_data), headerSize(0)
    {}

    virtual ~SimpleReadReader()
    {
        delete data;
    }

    virtual void reinit(_int64 startingOffset, _int64 amountOfFileToProcess);

    virtual bool getNextRead(Read *readToUpdate);
    
    virtual bool getNextRead(Read *read, AlignmentResult *alignmentResult, unsigned *genomeLocation, bool *isRC, unsigned *mapQ,
                    unsigned *flag, const char **cigar)
    {
        // return getNextRead(read,alignmentResult,genomeLocation,isRC,mapQ,flag,false,cigar);
    }
    
    virtual void holdBatch(DataBatch batch)
    { data->holdBatch(batch); }

    virtual bool releaseBatch(DataBatch batch)
    { return data->releaseBatch(batch); }


private:
    const FileFormat* format;
    DataReader* data;
    _int64 headerSize;
};