Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (77e7e51e)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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 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 : unsigned {
  READ = O_RDONLY, WRITE = O_WRONLY, RDWR = O_RDWR, CREATE = O_CREAT,
  EXCL = O_EXCL, TRUNC = O_TRUNC, APPEND = O_APPEND, INVALID = 1u << 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 279 of file IFileMgr.h.

◆ bfcn_action_t

◆ bfcn_close_t

Definition at line 248 of file IFileMgr.h.

◆ bfcn_closeP_t

Definition at line 249 of file IFileMgr.h.

◆ bfcn_open_t

Definition at line 247 of file IFileMgr.h.

◆ bfcn_reopen_t

Definition at line 250 of file IFileMgr.h.

◆ bfcn_reopenP_t

Definition at line 251 of file IFileMgr.h.

◆ close_t

typedef int Io::close_t

Definition at line 244 of file IFileMgr.h.

◆ Fd

typedef int Io::Fd

Definition at line 169 of file IFileMgr.h.

◆ open_t

typedef int Io::open_t

Definition at line 243 of file IFileMgr.h.

◆ reopen_t

typedef int Io::reopen_t

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

◆ IoFlag

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

Definition at line 36 of file IFileMgr.h.

36  : unsigned {
37  READ = O_RDONLY,
38  WRITE = O_WRONLY,
39  RDWR = O_RDWR,
40 
41  CREATE = O_CREAT,
42  EXCL = O_EXCL,
43  TRUNC = O_TRUNC,
44 
45  APPEND = O_APPEND,
46 
47  INVALID = 1u << 31
48  };

◆ IoTech

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

Definition at line 156 of file IFileMgr.h.

156 { UNKNOWN, POSIX, ROOT, BS, HDF5, SQLITE };

Function Documentation

◆ IoFlagFromName()

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

Definition at line 114 of file IFileMgr.h.

114  {
115  static const std::map<std::string, IoFlag> s_n = { { { "READ", Io::READ },
116  { "WRITE", Io::WRITE },
117  { "RDWR", Io::RDWR },
118  { "CREATE", Io::CREATE },
119  { "EXCL", Io::EXCL },
120  { "TRUNC", Io::TRUNC },
121  { "APPEND", Io::APPEND },
122  { "INVALID", Io::INVALID } } };
123 
124  IoFlags fl( Io::INVALID );
125  size_t j( 0 ), k( 0 );
126  std::string fs;
127  while ( ( k = f.find( "|", j ) ) != std::string::npos ) {
128  fs = f.substr( j, k - j );
129  if ( s_n.find( fs ) == s_n.end() ) { return Io::INVALID; }
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() ) { return Io::INVALID; }
139  if ( fl.isInvalid() ) {
140  fl = s_n.at( fs );
141  } else {
142  fl = fl | s_n.at( fs );
143  }
144  return fl;
145  }

◆ operator<<() [1/4]

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

Definition at line 281 of file IFileMgr.h.

281  {
283  { "OPEN", "CLOSE", "REOPEN", "OPEN_ERR", "CLOSE_ERR", "REOPEN_ERR", "INVALID_ACTION" } };
284  return t < tbl.size() ? s << tbl[t] : s;
285  }

◆ operator<<() [2/4]

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

Definition at line 147 of file IFileMgr.h.

147 { return s << IoFlagName( f ); }

◆ operator<<() [3/4]

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

Definition at line 148 of file IFileMgr.h.

148 { return s << IoFlagName( f ); }

◆ operator<<() [4/4]

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

Definition at line 158 of file IFileMgr.h.

158  {
159  static const std::array<const char*, SQLITE + 1> tbl = { { "UNKNOWN", "POSIX", "ROOT", "BS", "HDF5", "SQLITE" } };
160  return t < tbl.size() ? s << tbl[t] : s;
161  }
Io::OPEN
@ OPEN
Definition: IFileMgr.h:278
Io::SQLITE
@ SQLITE
Definition: IFileMgr.h:156
Io::CLOSE
@ CLOSE
Definition: IFileMgr.h:278
std::string
STL class.
Io::INVALID
@ INVALID
Definition: IFileMgr.h:47
Io::HDF5
@ HDF5
Definition: IFileMgr.h:156
Io::CLOSE_ERR
@ CLOSE_ERR
Definition: IFileMgr.h:278
gaudirun.s
string s
Definition: gaudirun.py:346
std::string::find
T find(T... args)
std::array::size
T size(T... args)
Io::WRITE
@ WRITE
Definition: IFileMgr.h:38
Io::REOPEN_ERR
@ REOPEN_ERR
Definition: IFileMgr.h:278
bug_34121.t
t
Definition: bug_34121.py:31
Io::ROOT
@ ROOT
Definition: IFileMgr.h:156
std::map::at
T at(T... args)
ProduceConsume.j
j
Definition: ProduceConsume.py:104
Io::UNKNOWN
@ UNKNOWN
Definition: IFileMgr.h:156
Io::RDWR
@ RDWR
Definition: IFileMgr.h:39
std::array
STL class.
std::map
STL class.
std::string::substr
T substr(T... args)
Io::INVALID_ACTION
@ INVALID_ACTION
Definition: IFileMgr.h:278
Io::BS
@ BS
Definition: IFileMgr.h:156
Io::EXCL
@ EXCL
Definition: IFileMgr.h:42
Io::CREATE
@ CREATE
Definition: IFileMgr.h:41
Io::REOPEN
@ REOPEN
Definition: IFileMgr.h:278
Io::TRUNC
@ TRUNC
Definition: IFileMgr.h:43
Io::APPEND
@ APPEND
Definition: IFileMgr.h:45
Io::OPEN_ERR
@ OPEN_ERR
Definition: IFileMgr.h:278
Io::POSIX
@ POSIX
Definition: IFileMgr.h:156
std::map::end
T end(T... args)
Io::READ
@ READ
Definition: IFileMgr.h:37