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,
  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, UNKNOWN, POSIX,
  ROOT, BS, HDF5, SQLITE
}
 
enum  Action {
  OPEN = 0, CLOSE, REOPEN, OPEN_ERR,
  CLOSE_ERR, REOPEN_ERR, INVALID_ACTION, OPEN = 0,
  CLOSE, REOPEN, OPEN_ERR, CLOSE_ERR,
  REOPEN_ERR, INVALID_ACTION
}
 
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,
  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, UNKNOWN, POSIX,
  ROOT, BS, HDF5, SQLITE
}
 
enum  Action {
  OPEN = 0, CLOSE, REOPEN, OPEN_ERR,
  CLOSE_ERR, REOPEN_ERR, INVALID_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

Definition at line 309 of file IFileMgr.h.

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

Definition at line 257 of file IFileMgr.h.

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

Definition at line 258 of file IFileMgr.h.

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

Definition at line 256 of file IFileMgr.h.

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

Definition at line 259 of file IFileMgr.h.

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

Definition at line 260 of file IFileMgr.h.

typedef int Io::close_t

Definition at line 253 of file IFileMgr.h.

typedef int Io::Fd

Definition at line 172 of file IFileMgr.h.

typedef int Io::open_t

Definition at line 252 of file IFileMgr.h.

typedef int Io::reopen_t

Definition at line 254 of file IFileMgr.h.

Enumeration Type Documentation

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

Definition at line 290 of file IFileMgr.h.

290  {
291  OPEN = 0,
292  CLOSE,
293  REOPEN,
294  OPEN_ERR,
295  CLOSE_ERR,
296  REOPEN_ERR,
298  };
enum Io::Action
Enumerator
OPEN 
CLOSE 
REOPEN 
OPEN_ERR 
CLOSE_ERR 
REOPEN_ERR 
INVALID_ACTION 
OPEN 
CLOSE 
REOPEN 
OPEN_ERR 
CLOSE_ERR 
REOPEN_ERR 
INVALID_ACTION 

Definition at line 290 of file IFileMgr.h.

290  {
291  OPEN = 0,
292  CLOSE,
293  REOPEN,
294  OPEN_ERR,
295  CLOSE_ERR,
296  REOPEN_ERR,
298  };
enum Io::IoFlag
Enumerator
READ 
WRITE 
RDWR 
CREATE 
EXCL 
TRUNC 
APPEND 
INVALID 
READ 
WRITE 
RDWR 
CREATE 
EXCL 
TRUNC 
APPEND 
INVALID 

Definition at line 25 of file IFileMgr.h.

25  {
26  READ = O_RDONLY,
27  WRITE = O_WRONLY,
28  RDWR = O_RDWR,
29 
30  CREATE = O_CREAT,
31  EXCL = O_EXCL,
32  TRUNC = O_TRUNC,
33 
34  APPEND = O_APPEND,
35 
36  INVALID = 1<<31
37  };
enum Io::IoFlag
Enumerator
READ 
WRITE 
RDWR 
CREATE 
EXCL 
TRUNC 
APPEND 
INVALID 
READ 
WRITE 
RDWR 
CREATE 
EXCL 
TRUNC 
APPEND 
INVALID 

Definition at line 25 of file IFileMgr.h.

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

Definition at line 150 of file IFileMgr.h.

150  {
151  UNKNOWN,
152  POSIX,
153  ROOT,
154  BS,
155  HDF5,
156  SQLITE
157  };
enum Io::IoTech
Enumerator
UNKNOWN 
POSIX 
ROOT 
BS 
HDF5 
SQLITE 
UNKNOWN 
POSIX 
ROOT 
BS 
HDF5 
SQLITE 

Definition at line 150 of file IFileMgr.h.

150  {
151  UNKNOWN,
152  POSIX,
153  ROOT,
154  BS,
155  HDF5,
156  SQLITE
157  };

Function Documentation

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

Definition at line 102 of file IFileMgr.h.

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

Definition at line 136 of file IFileMgr.h.

136  {
137  return s << IoFlagName(f);
138  }
string s
Definition: gaudirun.py:245
std::ostream & Io::operator<< ( std::ostream &  s,
const IoFlags f 
)
inline

Definition at line 139 of file IFileMgr.h.

139  {
140  return s << IoFlagName(f);
141 
142  }
string s
Definition: gaudirun.py:245
std::ostream & Io::operator<< ( std::ostream &  s,
const IoTech t 
)
inline

Definition at line 159 of file IFileMgr.h.

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

Definition at line 300 of file IFileMgr.h.

300  {
301  static const std::array<const char*, INVALID_ACTION+1> tbl = {
302  "OPEN", "CLOSE", "REOPEN",
303  "OPEN_ERR","CLOSE_ERR", "REOPEN_ERR",
304  "INVALID_ACTION" };
305  return t < tbl.size() ? s<< tbl[t] : s;
306  }
string s
Definition: gaudirun.py:245