The Gaudi Framework  v40r0 (475e45c1)
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::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

◆ Action_bitmap

using Io::Action_bitmap = typedef std::bitset<INVALID_ACTION + 1>

Definition at line 264 of file IFileMgr.h.

◆ bfcn_action_t

Definition at line 273 of file IFileMgr.h.

◆ bfcn_close_t

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

Definition at line 235 of file IFileMgr.h.

◆ bfcn_closeP_t

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

Definition at line 236 of file IFileMgr.h.

◆ bfcn_open_t

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

Definition at line 234 of file IFileMgr.h.

◆ bfcn_reopen_t

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

Definition at line 237 of file IFileMgr.h.

◆ bfcn_reopenP_t

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

Definition at line 238 of file IFileMgr.h.

◆ close_t

typedef int Io::close_t

Definition at line 231 of file IFileMgr.h.

◆ Fd

typedef int Io::Fd

Definition at line 158 of file IFileMgr.h.

◆ open_t

typedef int Io::open_t

Definition at line 230 of file IFileMgr.h.

◆ reopen_t

typedef int Io::reopen_t

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

◆ IoFlag

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

Definition at line 29 of file IFileMgr.h.

29  : unsigned {
30  READ = O_RDONLY,
31  WRITE = O_WRONLY,
32  RDWR = O_RDWR,
33 
34  CREATE = O_CREAT,
35  EXCL = O_EXCL,
36  TRUNC = O_TRUNC,
37 
38  APPEND = O_APPEND,
39 
40  INVALID = 1u << 31
41  };

◆ IoTech

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

Definition at line 147 of file IFileMgr.h.

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

Function Documentation

◆ IoFlagFromName()

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

Definition at line 107 of file IFileMgr.h.

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

◆ operator<<() [1/4]

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

Definition at line 266 of file IFileMgr.h.

266  {
267  static const std::array<const char*, INVALID_ACTION + 1> tbl = {
268  { "OPEN", "CLOSE", "REOPEN", "OPEN_ERR", "CLOSE_ERR", "REOPEN_ERR", "INVALID_ACTION" } };
269  return t < tbl.size() ? s << tbl[t] : s;
270  }

◆ operator<<() [2/4]

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

Definition at line 140 of file IFileMgr.h.

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

◆ operator<<() [3/4]

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

Definition at line 141 of file IFileMgr.h.

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

◆ operator<<() [4/4]

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

Definition at line 149 of file IFileMgr.h.

149  {
150  static const std::array<const char*, SQLITE + 1> tbl = { { "UNKNOWN", "POSIX", "ROOT", "BS", "HDF5", "SQLITE" } };
151  return t < tbl.size() ? s << tbl[t] : s;
152  }
Io::OPEN
@ OPEN
Definition: IFileMgr.h:263
Io::SQLITE
@ SQLITE
Definition: IFileMgr.h:147
Io::CLOSE
@ CLOSE
Definition: IFileMgr.h:263
Io::INVALID
@ INVALID
Definition: IFileMgr.h:40
Io::HDF5
@ HDF5
Definition: IFileMgr.h:147
Io::CLOSE_ERR
@ CLOSE_ERR
Definition: IFileMgr.h:263
gaudirun.s
string s
Definition: gaudirun.py:346
Io::WRITE
@ WRITE
Definition: IFileMgr.h:31
Io::REOPEN_ERR
@ REOPEN_ERR
Definition: IFileMgr.h:263
bug_34121.t
t
Definition: bug_34121.py:31
Io::ROOT
@ ROOT
Definition: IFileMgr.h:147
ProduceConsume.j
j
Definition: ProduceConsume.py:104
Io::UNKNOWN
@ UNKNOWN
Definition: IFileMgr.h:147
Io::RDWR
@ RDWR
Definition: IFileMgr.h:32
Io::INVALID_ACTION
@ INVALID_ACTION
Definition: IFileMgr.h:263
Io::BS
@ BS
Definition: IFileMgr.h:147
Io::EXCL
@ EXCL
Definition: IFileMgr.h:35
Io::CREATE
@ CREATE
Definition: IFileMgr.h:34
Io::REOPEN
@ REOPEN
Definition: IFileMgr.h:263
Io::TRUNC
@ TRUNC
Definition: IFileMgr.h:36
Io::APPEND
@ APPEND
Definition: IFileMgr.h:38
Io::OPEN_ERR
@ OPEN_ERR
Definition: IFileMgr.h:263
Io::POSIX
@ POSIX
Definition: IFileMgr.h:147
Io::READ
@ READ
Definition: IFileMgr.h:30