CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StreamDQMSerializer.h
Go to the documentation of this file.
1 #ifndef IOPool_Streamer_StreamDQMSerializer_h
2 #define IOPool_Streamer_StreamDQMSerializer_h
3 
11 #include "TBufferFile.h"
12 
14 #include <stdint.h>
15 #include <vector>
16 
17 namespace edm
18 {
19 
21  {
22 
23  public:
24 
26 
29 
30  // This object always caches the results of the last event
31  // serialization operation. You get access to the data using the
32  // following member functions.
33 
34  unsigned char* bufferPointer() const { return ptr_; }
35  unsigned int currentSpaceUsed() const { return curr_space_used_; }
36  unsigned int currentEventSize() const { return curr_event_size_; }
37  uint32_t adler32_chksum() const { return adler32_chksum_; }
38 
39  private:
40 
41  // helps to keep the data in this class exception safe
42  struct Arr
43  {
44  explicit Arr(int sz); // allocate
45  ~Arr(); // free
46 
47  char* ptr_;
48  };
49 
50  // Arr data_;
51  std::vector<unsigned char> comp_buf_; // space for compressed data
52  unsigned int curr_event_size_;
53  unsigned int curr_space_used_; // less than curr_event_size_ if compressed
54  TBufferFile rootbuf_;
55  unsigned char* ptr_; // set to the place where the last event stored
56  uint32_t adler32_chksum_; // adler32 check sum for the (compressed) data
57 
58  };
59 
60 }
61 
62 #endif
uint32_t adler32_chksum() const
int serializeDQMEvent(DQMEvent::TObjectTable &toTable, bool use_compression, int compression_level)
unsigned int currentEventSize() const
std::vector< unsigned char > comp_buf_
unsigned int currentSpaceUsed() const
unsigned char * bufferPointer() const
std::map< std::string, std::vector< TObject * > > TObjectTable