CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/Utilities/StorageFactory/interface/IOPosBuffer.h

Go to the documentation of this file.
00001 #ifndef STORAGE_FACTORY_IO_POS_BUFFER_H
00002 # define STORAGE_FACTORY_IO_POS_BUFFER_H
00003 
00004 # include "Utilities/StorageFactory/interface/IOTypes.h"
00005 
00007 struct IOPosBuffer
00008 {
00009 public:
00010   IOPosBuffer (void);
00011   IOPosBuffer (IOOffset offset, void *data, IOSize length);
00012   IOPosBuffer (IOOffset offset, const void *data, IOSize length);
00013 
00014   IOOffset      offset (void) const;
00015   void *        data (void) const;
00016   IOSize        size (void) const;
00017 
00018 private:
00019   IOOffset      m_offset;       //< File offset.
00020   void          *m_data;        //< Data
00021   IOSize        m_length;       //< Length of data in bytes.
00022 };
00023 
00025 inline
00026 IOPosBuffer::IOPosBuffer (void)
00027   : m_offset (0),
00028     m_data (0),
00029     m_length (0)
00030 {}
00031 
00033 inline
00034 IOPosBuffer::IOPosBuffer (IOOffset offset, void *data, IOSize length)
00035   : m_offset (offset),
00036     m_data (data),
00037     m_length (length)
00038 {}
00039 
00041 inline
00042 IOPosBuffer::IOPosBuffer (IOOffset offset, const void *data, IOSize length)
00043   : m_offset (offset),
00044     m_data (const_cast<void *> (data)),
00045     m_length (length)
00046 {}
00047 
00049 inline IOOffset
00050 IOPosBuffer::offset (void) const
00051 { return m_offset; }
00052 
00054 inline void *
00055 IOPosBuffer::data (void) const
00056 { return m_data; }
00057 
00059 inline IOSize
00060 IOPosBuffer::size (void) const
00061 { return m_length; }
00062 
00063 #endif // STORAGE_FACTORY_IO_POS_BUFFER_H