CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
StreamerFileIO.h
Go to the documentation of this file.
1 #ifndef IOPool_Streamer_StreamerFileIO_h
2 #define IOPool_Streamer_StreamerFileIO_h
3 
11 #include <memory>
12 #include <iosfwd>
13 #include <string>
14 
15 //-------------------------------------------------------
16 namespace edm::streamer {
17  class OutputFile
21  {
22  public:
23  explicit OutputFile(const std::string& name, uint32 padding = 0);
27  ~OutputFile();
28 
29  bool write(const char* ptr, size_t n, bool doPadding = false);
30  bool writePadding();
31 
32  std::string fileName() const { return filename_; }
34  uint32 adler32() const { return (adlerb_ << 16) | adlera_; }
35 
36  void set_do_adler(bool v) { do_adler_ = v; }
38  void close();
39 
40  private:
43  bool do_adler_;
47 
50  std::unique_ptr<char[]> paddingBuf_;
51  };
52 } // namespace edm::streamer
53 #endif
OutputFile(const std::string &name, uint32 padding=0)
std::string fileName() const
edm::propagate_const< std::shared_ptr< std::ofstream > > ost_
uint64 current_offset() const
void set_current_offset(uint64 v)
bool write(const char *ptr, size_t n, bool doPadding=false)
unsigned long long uint64
Definition: MsgTools.h:15
std::unique_ptr< char[]> paddingBuf_
unsigned int uint32
Definition: MsgTools.h:14