BOSS
7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/RawFile/RawFile-00-00-10/RawFile/raw_ofstream.h
Go to the documentation of this file.
1
#ifndef BESIII_RAW_OFSTREAM_H
2
#define BESIII_RAW_OFSTREAM_H
3
4
#include "RawFile/RawFileUtil.h"
5
#include <stdint.h>
6
#include <fstream>
7
#include <string>
8
#include <pthread.h>
9
#include <assert.h>
10
11
class
raw_ofstream
:
virtual
public
std::ofstream
12
{
13
public :
14
15
static
raw_ofstream
*
instance
(
const
std::string& fname);
16
static
void
release
();
17
18
static
void
lock
() {
19
int
lstat = pthread_mutex_lock( &_pthread_lock );
20
assert( lstat == 0 );
21
};
22
static
void
unlock
() {
23
int
lstat = pthread_mutex_unlock( &_pthread_lock );
24
assert( lstat == 0 );
25
};
26
27
int
write_event
(
const
char
* pbuf,
int
size);
28
void
close
();
29
30
private
:
31
32
raw_ofstream
(
const
std::string& fname);
33
virtual
~raw_ofstream
();
34
35
void
init_fstream();
36
std::string real_fname();
37
38
raw_ofstream
();
//stop default
39
40
41
private
:
42
43
int
m_nevt;
44
int
m_nfile;
45
std::string m_fname;
46
47
FileStartRecord
m_fileStartRecord;
48
FileNameStrings
m_fileNameStrings;
49
RunParametersRecord
m_runParametersRecord;
50
DataSeparatorRecord
m_dataSeparatorRecord;
51
FileEndRecord
m_fileEndRecord;
52
53
static
int
_nHandler;
54
static
raw_ofstream
* _instance;
55
static
pthread_mutex_t _pthread_lock;
56
};
57
58
#endif
private
#define private
Definition:
Event/RootEventData/RootEventData-00-03-81/RootEventData/RootEventData_rootcint.cxx:11
DataSeparatorRecord
Definition:
Event/RawFile/RawFile-00-00-10/RawFile/RawFileUtil.h:125
FileEndRecord
Definition:
Event/RawFile/RawFile-00-00-10/RawFile/RawFileUtil.h:158
FileNameStrings
Definition:
Event/RawFile/RawFile-00-00-10/RawFile/RawFileUtil.h:64
FileStartRecord
Definition:
Event/RawFile/RawFile-00-00-10/RawFile/RawFileUtil.h:39
RunParametersRecord
Definition:
Event/RawFile/RawFile-00-00-10/RawFile/RawFileUtil.h:99
raw_ofstream
Definition:
Event/RawFile/RawFile-00-00-10/RawFile/raw_ofstream.h:12
raw_ofstream::release
static void release()
Definition:
raw_ofstream.cxx:28
raw_ofstream::close
void close()
Definition:
raw_ofstream.cxx:70
raw_ofstream::write_event
int write_event(const char *pbuf, int size)
Definition:
raw_ofstream.cxx:53
raw_ofstream::instance
static raw_ofstream * instance(const std::string &fname)
Definition:
raw_ofstream.cxx:13
raw_ofstream::lock
static void lock()
Definition:
Event/RawFile/RawFile-00-00-10/RawFile/raw_ofstream.h:18
raw_ofstream::unlock
static void unlock()
Definition:
Event/RawFile/RawFile-00-00-10/RawFile/raw_ofstream.h:22
source
Event
RawFile
RawFile-00-00-10
RawFile
raw_ofstream.h
Generated by
1.9.6