CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RecordWriter.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_CondLiteIO_RecordWriter_h
2 #define PhysicsTools_CondLiteIO_RecordWriter_h
3 // -*- C++ -*-
4 //
5 // Package: CondLiteIO
6 // Class : RecordWriter
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Wed Dec 9 17:00:53 CST 2009
19 // $Id: RecordWriter.h,v 1.3 2010/02/19 21:13:46 chrjones Exp $
20 //
21 
22 // system include files
23 #include <map>
24 // user include files
27 
28 // forward declarations
29 class TFile;
30 class TBranch;
31 class TTree;
32 
33 namespace fwlite {
35 {
36 
37  public:
38  RecordWriter(const char* iName, TFile* iFile);
39  virtual ~RecordWriter();
40 
41  struct DataBuffer {
42  const void* pBuffer_;
43  TBranch* branch_;
45  };
46  // ---------- const member functions ---------------------
47 
48  // ---------- static member functions --------------------
49 
50  // ---------- member functions ---------------------------
51  void update(const void* iData, const std::type_info& iType, const char* iLabel);
52 
53  //call update before calling write
54  void fill(const edm::ESRecordAuxiliary&);
55 
56  void write();
57 
58  private:
59  RecordWriter(const RecordWriter&); // stop default
60 
61  const RecordWriter& operator=(const RecordWriter&); // stop default
62 
63  // ---------- member data --------------------------------
64  TTree* tree_;
67  TBranch* auxBranch_;
68  std::map<std::pair<edm::TypeIDBase,std::string>, DataBuffer> idToBuffer_;
69 };
70 }
71 
72 #endif
edm::ESRecordAuxiliary aux_
Definition: RecordWriter.h:65
edm::ESRecordAuxiliary * pAux_
Definition: RecordWriter.h:66
void fill(const edm::ESRecordAuxiliary &)
const RecordWriter & operator=(const RecordWriter &)
std::map< std::pair< edm::TypeIDBase, std::string >, DataBuffer > idToBuffer_
Definition: RecordWriter.h:68
void update(const void *iData, const std::type_info &iType, const char *iLabel)
Definition: RecordWriter.cc:73
RecordWriter(const char *iName, TFile *iFile)
Definition: RecordWriter.cc:39