Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:32:01

0001 #ifndef GENERS_RPBUFFERREFERENCE_HH_
0002 #define GENERS_RPBUFFERREFERENCE_HH_
0003 
0004 #include "Alignment/Geners/interface/AbsReference.hh"
0005 #include "Alignment/Geners/interface/CharBuffer.hh"
0006 #include "Alignment/Geners/interface/streamposIO.hh"
0007 
0008 namespace gs {
0009     namespace Private {
0010         template<class Packer>
0011         class RPBufferReference : public AbsReference
0012         {
0013         public:
0014             inline RPBufferReference(const Packer& obj,
0015                                      const unsigned long long itemId)
0016                 : AbsReference(obj.ar_, obj.bufferClass_, 
0017                                "gs::RPBuffer", itemId),
0018                   obj_(obj) {}
0019 
0020             inline void restore(const unsigned long number) const
0021             {
0022                 const unsigned long long itemId = this->id(number);
0023                 assert(itemId);
0024                 std::istream& is = this->positionInputStream(itemId);
0025                 read_pod(is, &obj_.firstReadBufferRow_);
0026                 read_pod_vector(is, &obj_.readBufferOffsets_);
0027                 CharBuffer::restore(obj_.bufferClass_, is, &obj_.readBuffer_);
0028             }
0029 
0030         private:
0031             const Packer& obj_;
0032         };
0033     }
0034 }
0035 
0036 #endif // GENERS_RPBUFFERREFERENCE_HH_
0037