The Gaudi Framework  v30r3 (a5ef0a68)
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 {
  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 286 of file IFileMgr.h.

Definition at line 255 of file IFileMgr.h.

Definition at line 256 of file IFileMgr.h.

Definition at line 254 of file IFileMgr.h.

Definition at line 257 of file IFileMgr.h.

Definition at line 258 of file IFileMgr.h.

typedef int Io::close_t

Definition at line 251 of file IFileMgr.h.

typedef int Io::Fd

Definition at line 172 of file IFileMgr.h.

typedef int Io::open_t

Definition at line 250 of file IFileMgr.h.

typedef int Io::reopen_t

Definition at line 252 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 285 of file IFileMgr.h.

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

Definition at line 27 of file IFileMgr.h.

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

Definition at line 158 of file IFileMgr.h.

Function Documentation

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

Definition at line 111 of file IFileMgr.h.

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

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

Definition at line 150 of file IFileMgr.h.

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

Definition at line 160 of file IFileMgr.h.

161  {
162  static const std::array<const char*, SQLITE + 1> tbl = {{"UNKNOWN", "POSIX", "ROOT", "BS", "HDF5", "SQLITE"}};
163  return t < tbl.size() ? s << tbl[t] : s;
164  }
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 288 of file IFileMgr.h.

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