CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IOTypes.h
Go to the documentation of this file.
1 #ifndef STORAGE_FACTORY_IO_TYPES_H
2 # define STORAGE_FACTORY_IO_TYPES_H
3 
4 # include <stdint.h>
5 # include <stdlib.h>
6 
8 #define EDM_IOFD_INVALID -1
9 
14 typedef size_t IOSize;
15 
19 typedef int64_t IOOffset;
20 
22 typedef int IOFD;
23 
25 enum IOMask {
26  IORead = 0x01, //< Read
27  IOWrite = 0x02, //< Write
28  IOUrgent = 0x04, //< Exceptional or urgent condition
29  IOAccept = 0x08, //< Socket accept
30  IOConnect = 0x10 //< Socket connect
31 };
32 
36 inline IOSize
38 {
39  // If IOSize and IOOffset are the same size, largest positive value
40  // is half of maximum IOSize. Otherwise all bits of IOSize work.
41  IOOffset largest = (sizeof (IOOffset) == sizeof (IOSize)
42  ? ~IOSize(0)/2 : ~IOSize(0));
43  return IOSize (n > largest ? largest : n);
44 }
45 
46 #endif // STORAGE_FACTORY_IO_TYPES_H
IOMask
Definition: IOTypes.h:25
Definition: IOTypes.h:26
int64_t IOOffset
Definition: IOTypes.h:19
int IOFD
Definition: IOTypes.h:22
IOSize IOSized(IOOffset n)
Definition: IOTypes.h:37
size_t IOSize
Definition: IOTypes.h:14