All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 boost::function
< Io::open_t(const std::string
&, Io::IoFlags, const
std::string &, Io::Fd &, void *&)> 
bfcn_open_t
 
typedef boost::function
< Io::close_t(Io::Fd)> 
bfcn_close_t
 
typedef boost::function
< Io::close_t(void *)> 
bfcn_closeP_t
 
typedef boost::function
< Io::reopen_t(Io::Fd,
Io::IoFlags)> 
bfcn_reopen_t
 
typedef boost::function
< Io::reopen_t(void
*, Io::IoFlags)> 
bfcn_reopenP_t
 
typedef boost::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::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

typedef boost::function<StatusCode (FILEMGR_CALLBACK_ARGS) > Io::bfcn_action_t

Definition at line 340 of file IFileMgr.h.

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

Definition at line 283 of file IFileMgr.h.

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

Definition at line 284 of file IFileMgr.h.

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

Definition at line 282 of file IFileMgr.h.

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

Definition at line 285 of file IFileMgr.h.

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

Definition at line 286 of file IFileMgr.h.

typedef int Io::close_t

Definition at line 279 of file IFileMgr.h.

typedef int Io::Fd

Definition at line 197 of file IFileMgr.h.

typedef int Io::open_t

Definition at line 278 of file IFileMgr.h.

typedef int Io::reopen_t

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

316  {
317  OPEN = 0,
318  CLOSE,
319  REOPEN,
320  OPEN_ERR,
321  CLOSE_ERR,
322  REOPEN_ERR,
324  };
enum Io::IoFlag
Enumerator
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 

Definition at line 170 of file IFileMgr.h.

170  {
171  UNKNOWN,
172  POSIX,
173  ROOT,
174  BS,
175  HDF5,
176  SQLITE
177  };

Function Documentation

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

Definition at line 114 of file IFileMgr.h.

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

Definition at line 156 of file IFileMgr.h.

156  {
157  return s << IoFlagName(f);
158  }
string s
Definition: gaudirun.py:210
std::ostream& Io::operator<< ( std::ostream &  s,
const IoFlags &  f 
)
inline

Definition at line 159 of file IFileMgr.h.

159  {
160  return s << IoFlagName(f);
161 
162  }
string s
Definition: gaudirun.py:210
std::ostream& Io::operator<< ( std::ostream &  s,
const IoTech &  t 
)
inline

Definition at line 179 of file IFileMgr.h.

179  {
180  switch (t) {
181  case UNKNOWN : return s << "UNKNOWN";
182  case POSIX : return s << "POSIX";
183  case ROOT : return s << "ROOT";
184  case BS : return s << "BS";
185  case HDF5 : return s << "HDF5";
186  case SQLITE : return s << "SQLITE";
187  }
188  return s;
189  }
string s
Definition: gaudirun.py:210
std::ostream& Io::operator<< ( std::ostream &  s,
const Action &  t 
)
inline

Definition at line 326 of file IFileMgr.h.

326  {
327  switch (t) {
328  case OPEN : return s << "OPEN";
329  case CLOSE : return s << "CLOSE";
330  case REOPEN : return s << "REOPEN";
331  case OPEN_ERR : return s << "OPEN_ERR";
332  case CLOSE_ERR : return s << "CLOSE_ERR";
333  case REOPEN_ERR : return s << "REOPEN_ERR";
334  case INVALID_ACTION : return s << "INVALID_ACTION";
335  }
336  return s;
337  }
string s
Definition: gaudirun.py:210