/
RecordWriter.h
70 lines (54 loc) · 1.73 KB
/
RecordWriter.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
62
63
64
65
66
67
68
69
70
#ifndef PhysicsTools_CondLiteIO_RecordWriter_h
#define PhysicsTools_CondLiteIO_RecordWriter_h
// -*- C++ -*-
//
// Package: CondLiteIO
// Class : RecordWriter
//
/**\class RecordWriter RecordWriter.h PhysicsTools/CondLiteIO/interface/RecordWriter.h
Description: Used to write the contents of an EventSetup Record to a TFile
Usage:
<usage>
*/
//
// Original Author: Chris Jones
// Created: Wed Dec 9 17:00:53 CST 2009
//
// system include files
#include <map>
// user include files
#include "FWCore/Utilities/interface/TypeIDBase.h"
#include "DataFormats/Provenance/interface/ESRecordAuxiliary.h"
// forward declarations
class TFile;
class TBranch;
class TTree;
namespace fwlite {
class RecordWriter {
public:
RecordWriter(const char* iName, TFile* iFile);
RecordWriter(const RecordWriter&) = delete; // stop default
const RecordWriter& operator=(const RecordWriter&) = delete; // stop default
virtual ~RecordWriter();
struct DataBuffer {
const void* pBuffer_;
TBranch* branch_;
edm::TypeIDBase trueType_;
};
// ---------- const member functions ---------------------
// ---------- static member functions --------------------
// ---------- member functions ---------------------------
void update(const void* iData, const std::type_info& iType, const char* iLabel);
//call update before calling write
void fill(const edm::ESRecordAuxiliary&);
void write();
private:
// ---------- member data --------------------------------
TTree* tree_;
edm::ESRecordAuxiliary aux_;
edm::ESRecordAuxiliary* pAux_;
TBranch* auxBranch_;
std::map<std::pair<edm::TypeIDBase, std::string>, DataBuffer> idToBuffer_;
};
} // namespace fwlite
#endif