-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy paththreadconfig.h
61 lines (51 loc) · 1.6 KB
/
threadconfig.h
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
58
59
60
61
#ifndef THREAD_CONFIG_H
#define THREAD_CONFIG_H
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include "stats.h"
#include "writer.h"
#include "options.h"
#include "filterresult.h"
using namespace std;
class ThreadConfig{
public:
ThreadConfig(Options* opt, int threadId, bool paired = false);
~ThreadConfig();
inline Stats* getPreStats1() {return mPreStats1;}
inline Stats* getPostStats1() {return mPostStats1;}
inline Stats* getPreStats2() {return mPreStats2;}
inline Stats* getPostStats2() {return mPostStats2;}
inline Writer* getWriter1() {return mWriter1;}
inline Writer* getWriter2() {return mWriter2;}
inline FilterResult* getFilterResult() {return mFilterResult;}
void initWriter(string filename1);
void initWriter(string filename1, string filename2);
void initWriter(ofstream* stream);
void initWriter(ofstream* stream1, ofstream* stream2);
void initWriter(gzFile gzfile);
void initWriter(gzFile gzfile1, gzFile gzfile2);
void addFilterResult(int result, int readNum);
void addMergedPairs(int pairs);
int getThreadId() {return mThreadId;}
// for splitting output
// increase mCurrentSplitReads by readNum, and check it with options->split.size;
void markProcessed(long readNum);
bool canBeStopped();
void cleanup();
private:
void deleteWriter();
private:
Stats* mPreStats1;
Stats* mPostStats1;
Stats* mPreStats2;
Stats* mPostStats2;
Writer* mWriter1;
Writer* mWriter2;
Options* mOptions;
FilterResult* mFilterResult;
int mThreadId;
bool mCanBeStopped;
};
#endif