File: InOutStreams.cpp

package info (click to toggle)
rna-star 2.7.8a%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,076 kB
  • sloc: cpp: 20,429; awk: 483; ansic: 470; makefile: 181; sh: 31
file content (44 lines) | stat: -rw-r--r-- 1,015 bytes parent folder | download | duplicates (3)
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
#include "InOutStreams.h"
#include "GlobalVariables.h"

InOutStreams::InOutStreams() {
    logStdOut=NULL;
    outSAM=NULL;
    outBAMfileUnsorted=NULL;
    outQuantBAMfile=NULL;
};

InOutStreams::~InOutStreams() {

    if (logStdOut!=NULL) logStdOut->flush();
    if (outSAM!=NULL) outSAM->flush();

    logStdOutFile.flush();
    outSAMfile.flush();

    outChimSAM.flush();
    outChimJunction.flush();
    logProgress.flush();
    logMain.flush();
    logFinal.flush();
    outLocalChains.flush();

    //logStdOutFile.close(); //do not want to close these log files, as some destructors (e.g. ~SharedMemory) might still write there
    //logMain.close();

    outSAMfile.close();
    outChimSAM.close();
    outChimJunction.close();
    logProgress.close();
    logFinal.close();
    outLocalChains.close();


    for (int ii=0;ii<2;ii++) {
        if (outUnmappedReadsStream[ii].is_open()) {
            outUnmappedReadsStream[ii].flush();
            outUnmappedReadsStream[ii].close();
        }
    };
};