The Gaudi Framework  v32r2 (46d42edc)
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

◆ Action_bitmap

Definition at line 269 of file IFileMgr.h.

◆ bfcn_action_t

◆ bfcn_close_t

Definition at line 238 of file IFileMgr.h.

◆ bfcn_closeP_t

Definition at line 239 of file IFileMgr.h.

◆ bfcn_open_t

Definition at line 237 of file IFileMgr.h.

◆ bfcn_reopen_t

Definition at line 240 of file IFileMgr.h.

◆ bfcn_reopenP_t

Definition at line 241 of file IFileMgr.h.

◆ close_t

typedef int Io::close_t

Definition at line 234 of file IFileMgr.h.

◆ Fd

typedef int Io::Fd

Definition at line 159 of file IFileMgr.h.

◆ open_t

typedef int Io::open_t

Definition at line 233 of file IFileMgr.h.

◆ reopen_t

typedef int Io::reopen_t

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

◆ IoFlag

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  };

◆ IoTech

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

Definition at line 146 of file IFileMgr.h.

Function Documentation

◆ IoFlagFromName()

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

Definition at line 104 of file IFileMgr.h.

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

◆ operator<<() [1/4]

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

Definition at line 137 of file IFileMgr.h.

137 { return s << IoFlagName( f ); }
string s
Definition: gaudirun.py:318

◆ operator<<() [2/4]

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

Definition at line 138 of file IFileMgr.h.

138 { return s << IoFlagName( f ); }
string s
Definition: gaudirun.py:318

◆ operator<<() [3/4]

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

Definition at line 148 of file IFileMgr.h.

148  {
149  static const std::array<const char*, SQLITE + 1> tbl = {{"UNKNOWN", "POSIX", "ROOT", "BS", "HDF5", "SQLITE"}};
150  return t < tbl.size() ? s << tbl[t] : s;
151  }
T size(T... args)
string s
Definition: gaudirun.py:318
STL class.

◆ operator<<() [4/4]

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

Definition at line 271 of file IFileMgr.h.

271  {
273  {"OPEN", "CLOSE", "REOPEN", "OPEN_ERR", "CLOSE_ERR", "REOPEN_ERR", "INVALID_ACTION"}};
274  return t < tbl.size() ? s << tbl[t] : s;
275  }
T size(T... args)
string s
Definition: gaudirun.py:318
STL class.