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