CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StreamerFileIO.h
Go to the documentation of this file.
1 #ifndef IOPool_Streamer_StreamerFileIO_h
2 #define IOPool_Streamer_StreamerFileIO_h
3 
10 #include "boost/shared_ptr.hpp"
11 #include <iosfwd>
12 #include <string>
13 
14 //-------------------------------------------------------
15 
16 class OutputFile
20  {
21  public:
22  explicit OutputFile(const std::string& name);
26  ~OutputFile();
27 
28  bool write(const char *ptr, size_t n);
29 
30  std::string fileName() const { return filename_; }
34  uint64 events() const { return events_; }
35  uint64 run() const { return run_; }
36  uint32 adler32() const { return (adlerb_ << 16) | adlera_; }
37 
38  void set_do_adler(bool v) { do_adler_ = v; }
42  void set_events(uint64 v) { events_ = v; }
43  void inc_events() { ++events_; }
44  void set_run(uint64 v) { run_ = v; }
45 
46  private:
52 
53  bool do_adler_;
56 
57  boost::shared_ptr<std::ofstream> ost_;
58  std::string filename_;
59  };
60 
61 #endif
void set_run(uint64 v)
uint64 current_offset_
uint32 events_
uint32 adler32() const
boost::shared_ptr< std::ofstream > ost_
uint64 current_offset() const
std::string filename_
uint64 run() const
uint64 first_event_offset_
OutputFile(const std::string &name)
uint64 events() const
uint64 first_event_offset() const
void set_first_event_offset(uint64 v)
bool write(const char *ptr, size_t n)
uint64 last_event_offset() const
void set_do_adler(bool v)
uint64 last_event_offset_
void set_current_offset(uint64 v)
void set_last_event_offset(uint64 v)
unsigned int uint32
Definition: MsgTools.h:13
unsigned long long uint64
Definition: MsgTools.h:14
void inc_events()
std::string fileName() const
void set_events(uint64 v)
uint32 adlerb_
mathSSE::Vec4< T > v
uint32 adlera_