Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:52

0001 #ifndef GENERS_CPHEADERRECORD_HH_
0002 #define GENERS_CPHEADERRECORD_HH_
0003 
0004 #include "Alignment/Geners/interface/AbsRecord.hh"
0005 #include "Alignment/Geners/interface/binaryIO.hh"
0006 #include "Alignment/Geners/interface/CharBuffer.hh"
0007 
0008 namespace gs {
0009     namespace Private {
0010         template<class Ntuple>
0011         class CPHeaderRecord : public AbsRecord
0012         {
0013         public:
0014             inline CPHeaderRecord(const Ntuple& obj)
0015                 : AbsRecord(obj.thisClass_, "gs::CPHeader",
0016                             obj.name_.c_str(), obj.category_.c_str()),
0017                   obj_(obj) {}
0018 
0019             inline bool writeData(std::ostream& os) const
0020             {
0021                 obj_.thisClass_.write(os);
0022                 obj_.bufferClass_.write(os);
0023                 obj_.cbClass_.write(os);
0024                 write_pod_vector(os, obj_.colNames_);
0025                 write_pod(os, obj_.title_);
0026                 write_pod(os, obj_.bufferSize_);
0027                 return !os.fail() && obj_.dumpColumnClassIds(os);
0028             }
0029 
0030         private:
0031             CPHeaderRecord();
0032             const Ntuple& obj_;
0033         };
0034     }
0035 }
0036 
0037 #endif // GENERS_CPHEADERRECORD_HH_
0038