CMS 3D CMS Logo

Defines | Typedefs | Enumerations | Functions

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Utilities/StorageFactory/interface/IOTypes.h File Reference

#include <stdint.h>
#include <stdlib.h>

Go to the source code of this file.

Defines

#define EDM_IOFD_INVALID   -1

Typedefs

typedef int IOFD
typedef int64_t IOOffset
typedef size_t IOSize

Enumerations

enum  IOMask {
  IORead = 0x01, IOWrite = 0x02, IOUrgent = 0x04, IOAccept = 0x08,
  IOConnect = 0x10
}

Functions

IOSize IOSized (IOOffset n)

Define Documentation

#define EDM_IOFD_INVALID   -1

Typedef Documentation

typedef int IOFD

Type the system uses for channel descriptors.

Definition at line 22 of file IOTypes.h.

typedef int64_t IOOffset

Type for file offsets for I/O operations, including file sizes. This type is always compatible with large files (64-bit offsets) whether the system supports them or not. This type is signed.

Definition at line 19 of file IOTypes.h.

typedef size_t IOSize

Type for buffer sizes in I/O operations. It measures units in memory: buffer sizes, amounts to read and write, etc., and is unsigned. Never use IOSize to measure file offsets, as it is most likely smaller than the file offset type on your system!

Definition at line 14 of file IOTypes.h.


Enumeration Type Documentation

enum IOMask

I/O operation mask.

Enumerator:
IORead 
IOWrite 
IOUrgent 
IOAccept 
IOConnect 

Definition at line 25 of file IOTypes.h.

            {
  IORead        = 0x01, //< Read
  IOWrite       = 0x02, //< Write
  IOUrgent      = 0x04, //< Exceptional or urgent condition
  IOAccept      = 0x08, //< Socket accept
  IOConnect     = 0x10  //< Socket connect
};

Function Documentation

IOSize IOSized ( IOOffset  n) [inline]

Safely convert IOOffset n into a IOSize quantity. If n is larger than what IOSize can hold, it is truncated to maximum value that can be held in IOSize.

Definition at line 37 of file IOTypes.h.

Referenced by TStorageFactoryFile::ReadBuffers().

{
  // If IOSize and IOOffset are the same size, largest positive value
  // is half of maximum IOSize.  Otherwise all bits of IOSize work.
  IOOffset largest = (sizeof (IOOffset) == sizeof (IOSize)
                      ? ~IOSize(0)/2 : ~IOSize(0));
  return IOSize (n > largest ? largest : n);
}