The Gaudi Framework  master (37c0b60a)
IFileMgr.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
12 // IFileMgr.h
13 // Manages all file open/reopen/close
14 // Author: C.Leggett
16 
17 #ifndef GAUDIKERNEL_IFILEMGR_H
18 #define GAUDIKERNEL_IFILEMGR_H 1
19 
20 #include <GaudiKernel/ClassID.h>
21 #include <GaudiKernel/IService.h>
22 
23 #include <bitset>
24 #include <fcntl.h>
25 #include <functional>
26 #include <map>
27 #include <string>
28 #include <vector>
29 
30 namespace Io {
31 
32  //
33  // Io modes
34  //
35 
36  enum IoFlag : 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  };
49 
50  class IoFlags final {
51  public:
52  IoFlags() = default;
53  IoFlags( unsigned i ) : _f( i ) {}
54 
55  unsigned f() const { return _f; }
56 
57  bool operator==( const IoFlags& fa ) const { return ( _f == fa.f() ); }
58  bool operator==( const unsigned& fa ) const { return ( _f == fa ); }
59 
60  IoFlags operator|( const IoFlags& fa ) const { return ( _f | fa.f() ); }
61  IoFlags operator|( const unsigned& fa ) const { return ( _f | fa ); }
62 
63  operator unsigned() const { return _f; }
64 
65  bool isRead() const { return ( _f == READ ); }
66  bool isWrite() const { return ( ( _f & WRITE ) != 0 ); }
67  bool isRdWr() const { return ( ( _f & RDWR ) != 0 ); }
68  bool isInvalid() const { return ( ( _f & INVALID ) != 0 ); }
69 
70  bool match( const IoFlags& fa, bool strict = true ) const {
71  if ( strict ) { return ( _f == fa ); }
72  // only look at first 2 bits
73  return ( ( _f & 3 ) == ( fa & 3 ) );
74  }
75 
76  std::string bits() const {
77  std::string s;
78  unsigned f( _f );
79  const unsigned SHIFT = 8 * sizeof( unsigned ) - 1;
80  const unsigned MASK = 1u << SHIFT;
81 
82  for ( unsigned i = 1; i <= SHIFT + 1; ++i ) {
83  s += ( f & MASK ? '1' : '0' );
84  f <<= 1;
85  if ( i % 8 == 0 ) s += ' ';
86  }
87  return s;
88  }
89 
90  private:
91  unsigned _f = INVALID;
92  };
93 
94  static std::string IoFlagName( IoFlags f ) {
95  static const std::map<IoFlag, std::string> s_names = { { { READ, "READ" },
96  { WRITE, "WRITE" },
97  { RDWR, "RDWR" },
98  { CREATE, "CREATE" },
99  { EXCL, "EXCL" },
100  { TRUNC, "TRUNC" },
101  { APPEND, "APPEND" },
102  { INVALID, "INVALID" } } };
103  if ( f.isRead() ) return s_names.at( READ );
104 
105  std::string ff;
106  for ( unsigned i = 0; i < 32; ++i ) {
107  auto b = ( 1u << i );
108  if ( b & f ) ff += s_names.at( (IoFlag)( b ) ) + "|";
109  }
110  ff.erase( ff.length() - 1 );
111  return ff;
112  }
113 
114  inline IoFlags IoFlagFromName( const std::string& f ) {
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  }
146 
147  inline std::ostream& operator<<( std::ostream& s, const IoFlag& f ) { return s << IoFlagName( f ); }
148  inline std::ostream& operator<<( std::ostream& s, const IoFlags& f ) { return s << IoFlagName( f ); }
149 
150  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
151 
152  //
153  // Technologies
154  //
155 
157 
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  }
162 
163  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
164 
165  //
166  // File Attributes
167  //
168 
169  typedef int Fd;
170 
171  class FileAttr final {
172  public:
173  FileAttr() = default;
174  FileAttr( Fd f, std::string n, std::string d, IoTech t, IoFlags fa, void* p, bool o, bool s = false )
175  : m_fd( f )
176  , m_name( std::move( n ) )
177  , m_desc( std::move( d ) )
178  , m_tech( t )
179  , m_flags( fa )
180  , m_iflags( fa )
181  , m_fptr( p )
182  , m_isOpen( o )
183  , m_shared( s ) {}
184 
185  Fd fd() const { return m_fd; }
186  const std::string& name() const { return m_name; }
187  const std::string& desc() const { return m_desc; }
188  IoTech tech() const { return m_tech; }
189  IoFlags flags() const { return m_flags; }
190  IoFlags iflags() const { return m_iflags; }
191  void* fptr() const { return m_fptr; }
192  bool isOpen() const { return m_isOpen; }
193  bool isShared() const { return m_shared; }
194 
195  void fd( Fd f ) { m_fd = f; }
196  void name( const std::string& n ) { m_name = n; }
197  void desc( const std::string& d ) { m_desc = d; }
198  void tech( const IoTech& t ) { m_tech = t; }
199  void flags( const IoFlags& f ) { m_flags = f; }
200  void iflags( const IoFlags& f ) { m_iflags = f; }
201  void fptr( void* v ) { m_fptr = v; }
202  void isOpen( bool b ) { m_isOpen = b; }
203  void isShared( bool s ) { m_shared = s; }
204 
205  friend std::ostream& operator<<( std::ostream& os, const FileAttr& fa ) {
206  os << "name: \"" << fa.name() << "\" tech: " << fa.tech() << " desc: " << fa.desc()
207  << " flags: " << IoFlagName( fa.flags() ) << " i_flags: " << IoFlagName( fa.iflags() ) << " Fd: " << fa.fd()
208  << " ptr: " << fa.fptr() << ( fa.isOpen() ? " [o]" : " [c]" ) << ( fa.isShared() ? " [s]" : " [u]" );
209  return os;
210  }
211 
212  bool operator==( const FileAttr& fa ) const {
213  return ( m_fd == fa.fd() && m_name == fa.name() && m_desc == fa.desc() && m_tech == fa.tech() &&
214  m_flags == fa.flags() && m_fptr == fa.fptr() && m_isOpen == fa.isOpen() && m_shared == fa.isShared() );
215  }
216 
217  bool operator<( const FileAttr& rhs ) const {
218  if ( m_name != rhs.name() ) {
219  return ( m_name < rhs.name() );
220  } else {
221  return ( m_flags < rhs.iflags() );
222  }
223  }
224 
225  private:
226  Fd m_fd = -1;
232  void* m_fptr = nullptr;
233  bool m_isOpen = false;
234  bool m_shared = false;
235  };
236 
237  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
238 
239  //
240  // Handler functions
241  //
242 
243  typedef int open_t;
244  typedef int close_t;
245  typedef int reopen_t;
246 
252 
253  // file handler functions: open, close, reopen
254  struct FileHdlr final {
256 
262 
263  FileHdlr() = default;
265  : tech( t ), b_open_fcn( o ), b_close_fcn( c ), b_reopen_fcn( r ) {}
267  : tech( t ), b_open_fcn( o ), b_closeP_fcn( c ), b_reopenP_fcn( r ) {}
269  : tech( t ), b_open_fcn( o ), b_close_fcn( c1 ), b_closeP_fcn( c2 ), b_reopen_fcn( r1 ), b_reopenP_fcn( r2 ) {}
270  };
271 
272  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
273 
274  //
275  // Callback Actions
276  //
277 
280 
283  { "OPEN", "CLOSE", "REOPEN", "OPEN_ERR", "CLOSE_ERR", "REOPEN_ERR", "INVALID_ACTION" } };
284  return t < tbl.size() ? s << tbl[t] : s;
285  }
286 
287 #define FILEMGR_CALLBACK_ARGS const Io::FileAttr*, const std::string&
289 } // namespace Io
290 
291 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
292 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
293 
294 class GAUDI_API IFileMgr : virtual public IService {
295 
296 public:
298 
299  // register handler function for file technology
301 
302  virtual StatusCode deregHandler( const Io::IoTech& ) = 0;
303 
304  virtual StatusCode hasHandler( const Io::IoTech& ) const = 0;
305 
306  // get handler from technology
307  virtual StatusCode getHandler( const Io::IoTech&, Io::FileHdlr& ) const = 0;
308  // get handler from file name
309  virtual StatusCode getHandler( const std::string&, Io::FileHdlr& ) const = 0;
310 
311  // get file attributes from file name
312  virtual int getFileAttr( const std::string&, std::vector<const Io::FileAttr*>& ) const = 0;
313  // get file attributes from file descriptor
314  virtual StatusCode getFileAttr( const Io::Fd, const Io::FileAttr*& ) const = 0;
315  // get file attributes from file ptr
316  virtual StatusCode getFileAttr( void*, const Io::FileAttr*& ) const = 0;
317 
318  virtual void listHandlers() const = 0;
319  virtual void listFiles() const = 0;
320 
321  // get all files known to mgr. return numbers found.
322  // will replace contents of FILES
323  virtual int getFiles( std::vector<std::string>& FILES, bool onlyOpen = true ) const = 0;
324  virtual int getFiles( std::vector<const Io::FileAttr*>& FILES, bool onlyOpen = true ) const = 0;
325 
326  // get all files of specific IoTech. returns number found.
327  // will replace contents of FILES
328  virtual int getFiles( const Io::IoTech&, std::vector<std::string>& FILES, bool onlyOpen = true ) const = 0;
329  virtual int getFiles( const Io::IoTech&, std::vector<const Io::FileAttr*>& FILES, bool onlyOpen = true ) const = 0;
330 
331  // get all file of specific IoTech and access mode.
332  // will replace contents of FILES
333  // If IoTech == UNKNOWN, get all. returns number found
334  virtual int getFiles( const Io::IoTech&, const Io::IoFlags&, std::vector<std::string>& FILES,
335  bool onlyOpen = true ) const = 0;
337  bool onlyOpen = true ) const = 0;
338 
339  // get all descriptors known to mgr. returns number found
340  virtual int getFd( std::vector<Io::Fd>& ) const = 0;
341  // get all descriptors of specific IoTech. return number found
342  virtual int getFd( const Io::IoTech&, std::vector<Io::Fd>& ) const = 0;
343  // get all descriptors of specific IoTech and access mode.
344  // If IoTech == INVALID, get all. returns number found
345  virtual int getFd( const Io::IoTech&, const Io::IoFlags&, std::vector<Io::Fd>& ) const = 0;
346 
347  // get file name given Fd or ptr. Returns empty string if fails
348  virtual const std::string& fname( const Io::Fd& ) const = 0;
349  virtual const std::string& fname( void* ) const = 0;
350 
351  // get Fd given file name. Returns -1 if fails
352  virtual Io::Fd fd( const std::string& ) const = 0;
353  virtual Io::Fd fd( void* fptr ) const = 0;
354 
355  // get ptr given file name. Returns 0 if fails
356  virtual void* fptr( const std::string& ) const = 0;
357  virtual void* fptr( const Io::Fd& ) const = 0;
358 
359  virtual int getLastError( std::string& ) const = 0;
360 
361  // Open file, get Fd and ptr
362  virtual Io::open_t open( const Io::IoTech&, const std::string& caller, const std::string& fname, const Io::IoFlags&,
363  Io::Fd&, void*&, const std::string& desc, const bool shared = false ) = 0;
364 
365  // Open file, get Fd
366  virtual Io::open_t open( const Io::IoTech&, const std::string& caller, const std::string& fname, const Io::IoFlags&,
367  Io::Fd&, const std::string& desc, const bool shared = false ) = 0;
368 
369  // Open file, get ptr
370  virtual Io::open_t open( const Io::IoTech&, const std::string& caller, const std::string& fname, const Io::IoFlags&,
371  void*&, const std::string& desc, const bool shared = false ) = 0;
372 
373  // Close file by Fd or ptr
374  virtual Io::close_t close( const Io::Fd, const std::string& caller ) = 0;
375  virtual Io::close_t close( void*, const std::string& caller ) = 0;
376 
377  // Reopen file by Fd or ptr
378  virtual Io::reopen_t reopen( const Io::Fd, const Io::IoFlags&, const std::string& ) = 0;
379  virtual Io::reopen_t reopen( void*, const Io::IoFlags&, const std::string& ) = 0;
380 
381  // Callback actions
382  virtual StatusCode regAction( Io::bfcn_action_t, const Io::Action&, const std::string& d = "" ) = 0;
384  const std::string& d = "" ) = 0;
385 
386  // Suppress callback action(s) for specific file.
387  virtual void suppressAction( const std::string& ) = 0;
388  virtual void suppressAction( const std::string&, const Io::Action& ) = 0;
389 };
390 #endif
Io::FileHdlr::b_closeP_fcn
bfcn_closeP_t b_closeP_fcn
Definition: IFileMgr.h:259
IFileMgr::getFiles
virtual int getFiles(std::vector< std::string > &FILES, bool onlyOpen=true) const =0
IFileMgr::DeclareInterfaceID
DeclareInterfaceID(IFileMgr, 1, 0)
IService
Definition: IService.h:28
IFileMgr::listHandlers
virtual void listHandlers() const =0
Io::OPEN
@ OPEN
Definition: IFileMgr.h:278
IFileMgr::listFiles
virtual void listFiles() const =0
Io::IoTech
IoTech
Definition: IFileMgr.h:156
Io::SQLITE
@ SQLITE
Definition: IFileMgr.h:156
Io::CLOSE
@ CLOSE
Definition: IFileMgr.h:278
std::bitset
STL class.
Io::FileAttr::isOpen
void isOpen(bool b)
Definition: IFileMgr.h:202
Io::IoFlags::match
bool match(const IoFlags &fa, bool strict=true) const
Definition: IFileMgr.h:70
IService.h
IFileMgr::deregHandler
virtual StatusCode deregHandler(const Io::IoTech &)=0
std::string
STL class.
Io::INVALID
@ INVALID
Definition: IFileMgr.h:47
Io::HDF5
@ HDF5
Definition: IFileMgr.h:156
Io::IoFlags::_f
unsigned _f
Definition: IFileMgr.h:91
Io::FileAttr::tech
IoTech tech() const
Definition: IFileMgr.h:188
Io::IoFlags::operator==
bool operator==(const unsigned &fa) const
Definition: IFileMgr.h:58
Io::open_t
int open_t
Definition: IFileMgr.h:243
Io::IoFlags::f
unsigned f() const
Definition: IFileMgr.h:55
Io::FileHdlr::FileHdlr
FileHdlr(IoTech t, bfcn_open_t o, bfcn_closeP_t c, bfcn_reopenP_t r)
Definition: IFileMgr.h:266
IFileMgr::fname
virtual const std::string & fname(void *) const =0
Io::FileAttr::flags
IoFlags flags() const
Definition: IFileMgr.h:189
Io::FileAttr::isShared
void isShared(bool s)
Definition: IFileMgr.h:203
Io::CLOSE_ERR
@ CLOSE_ERR
Definition: IFileMgr.h:278
Io::bfcn_open_t
std::function< Io::open_t(const std::string &, Io::IoFlags, const std::string &, Io::Fd &, void *&)> bfcn_open_t
Definition: IFileMgr.h:247
Io::IoFlags::isInvalid
bool isInvalid() const
Definition: IFileMgr.h:68
gaudirun.s
string s
Definition: gaudirun.py:346
std::vector
STL class.
std::string::find
T find(T... args)
std::string::length
T length(T... args)
Io::IoFlags::operator==
bool operator==(const IoFlags &fa) const
Definition: IFileMgr.h:57
Io::FileAttr::operator==
bool operator==(const FileAttr &fa) const
Definition: IFileMgr.h:212
ClassID.h
IFileMgr::getFileAttr
virtual StatusCode getFileAttr(const Io::Fd, const Io::FileAttr *&) const =0
Io::IoFlags::isRead
bool isRead() const
Definition: IFileMgr.h:65
IFileMgr::reopen
virtual Io::reopen_t reopen(void *, const Io::IoFlags &, const std::string &)=0
IFileMgr::getFd
virtual int getFd(const Io::IoTech &, const Io::IoFlags &, std::vector< Io::Fd > &) const =0
IFileMgr
Definition: IFileMgr.h:294
Io::IoFlags::bits
std::string bits() const
Definition: IFileMgr.h:76
Io::FileAttr::operator<<
friend std::ostream & operator<<(std::ostream &os, const FileAttr &fa)
Definition: IFileMgr.h:205
Io::FileAttr::fptr
void fptr(void *v)
Definition: IFileMgr.h:201
Io::FileAttr::m_fd
Fd m_fd
Definition: IFileMgr.h:226
Io::FileAttr::iflags
void iflags(const IoFlags &f)
Definition: IFileMgr.h:200
gaudirun.c
c
Definition: gaudirun.py:525
std::function
Io::FileHdlr::tech
IoTech tech
Definition: IFileMgr.h:255
Io::WRITE
@ WRITE
Definition: IFileMgr.h:38
Io::FileAttr::m_tech
IoTech m_tech
Definition: IFileMgr.h:229
Io::REOPEN_ERR
@ REOPEN_ERR
Definition: IFileMgr.h:278
IFileMgr::getFiles
virtual int getFiles(const Io::IoTech &, const Io::IoFlags &, std::vector< std::string > &FILES, bool onlyOpen=true) const =0
Io::reopen_t
int reopen_t
Definition: IFileMgr.h:245
Io::IoFlags::IoFlags
IoFlags()=default
Io::operator<<
std::ostream & operator<<(std::ostream &s, const IoFlag &f)
Definition: IFileMgr.h:147
IFileMgr::getFiles
virtual int getFiles(const Io::IoTech &, std::vector< std::string > &FILES, bool onlyOpen=true) const =0
IFileMgr::suppressAction
virtual void suppressAction(const std::string &)=0
Io::bfcn_reopenP_t
std::function< Io::reopen_t(void *, Io::IoFlags)> bfcn_reopenP_t
Definition: IFileMgr.h:251
IFileMgr::reopen
virtual Io::reopen_t reopen(const Io::Fd, const Io::IoFlags &, const std::string &)=0
Io::FileAttr::name
const std::string & name() const
Definition: IFileMgr.h:186
Io::FileAttr::m_flags
IoFlags m_flags
Definition: IFileMgr.h:230
bug_34121.t
t
Definition: bug_34121.py:31
Io::FileHdlr::FileHdlr
FileHdlr()=default
Io::IoFlags::IoFlags
IoFlags(unsigned i)
Definition: IFileMgr.h:53
Io::FileAttr::m_iflags
IoFlags m_iflags
Definition: IFileMgr.h:231
Io::FileAttr::name
void name(const std::string &n)
Definition: IFileMgr.h:196
StatusCode
Definition: StatusCode.h:65
IFileMgr::regAction
virtual StatusCode regAction(Io::bfcn_action_t, const Io::Action &, const std::string &d="")=0
Io::ROOT
@ ROOT
Definition: IFileMgr.h:156
Io::FileAttr::FileAttr
FileAttr()=default
std::map::at
T at(T... args)
IFileMgr::regAction
virtual StatusCode regAction(Io::bfcn_action_t, const Io::Action &, const Io::IoTech &, const std::string &d="")=0
ProduceConsume.j
j
Definition: ProduceConsume.py:104
std::ostream
STL class.
Io::FileHdlr::b_open_fcn
bfcn_open_t b_open_fcn
Definition: IFileMgr.h:257
Io::FileHdlr::FileHdlr
FileHdlr(IoTech t, bfcn_open_t o, bfcn_close_t c, bfcn_reopen_t r)
Definition: IFileMgr.h:264
Io::UNKNOWN
@ UNKNOWN
Definition: IFileMgr.h:156
IFileMgr::getHandler
virtual StatusCode getHandler(const std::string &, Io::FileHdlr &) const =0
Io::RDWR
@ RDWR
Definition: IFileMgr.h:39
Io::FileAttr
Definition: IFileMgr.h:171
Io::IoFlags::operator|
IoFlags operator|(const IoFlags &fa) const
Definition: IFileMgr.h:60
std::array
STL class.
Io::FileAttr::fptr
void * fptr() const
Definition: IFileMgr.h:191
Io::FileAttr::FileAttr
FileAttr(Fd f, std::string n, std::string d, IoTech t, IoFlags fa, void *p, bool o, bool s=false)
Definition: IFileMgr.h:174
Io::FileHdlr::b_reopen_fcn
bfcn_reopen_t b_reopen_fcn
Definition: IFileMgr.h:260
std::string::erase
T erase(T... args)
Io::FileAttr::m_fptr
void * m_fptr
Definition: IFileMgr.h:232
Io::FileAttr::fd
Fd fd() const
Definition: IFileMgr.h:185
IFileMgr::getFiles
virtual int getFiles(const Io::IoTech &, std::vector< const Io::FileAttr * > &FILES, bool onlyOpen=true) const =0
std::map
STL class.
Io::Fd
int Fd
Definition: IFileMgr.h:169
Io::close_t
int close_t
Definition: IFileMgr.h:244
IFileMgr::getFileAttr
virtual StatusCode getFileAttr(void *, const Io::FileAttr *&) const =0
IFileMgr::getFiles
virtual int getFiles(std::vector< const Io::FileAttr * > &FILES, bool onlyOpen=true) const =0
cpluginsvc.n
n
Definition: cpluginsvc.py:234
Io::IoFlagFromName
IoFlags IoFlagFromName(const std::string &f)
Definition: IFileMgr.h:114
Io::FileAttr::isShared
bool isShared() const
Definition: IFileMgr.h:193
Io::bfcn_closeP_t
std::function< Io::close_t(void *)> bfcn_closeP_t
Definition: IFileMgr.h:249
IFileMgr::fname
virtual const std::string & fname(const Io::Fd &) const =0
IFileMgr::regHandler
virtual StatusCode regHandler(Io::FileHdlr)=0
IFileMgr::open
virtual Io::open_t open(const Io::IoTech &, const std::string &caller, const std::string &fname, const Io::IoFlags &, Io::Fd &, const std::string &desc, const bool shared=false)=0
Io::FileAttr::fd
void fd(Fd f)
Definition: IFileMgr.h:195
std::string::substr
T substr(T... args)
IFileMgr::fd
virtual Io::Fd fd(const std::string &) const =0
Io::FileAttr::desc
void desc(const std::string &d)
Definition: IFileMgr.h:197
Io::FileHdlr::b_reopenP_fcn
bfcn_reopenP_t b_reopenP_fcn
Definition: IFileMgr.h:261
IFileMgr::getFiles
virtual int getFiles(const Io::IoTech &, const Io::IoFlags &, std::vector< const Io::FileAttr * > &FILES, bool onlyOpen=true) const =0
Io::INVALID_ACTION
@ INVALID_ACTION
Definition: IFileMgr.h:278
IFileMgr::getFileAttr
virtual int getFileAttr(const std::string &, std::vector< const Io::FileAttr * > &) const =0
Io::FileAttr::m_desc
std::string m_desc
Definition: IFileMgr.h:228
IFileMgr::getLastError
virtual int getLastError(std::string &) const =0
Io::BS
@ BS
Definition: IFileMgr.h:156
Io::EXCL
@ EXCL
Definition: IFileMgr.h:42
IFileMgr::getFd
virtual int getFd(const Io::IoTech &, std::vector< Io::Fd > &) const =0
Io::FileAttr::m_isOpen
bool m_isOpen
Definition: IFileMgr.h:233
Io::IoFlag
IoFlag
Definition: IFileMgr.h:36
Io::FileAttr::isOpen
bool isOpen() const
Definition: IFileMgr.h:192
Io::FileAttr::m_name
std::string m_name
Definition: IFileMgr.h:227
std
STL namespace.
Io::CREATE
@ CREATE
Definition: IFileMgr.h:41
FILEMGR_CALLBACK_ARGS
#define FILEMGR_CALLBACK_ARGS
Definition: IFileMgr.h:287
IFileMgr::suppressAction
virtual void suppressAction(const std::string &, const Io::Action &)=0
AlgSequencer.c1
c1
Definition: AlgSequencer.py:32
Io::REOPEN
@ REOPEN
Definition: IFileMgr.h:278
Io::TRUNC
@ TRUNC
Definition: IFileMgr.h:43
IFileMgr::getHandler
virtual StatusCode getHandler(const Io::IoTech &, Io::FileHdlr &) const =0
Io::FileHdlr
Definition: IFileMgr.h:254
Io::FileAttr::desc
const std::string & desc() const
Definition: IFileMgr.h:187
Io::IoFlags::isWrite
bool isWrite() const
Definition: IFileMgr.h:66
Io::FileAttr::flags
void flags(const IoFlags &f)
Definition: IFileMgr.h:199
Io::APPEND
@ APPEND
Definition: IFileMgr.h:45
Io::OPEN_ERR
@ OPEN_ERR
Definition: IFileMgr.h:278
Io::FileAttr::tech
void tech(const IoTech &t)
Definition: IFileMgr.h:198
Properties.v
v
Definition: Properties.py:122
Io::POSIX
@ POSIX
Definition: IFileMgr.h:156
AlgSequencer.c2
c2
Definition: AlgSequencer.py:33
IFileMgr::fd
virtual Io::Fd fd(void *fptr) const =0
Io::FileAttr::m_shared
bool m_shared
Definition: IFileMgr.h:234
Io::bfcn_action_t
std::function< StatusCode(FILEMGR_CALLBACK_ARGS)> bfcn_action_t
Definition: IFileMgr.h:288
IFileMgr::getFd
virtual int getFd(std::vector< Io::Fd > &) const =0
IFileMgr::close
virtual Io::close_t close(void *, const std::string &caller)=0
IFileMgr::close
virtual Io::close_t close(const Io::Fd, const std::string &caller)=0
std::map::end
T end(T... args)
IFileMgr::hasHandler
virtual StatusCode hasHandler(const Io::IoTech &) const =0
Io::FileAttr::operator<
bool operator<(const FileAttr &rhs) const
Definition: IFileMgr.h:217
IFileMgr::open
virtual Io::open_t open(const Io::IoTech &, const std::string &caller, const std::string &fname, const Io::IoFlags &, void *&, const std::string &desc, const bool shared=false)=0
Io::Action
Action
Definition: IFileMgr.h:278
Io::FileHdlr::FileHdlr
FileHdlr(IoTech t, bfcn_open_t o, bfcn_close_t c1, bfcn_closeP_t c2, bfcn_reopen_t r1, bfcn_reopenP_t r2)
Definition: IFileMgr.h:268
Io
Definition: IFileMgr.h:30
IFileMgr::fptr
virtual void * fptr(const Io::Fd &) const =0
IFileMgr::open
virtual Io::open_t open(const Io::IoTech &, const std::string &caller, const std::string &fname, const Io::IoFlags &, Io::Fd &, void *&, const std::string &desc, const bool shared=false)=0
Io::bfcn_close_t
std::function< Io::close_t(Io::Fd)> bfcn_close_t
Definition: IFileMgr.h:248
Io::bfcn_reopen_t
std::function< Io::reopen_t(Io::Fd, Io::IoFlags)> bfcn_reopen_t
Definition: IFileMgr.h:250
Io::IoFlags
Definition: IFileMgr.h:50
Io::IoFlags::operator|
IoFlags operator|(const unsigned &fa) const
Definition: IFileMgr.h:61
Io::IoFlags::isRdWr
bool isRdWr() const
Definition: IFileMgr.h:67
Io::FileHdlr::b_close_fcn
bfcn_close_t b_close_fcn
Definition: IFileMgr.h:258
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
Io::READ
@ READ
Definition: IFileMgr.h:37
IFileMgr::fptr
virtual void * fptr(const std::string &) const =0
Io::FileAttr::iflags
IoFlags iflags() const
Definition: IFileMgr.h:190