The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Io Namespace Reference

Classes

class  FileAttr
 
struct  FileHdlr
 
class  IoFlags
 

Typedefs

typedef int Fd
 
typedef int open_t
 
typedef int close_t
 
typedef int reopen_t
 
typedef std::function< Io::open_t(const std::string &, Io::IoFlags, const std::string &, Io::Fd &, void *&)> bfcn_open_t
 
typedef std::function< Io::close_t(Io::Fd)> bfcn_close_t
 
typedef std::function< Io::close_t(void *)> bfcn_closeP_t
 
typedef std::function< Io::reopen_t(Io::Fd, Io::IoFlags)> bfcn_reopen_t
 
typedef std::function< Io::reopen_t(void *, Io::IoFlags)> bfcn_reopenP_t
 
using Action_bitmap = std::bitset<INVALID_ACTION + 1>
 
typedef std::function< StatusCode(FILEMGR_CALLBACK_ARGS)> bfcn_action_t
 

Enumerations

enum  IoFlag : unsigned {
  READ = O_RDONLY , WRITE = O_WRONLY , RDWR = O_RDWR , CREATE = O_CREAT ,
  EXCL = O_EXCL , TRUNC = O_TRUNC , APPEND = O_APPEND , INVALID = 1u << 31
}
 
enum  IoTech {
  UNKNOWN , POSIX , ROOT , BS ,
  HDF5 , SQLITE
}
 
enum  Action {
  OPEN = 0 , CLOSE , REOPEN , OPEN_ERR ,
  CLOSE_ERR , REOPEN_ERR , INVALID_ACTION
}
 

Functions

IoFlags IoFlagFromName (const std::string &f)
 
std::ostream & operator<< (std::ostream &s, const IoFlag &f)
 
std::ostream & operator<< (std::ostream &s, const IoFlags &f)
 
std::ostream & operator<< (std::ostream &s, const IoTech &t)
 
std::ostream & operator<< (std::ostream &s, const Action &t)
 

Typedef Documentation

◆ Action_bitmap

using Io::Action_bitmap = std::bitset<INVALID_ACTION + 1>

Definition at line 264 of file IFileMgr.h.

◆ bfcn_action_t

Definition at line 273 of file IFileMgr.h.

◆ bfcn_close_t

typedef std::function<Io::close_t( Io::Fd )> Io::bfcn_close_t

Definition at line 235 of file IFileMgr.h.

◆ bfcn_closeP_t

typedef std::function<Io::close_t( void* )> Io::bfcn_closeP_t

Definition at line 236 of file IFileMgr.h.

◆ bfcn_open_t

typedef std::function<Io::open_t( const std::string&, Io::IoFlags, const std::string&, Io::Fd&, void*& )> Io::bfcn_open_t

Definition at line 234 of file IFileMgr.h.

◆ bfcn_reopen_t

typedef std::function<Io::reopen_t( Io::Fd, Io::IoFlags )> Io::bfcn_reopen_t

Definition at line 237 of file IFileMgr.h.

◆ bfcn_reopenP_t

typedef std::function<Io::reopen_t( void*, Io::IoFlags )> Io::bfcn_reopenP_t

Definition at line 238 of file IFileMgr.h.

◆ close_t

typedef int Io::close_t

Definition at line 231 of file IFileMgr.h.

◆ Fd

typedef int Io::Fd

Definition at line 158 of file IFileMgr.h.

◆ open_t

typedef int Io::open_t

Definition at line 230 of file IFileMgr.h.

◆ reopen_t

typedef int Io::reopen_t

Definition at line 232 of file IFileMgr.h.

Enumeration Type Documentation

◆ Action

enum Io::Action
Enumerator
OPEN 
CLOSE 
REOPEN 
OPEN_ERR 
CLOSE_ERR 
REOPEN_ERR 
INVALID_ACTION 

Definition at line 263 of file IFileMgr.h.

@ OPEN
Definition IFileMgr.h:263
@ CLOSE
Definition IFileMgr.h:263
@ REOPEN
Definition IFileMgr.h:263
@ OPEN_ERR
Definition IFileMgr.h:263
@ CLOSE_ERR
Definition IFileMgr.h:263
@ INVALID_ACTION
Definition IFileMgr.h:263
@ REOPEN_ERR
Definition IFileMgr.h:263

◆ IoFlag

enum Io::IoFlag : unsigned
Enumerator
READ 
WRITE 
RDWR 
CREATE 
EXCL 
TRUNC 
APPEND 
INVALID 

Definition at line 29 of file IFileMgr.h.

29 : unsigned {
30 READ = O_RDONLY,
31 WRITE = O_WRONLY,
32 RDWR = O_RDWR,
33
34 CREATE = O_CREAT,
35 EXCL = O_EXCL,
36 TRUNC = O_TRUNC,
37
38 APPEND = O_APPEND,
39
40 INVALID = 1u << 31
41 };
@ READ
Definition IFileMgr.h:30
@ INVALID
Definition IFileMgr.h:40
@ TRUNC
Definition IFileMgr.h:36
@ CREATE
Definition IFileMgr.h:34
@ RDWR
Definition IFileMgr.h:32
@ WRITE
Definition IFileMgr.h:31
@ EXCL
Definition IFileMgr.h:35
@ APPEND
Definition IFileMgr.h:38

◆ IoTech

enum Io::IoTech
Enumerator
UNKNOWN 
POSIX 
ROOT 
BS 
HDF5 
SQLITE 

Definition at line 147 of file IFileMgr.h.

147{ UNKNOWN, POSIX, ROOT, BS, HDF5, SQLITE };
@ BS
Definition IFileMgr.h:147
@ HDF5
Definition IFileMgr.h:147
@ UNKNOWN
Definition IFileMgr.h:147
@ POSIX
Definition IFileMgr.h:147
@ SQLITE
Definition IFileMgr.h:147

Function Documentation

◆ IoFlagFromName()

IoFlags Io::IoFlagFromName ( const std::string & f)
inline

Definition at line 107 of file IFileMgr.h.

107 {
108 static const std::map<std::string, IoFlag> s_n = { { { "READ", Io::READ },
109 { "WRITE", Io::WRITE },
110 { "RDWR", Io::RDWR },
111 { "CREATE", Io::CREATE },
112 { "EXCL", Io::EXCL },
113 { "TRUNC", Io::TRUNC },
114 { "APPEND", Io::APPEND },
115 { "INVALID", Io::INVALID } } };
116
117 IoFlags fl( Io::INVALID );
118 size_t j( 0 ), k( 0 );
119 std::string fs;
120 while ( ( k = f.find( "|", j ) ) != std::string::npos ) {
121 fs = f.substr( j, k - j );
122 if ( s_n.find( fs ) == s_n.end() ) { return Io::INVALID; }
123 if ( fl.isInvalid() ) {
124 fl = s_n.at( fs );
125 } else {
126 fl = fl | s_n.at( fs );
127 }
128 j = k + 1;
129 }
130 fs = f.substr( j );
131 if ( s_n.find( fs ) == s_n.end() ) { return Io::INVALID; }
132 if ( fl.isInvalid() ) {
133 fl = s_n.at( fs );
134 } else {
135 fl = fl | s_n.at( fs );
136 }
137 return fl;
138 }

◆ operator<<() [1/4]

std::ostream & Io::operator<< ( std::ostream & s,
const Action & t )
inline

Definition at line 266 of file IFileMgr.h.

266 {
267 static const std::array<const char*, INVALID_ACTION + 1> tbl = {
268 { "OPEN", "CLOSE", "REOPEN", "OPEN_ERR", "CLOSE_ERR", "REOPEN_ERR", "INVALID_ACTION" } };
269 return t < tbl.size() ? s << tbl[t] : s;
270 }

◆ operator<<() [2/4]

std::ostream & Io::operator<< ( std::ostream & s,
const IoFlag & f )
inline

Definition at line 140 of file IFileMgr.h.

140{ return s << IoFlagName( f ); }

◆ operator<<() [3/4]

std::ostream & Io::operator<< ( std::ostream & s,
const IoFlags & f )
inline

Definition at line 141 of file IFileMgr.h.

141{ return s << IoFlagName( f ); }

◆ operator<<() [4/4]

std::ostream & Io::operator<< ( std::ostream & s,
const IoTech & t )
inline

Definition at line 149 of file IFileMgr.h.

149 {
150 static const std::array<const char*, SQLITE + 1> tbl = { { "UNKNOWN", "POSIX", "ROOT", "BS", "HDF5", "SQLITE" } };
151 return t < tbl.size() ? s << tbl[t] : s;
152 }