CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/Utilities/StorageFactory/interface/IOChannel.h

Go to the documentation of this file.
00001 #ifndef STORAGE_FACTORY_IO_CHANNEL_H
00002 # define STORAGE_FACTORY_IO_CHANNEL_H
00003 
00004 # include "Utilities/StorageFactory/interface/IOInput.h"
00005 # include "Utilities/StorageFactory/interface/IOOutput.h"
00006 
00009 class IOChannel : public virtual IOInput, public virtual IOOutput
00010 {
00011 public:
00012   IOChannel (IOFD fd = EDM_IOFD_INVALID);
00013   virtual ~IOChannel (void);
00014   // implicit copy constructor
00015   // implicit assignment operator
00016 
00017   using IOInput::read;
00018   using IOOutput::write;
00019   
00020   virtual IOSize        read (void *into, IOSize n);
00021   virtual IOSize        readv (IOBuffer *into, IOSize buffers);
00022 
00023   virtual IOSize        write (const void *from, IOSize n);
00024   virtual IOSize        writev (const IOBuffer *from, IOSize buffers);
00025 
00026   virtual IOFD          fd (void) const;
00027   virtual void          fd (IOFD value); // FIXME: dangerous?
00028 
00029   virtual void          close (void);
00030 
00031   virtual void          setBlocking (bool value);
00032   virtual bool          isBlocking (void) const;
00033 
00034 protected:
00035   // System implementation
00036   bool                  sysclose (IOFD fd, int *error = 0);
00037 
00038 private:
00039   IOFD                  m_fd;           /*< System file descriptor. */
00040 };
00041 
00042 #endif // STORAGE_FACTORY_IO_CHANNEL_H