The Gaudi Framework  v29r0 (ff2e7097)
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
 
typedef std::function< StatusCode(FILEMGR_CALLBACK_ARGS)> bfcn_action_t
 

Enumerations

enum  IoFlag {
  READ = O_RDONLY, WRITE = O_WRONLY, RDWR = O_RDWR, CREATE = O_CREAT,
  EXCL = O_EXCL, TRUNC = O_TRUNC, APPEND = O_APPEND, INVALID = 1 << 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::ostreamoperator<< (std::ostream &s, const IoFlag &f)
 
std::ostreamoperator<< (std::ostream &s, const IoFlags &f)
 
std::ostreamoperator<< (std::ostream &s, const IoTech &t)
 
std::ostreamoperator<< (std::ostream &s, const Action &t)
 

Typedef Documentation

Definition at line 254 of file IFileMgr.h.

Definition at line 255 of file IFileMgr.h.

Definition at line 253 of file IFileMgr.h.

Definition at line 256 of file IFileMgr.h.

Definition at line 257 of file IFileMgr.h.

typedef int Io::close_t

Definition at line 250 of file IFileMgr.h.

typedef int Io::Fd

Definition at line 171 of file IFileMgr.h.

typedef int Io::open_t

Definition at line 249 of file IFileMgr.h.

typedef int Io::reopen_t

Definition at line 251 of file IFileMgr.h.

Enumeration Type Documentation

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

Definition at line 284 of file IFileMgr.h.

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

Definition at line 26 of file IFileMgr.h.

26  {
27  READ = O_RDONLY,
28  WRITE = O_WRONLY,
29  RDWR = O_RDWR,
30 
31  CREATE = O_CREAT,
32  EXCL = O_EXCL,
33  TRUNC = O_TRUNC,
34 
35  APPEND = O_APPEND,
36 
37  INVALID = 1 << 31
38  };
enum Io::IoTech
Enumerator
UNKNOWN 
POSIX 
ROOT 
BS 
HDF5 
SQLITE 

Definition at line 157 of file IFileMgr.h.

Function Documentation

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

Definition at line 110 of file IFileMgr.h.

111  {
112  static const std::map<std::string, IoFlag> s_n = {{{"READ", Io::READ},
113  {"WRITE", Io::WRITE},
114  {"RDWR", Io::RDWR},
115  {"CREATE", Io::CREATE},
116  {"EXCL", Io::EXCL},
117  {"TRUNC", Io::TRUNC},
118  {"APPEND", Io::APPEND},
119  {"INVALID", Io::INVALID}}};
120 
121  IoFlags fl( Io::INVALID );
122  size_t j( 0 ), k( 0 );
123  std::string fs;
124  while ( ( k = f.find( "|", j ) ) != std::string::npos ) {
125  fs = f.substr( j, k - j );
126  if ( s_n.find( fs ) == s_n.end() ) {
127  return Io::INVALID;
128  }
129  if ( fl.isInvalid() ) {
130  fl = s_n.at( fs );
131  } else {
132  fl = fl | s_n.at( fs );
133  }
134  j = k + 1;
135  }
136  fs = f.substr( j );
137  if ( s_n.find( fs ) == s_n.end() ) {
138  return Io::INVALID;
139  }
140  if ( fl.isInvalid() ) {
141  fl = s_n.at( fs );
142  } else {
143  fl = fl | s_n.at( fs );
144  }
145  return fl;
146  }
T end(T...args)
STL class.
STL class.
T at(T...args)
T find(T...args)
T substr(T...args)
std::ostream& Io::operator<< ( std::ostream s,
const IoFlag f 
)
inline

Definition at line 148 of file IFileMgr.h.

148 { return s << IoFlagName( f ); }
std::ostream& Io::operator<< ( std::ostream s,
const IoFlags f 
)
inline

Definition at line 149 of file IFileMgr.h.

149 { return s << IoFlagName( f ); }
std::ostream& Io::operator<< ( std::ostream s,
const IoTech t 
)
inline

Definition at line 159 of file IFileMgr.h.

160  {
161  static const std::array<const char*, SQLITE + 1> tbl = {{"UNKNOWN", "POSIX", "ROOT", "BS", "HDF5", "SQLITE"}};
162  return t < tbl.size() ? s << tbl[t] : s;
163  }
T size(T...args)
string s
Definition: gaudirun.py:253
STL class.
std::ostream& Io::operator<< ( std::ostream s,
const Action t 
)
inline

Definition at line 286 of file IFileMgr.h.

287  {
289  {"OPEN", "CLOSE", "REOPEN", "OPEN_ERR", "CLOSE_ERR", "REOPEN_ERR", "INVALID_ACTION"}};
290  return t < tbl.size() ? s << tbl[t] : s;
291  }
T size(T...args)
string s
Definition: gaudirun.py:253
STL class.