CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/Utilities/StorageFactory/interface/IOBuffer.h

Go to the documentation of this file.
00001 #ifndef STORAGE_FACTORY_IO_BUFFER_H
00002 # define STORAGE_FACTORY_IO_BUFFER_H
00003 
00004 # include "Utilities/StorageFactory/interface/IOTypes.h"
00005 
00007 class IOBuffer
00008 {
00009 public:
00010   IOBuffer (void);
00011   IOBuffer (void *data, IOSize length);
00012   IOBuffer (const void *data, IOSize length);
00013 
00014   void *        data (void) const;
00015   IOSize        size (void) const;
00016 
00017 private:
00018   void          *m_data;        //< Data
00019   IOSize        m_length;       //< Length of data in bytes.
00020 };
00021 
00023 inline
00024 IOBuffer::IOBuffer (void)
00025   : m_data (0),
00026     m_length (0)
00027 {}
00028 
00030 inline
00031 IOBuffer::IOBuffer (void *data, IOSize length)
00032   : m_data (data),
00033     m_length (length)
00034 {}
00035 
00037 inline
00038 IOBuffer::IOBuffer (const void *data, IOSize length)
00039   : m_data (const_cast<void *> (data)),
00040     m_length (length)
00041 {}
00042 
00044 inline void *
00045 IOBuffer::data (void) const
00046 { return m_data; }
00047 
00049 inline IOSize
00050 IOBuffer::size (void) const
00051 { return m_length; }
00052 
00053 #endif // STORAGE_FACTORY_IO_BUFFER_H