The Gaudi Framework  master (37c0b60a)
FileMgr Class Reference

#include </builds/gaudi/Gaudi/GaudiSvc/src/FileMgr/FileMgr.h>

Inheritance diagram for FileMgr:
Collaboration diagram for FileMgr:

Public Member Functions

 ~FileMgr () override
 
StatusCode initialize () override
 
StatusCode finalize () override
 
void handle (const Incident &) override
 
StatusCode regHandler (FileHdlr) override
 
StatusCode hasHandler (const IoTech &) const override
 
StatusCode deregHandler (const IoTech &) override
 
StatusCode getHandler (const IoTech &, FileHdlr &) const override
 
StatusCode getHandler (const std::string &, FileHdlr &) const override
 
int getFileAttr (const std::string &, std::vector< const FileAttr * > &) const override
 
StatusCode getFileAttr (const Fd, const FileAttr *&) const override
 
StatusCode getFileAttr (void *, const FileAttr *&) const override
 
void listHandlers () const override
 
void listFiles () const override
 
virtual void listActions () const
 
virtual void listSuppression () const
 
int getFiles (std::vector< std::string > &, bool onlyOpen=true) const override
 
int getFiles (std::vector< const Io::FileAttr * > &, bool onlyOpen=true) const override
 
int getFiles (const Io::IoTech &, std::vector< std::string > &, bool onlyOpen=true) const override
 
int getFiles (const Io::IoTech &, std::vector< const Io::FileAttr * > &, bool onlyOpen=true) const override
 
int getFiles (const Io::IoTech &, const Io::IoFlags &, std::vector< std::string > &, bool onlyOpen=true) const override
 
int getFiles (const Io::IoTech &, const Io::IoFlags &, std::vector< const Io::FileAttr * > &, bool onlyOpen=true) const override
 
int getFd (std::vector< Fd > &) const override
 
int getFd (const Io::IoTech &, std::vector< Io::Fd > &) const override
 
int getFd (const Io::IoTech &, const Io::IoFlags &, std::vector< Io::Fd > &) const override
 
const std::stringfname (const Io::Fd &) const override
 
const std::stringfname (void *) const override
 
Io::Fd fd (const std::string &) const override
 
Io::Fd fd (void *) const override
 
void * fptr (const std::string &) const override
 
void * fptr (const Io::Fd &) const override
 
int getLastError (std::string &) const override
 
Io::open_t open (const Io::IoTech &, const std::string &caller, const std::string &fname, const Io::IoFlags &, Io::Fd &fd, void *&ptr, const std::string &desc="", const bool shared=false) override
 
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) override
 
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) override
 
Io::close_t close (const Fd, const std::string &caller) override
 
Io::close_t close (void *, const std::string &caller) override
 
Io::reopen_t reopen (const Fd, const IoFlags &, const std::string &caller) override
 
Io::reopen_t reopen (void *, const IoFlags &, const std::string &caller) override
 
StatusCode regAction (Io::bfcn_action_t, const Io::Action &, const std::string &desc="") override
 
StatusCode regAction (Io::bfcn_action_t, const Io::Action &, const Io::IoTech &, const std::string &desc="") override
 
void suppressAction (const std::string &) override
 
void suppressAction (const std::string &, const Io::Action &) override
 
- Public Member Functions inherited from extends< Service, IFileMgr, IIncidentListener >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
- Public Member Functions inherited from Service
const std::stringname () const override
 Retrieve name of the service
More...
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
StatusCode sysInitialize () override
 Initialize Service
More...
 
StatusCode sysStart () override
 Initialize Service
More...
 
StatusCode sysStop () override
 Initialize Service
More...
 
StatusCode sysFinalize () override
 Finalize Service
More...
 
StatusCode sysReinitialize () override
 Re-initialize the Service. More...
 
StatusCode sysRestart () override
 Re-initialize the Service. More...
 
 Service (std::string name, ISvcLocator *svcloc)
 Standard Constructor
More...
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator
More...
 
template<class T >
StatusCode service (const std::string &name, const T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
template<typename IFace = IService>
SmartIF< IFace > service (const std::string &name, bool createIf=true) const
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
template<class T >
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T >
StatusCode declareTool (ToolHandle< T > &handle, bool createIf=true)
 
template<class T >
StatusCode declareTool (ToolHandle< T > &handle, const std::string &toolTypeAndName, bool createIf=true)
 Declare used tool. More...
 
template<class T >
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
 
template<class T >
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
const std::vector< IAlgTool * > & tools () const
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation. More...
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property. More...
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name More...
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string More...
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property. More...
 
virtual StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p)=0
 Set the property from a property with a different name. More...
 
virtual StatusCode setProperty (const std::string &s)=0
 Set the property by string. More...
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals. More...
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string. More...
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation More...
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property More...
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name More...
 
StatusCode getProperty (std::string_view n, std::string &v) const override
 convert the property to the string More...
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties More...
 
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name. More...
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected More...
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream) More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 

Private Types

typedef std::pair< Io::bfcn_action_t, std::stringbfcn_desc_t
 
typedef std::map< Io::Action, std::list< bfcn_desc_t > > actionMap
 
typedef std::multimap< std::string, FileAttr * > fileMap
 

Private Member Functions

virtual Io::open_t open (const IoTech &, const std::string &caller, const std::string &fname, const std::string &desc, const IoFlags &, Fd &, void *&, const bool shared)
 
StatusCode execAction (Io::FileAttr *, const std::string &, const Io::Action &) const
 
StatusCode execActs (Io::FileAttr *, const std::string &, const Io::Action &, const actionMap &m) const
 
bool accessMatch (const Io::IoFlags &, const Io::IoFlags &, bool strict=false) const
 
bool isShareable (const std::string &filename, const Io::IoFlags &) const
 

Private Attributes

Gaudi::Property< std::stringm_logfile { this, "LogFile" }
 
Gaudi::Property< bool > m_printSummary { this, "PrintSummary", false }
 
Gaudi::Property< bool > m_loadRootHandler { this, "LoadROOTHandler", true }
 
Gaudi::Property< bool > m_loadPosixHandler { this, "LoadPOSIXHandler", true }
 
Gaudi::Property< std::stringm_ssl_proxy { this, "TSSL_UserProxy", "X509" }
 
Gaudi::Property< std::stringm_ssl_cert { this, "TSSL_CertDir", "X509" }
 
fileMap m_files
 
std::map< IoTech, FileHdlrm_handlers
 
std::map< Fd, FileAttr * > m_descriptors
 
std::vector< std::unique_ptr< FileAttr > > m_attr
 
std::vector< FileAttr * > m_oldFiles
 
std::map< IoTech, actionMapm_actions
 
std::map< std::string, Io::Action_bitmapm_supMap
 
std::string m_lastErrS
 
int m_lastErr
 
std::optional< RootFileHandlerm_rfh
 
std::optional< POSIXFileHandlerm_pfh
 

Additional Inherited Members

- Public Types inherited from extends< Service, IFileMgr, IIncidentListener >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces... >
 Typedef to the base of this class. More...
 
- Public Types inherited from Service
using Factory = Gaudi::PluginService::Factory< IService *(const std::string &, ISvcLocator *)>
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
 Typedef used to refer to this class from derived classes, as in. More...
 
- Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using base_class = CommonMessaging
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
 take union of the ext_iids of all Interfaces... More...
 
- Protected Member Functions inherited from Service
std::vector< IAlgTool * > & tools ()
 
 ~Service () override
 Standard Destructor
More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level setUpMessaging () const
 Set up local caches. More...
 
MSG::Level resetMessaging ()
 Reinitialize internal states. More...
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 
- Protected Attributes inherited from Service
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state
More...
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state
More...
 
Gaudi::Property< int > m_outputLevel { this, "OutputLevel", MSG::NIL, "output level" }
 flag indicating whether ToolHandle tools have been added to m_tools More...
 
Gaudi::Property< bool > m_auditInit { this, "AuditServices", false, "[[deprecated]] unused" }
 
Gaudi::Property< bool > m_auditorInitialize { this, "AuditInitialize", false, "trigger auditor on initialize()" }
 
Gaudi::Property< bool > m_auditorStart { this, "AuditStart", false, "trigger auditor on start()" }
 
Gaudi::Property< bool > m_auditorStop { this, "AuditStop", false, "trigger auditor on stop()" }
 
Gaudi::Property< bool > m_auditorFinalize { this, "AuditFinalize", false, "trigger auditor on finalize()" }
 
Gaudi::Property< bool > m_auditorReinitialize { this, "AuditReinitialize", false, "trigger auditor on reinitialize()" }
 
Gaudi::Property< bool > m_auditorRestart { this, "AuditRestart", false, "trigger auditor on restart()" }
 
Gaudi::Property< bool > m_autoRetrieveTools
 
Gaudi::Property< bool > m_checkToolDeps
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service
More...
 

Detailed Description

Definition at line 45 of file FileMgr.h.

Member Typedef Documentation

◆ actionMap

Definition at line 136 of file FileMgr.h.

◆ bfcn_desc_t

Definition at line 135 of file FileMgr.h.

◆ fileMap

Definition at line 143 of file FileMgr.h.

Constructor & Destructor Documentation

◆ ~FileMgr()

FileMgr::~FileMgr ( )
override

Definition at line 63 of file FileMgr.cpp.

63  {
64  // Where do the new-ed FileAttr get deleted?
65  // they get pushed into m_descriptors, but m_attr is presumably
66  // where they _also_ should be pushed in order to track ownership...
67 }

Member Function Documentation

◆ accessMatch()

bool FileMgr::accessMatch ( const Io::IoFlags fold,
const Io::IoFlags fnew,
bool  strict = false 
) const
private

Definition at line 1151 of file FileMgr.cpp.

1151  {
1152  ON_VERBOSE
1153  verbose() << "accessMatch old: " << fold << " new: " << fnew << endmsg;
1154 
1155  return ( ( ( fold == Io::READ ) && ( fnew == Io::READ ) ) ||
1156  ( ( fold & Io::WRITE ) != 0 && ( fnew & Io::WRITE ) != 0 ) ||
1157  ( ( fold & Io::RDWR ) != 0 && ( fnew & Io::RDWR ) != 0 ) );
1158 }

◆ close() [1/2]

Io::close_t FileMgr::close ( const  Fd,
const std::string caller 
)
override

◆ close() [2/2]

close_t FileMgr::close ( void *  vp,
const std::string caller 
)
override

Definition at line 501 of file FileMgr.cpp.

501  {
502 
503  // return codes:
504  // < 0 : error condition
505  // 0 : actual close of one file
506  // > 0 : shared file, removed from list, no actual close, returns
507  // number of shared files still open.
508 
509  ON_VERBOSE
510  verbose() << "close(" << vp << ")" << endmsg;
511 
512  close_t r = -1;
513 
514  auto itr = std::find_if( std::begin( m_files ), std::end( m_files ),
515  [&]( fileMap::const_reference i ) { return i.second->fptr() == vp; } );
516 
517  if ( itr == m_files.end() ) {
518  error() << "unknown file ptr \"" << vp << "\" when calling close()" << endmsg;
519  return r;
520  }
521 
522  IoTech tech = itr->second->tech();
523 
524  FileHdlr fh;
525 
526  if ( getHandler( tech, fh ).isFailure() ) { return r; }
527  if ( !fh.b_closeP_fcn ) {
528  error() << "no close(" << tech << ",void*) function registered" << endmsg;
529  return -1;
530  }
531 
532  FileAttr* fa = itr->second;
533 
534  // find how many times this file is open
536 
537  int i =
538  std::count_if( fitr.first, fitr.second, [&]( fileMap::const_reference f ) { return f.second->fptr() == vp; } );
539 
540  ON_VERBOSE
541  verbose() << " ref count: " << i << endmsg;
542 
543  if ( i > 1 && fa->isShared() ) {
544  // file open multiple times in shared access. don't do the actual close
545  ON_DEBUG
546  debug() << "closing file " << fa->name() << " opened " << i << " times with fptr " << vp << endmsg;
547  m_files.erase( itr );
548 
549  r = i - 1;
550 
551  } else if ( i == 1 || ( i > 1 && !fa->isShared() ) ) {
552  ON_DEBUG
553  debug() << "closing: " << *fa << endmsg;
554 
555  try {
556  r = fh.b_closeP_fcn( vp );
557  } catch ( const std::bad_function_call& err ) {
558  error() << "when calling close handler for " << tech << " on file " << fa->name() << " caught " << err.what()
559  << endmsg;
560  execAction( fa, caller, CLOSE_ERR ).ignore();
561  return -1;
562  } catch ( ... ) {
563  error() << "when calling close handler for " << tech << " on file " << fa->name()
564  << " caught an unknown exception." << endmsg;
565  execAction( fa, caller, CLOSE_ERR ).ignore();
566  return -1;
567  }
568 
569  if ( r < 0 ) {
570  warning() << "close of file with ptr \"" << vp << "\", name: \"" << fa->name() << "\", tech: \"" << tech
571  << "\" failed" << endmsg;
572 
573  return r;
574  }
575 
576  m_files.erase( itr );
577 
578  } else {
579  // this should never happen!
580  error() << "ref count: " << i << " < 0 when closing " << fa << ". This should never happen" << endmsg;
581  return -1;
582  }
583 
584  fa->fd( -1 );
585  fa->flags( INVALID );
586  fa->isOpen( false );
587  fa->fptr( 0 );
588  m_oldFiles.push_back( fa );
589 
590  // exec all callbacks
591  if ( execAction( fa, caller, CLOSE ).isFailure() ) {
592  warning() << "at least one close callback action failed" << endmsg;
593  }
594 
595  return r;
596 }

◆ deregHandler()

StatusCode FileMgr::deregHandler ( const IoTech )
override

Definition at line 220 of file FileMgr.cpp.

220  {
221  FileHdlr hdlr;
222 
223  auto itr = m_handlers.find( tech );
224  if ( itr == m_handlers.end() ) {
225  error() << "Can't de-register tech " << tech << " as it hasn't been registered!" << endmsg;
226  return StatusCode::FAILURE;
227  }
228 
229  m_handlers.erase( itr );
230  return StatusCode::SUCCESS;
231 }

◆ execAction()

StatusCode FileMgr::execAction ( Io::FileAttr fa,
const std::string caller,
const Io::Action a 
) const
private

Definition at line 1097 of file FileMgr.cpp.

1097  {
1098 
1099  Io::IoTech tech = fa->tech();
1100 
1101  StatusCode s1, s2;
1102 
1103  auto itr = m_actions.find( Io::UNKNOWN );
1104 
1105  if ( itr != m_actions.end() && !itr->second.empty() ) { s1 = execActs( fa, caller, a, itr->second ); }
1106 
1107  itr = m_actions.find( tech );
1108  if ( itr != m_actions.end() && !itr->second.empty() ) { s2 = execActs( fa, caller, a, itr->second ); }
1109 
1110  return ( s1.isFailure() || s2.isFailure() ) ? StatusCode::FAILURE : StatusCode::SUCCESS;
1111 }

◆ execActs()

StatusCode FileMgr::execActs ( Io::FileAttr fa,
const std::string caller,
const Io::Action a,
const actionMap m 
) const
private

Definition at line 1115 of file FileMgr.cpp.

1116  {
1117 
1118  auto mitr = m.find( a );
1119  if ( mitr == m.end() || mitr->second.empty() ) return StatusCode::SUCCESS;
1120 
1121  ON_DEBUG
1122  debug() << "executing " << mitr->second.size() << " " << a << " actions on " << *fa << " from " << caller << endmsg;
1123 
1124  bool fail( false );
1125 
1126  auto it2 = m_supMap.find( fa->name() );
1127  if ( it2 != m_supMap.end() ) {
1128  if ( it2->second[a] || it2->second[Io::INVALID_ACTION] ) {
1129  ON_DEBUG
1130  debug() << " --> suppressing callback action for " << a << endmsg;
1131  return StatusCode::SUCCESS;
1132  }
1133  }
1134 
1135  for ( const auto& itr : mitr->second ) {
1136 
1137  ON_DEBUG
1138  debug() << "executing " << itr.second << endmsg;
1139 
1140  if ( ( ( ( itr.first ) )( fa, caller ) ).isFailure() ) {
1141  warning() << "execution of " << itr.second << " on " << *fa << " failed during " << a << " action" << endmsg;
1142  fail = true;
1143  }
1144  }
1145 
1146  return fail ? StatusCode::FAILURE : StatusCode::SUCCESS;
1147 }

◆ fd() [1/2]

Io::Fd FileMgr::fd ( const std::string fname) const
override

Definition at line 949 of file FileMgr.cpp.

949  {
950 
951  auto fitr = m_files.equal_range( fname );
952  auto itr = std::find_if( fitr.first, fitr.second, []( fileMap::const_reference f ) { return f.second->fd() != -1; } );
953  return itr != fitr.second ? itr->second->fd() : -1;
954 }

◆ fd() [2/2]

Io::Fd FileMgr::fd ( void *  fptr) const
override

Definition at line 958 of file FileMgr.cpp.

958  {
959 
960  auto itr = std::find_if( m_files.begin(), m_files.end(),
961  [&]( fileMap::const_reference f ) { return f.second->fptr() == fptr; } );
962  return itr != m_files.end() ? itr->second->fd() : -1;
963 }

◆ finalize()

StatusCode FileMgr::finalize ( )
override

Definition at line 125 of file FileMgr.cpp.

125  {
126  ON_VERBOSE
127  verbose() << "FileMgr::finalize()" << endmsg;
128 
129  if ( m_printSummary || msgLevel( MSG::DEBUG ) ) {
130  listHandlers();
131  listFiles();
132  listActions();
133  listSuppression();
134  }
135 
136  if ( !m_files.empty() ) {
137  auto& log = warning();
138  log << "At finalize, the following files remained open:\n";
139  for ( const auto& itr : m_files ) log << *( itr.second ) << '\n';
140  log << endmsg;
141  }
142 
143  if ( m_logfile.value() != "" ) {
144  std::ofstream ofs;
145  ofs.open( m_logfile.value().c_str() );
146  if ( !ofs ) {
147  error() << "Unable to open output file \"" << m_logfile.value() << "\" for writing" << endmsg;
148  } else {
149  ON_DEBUG
150  debug() << "Saving log to \"" << m_logfile.value() << "\"" << endmsg;
151  for ( const auto& itr : m_files ) {
152  ofs << itr.second->name() << " " << itr.second->tech() << " " << itr.second->desc() << " "
153  << itr.second->iflags() << '\n';
154  }
155 
156  set<FileAttr> fs;
157  for ( const auto& it2 : m_oldFiles ) fs.insert( *it2 );
158  for ( const auto& it3 : fs ) {
159  ofs << it3.name() << " " << it3.tech() << " " << it3.desc() << " " << it3.iflags()
160  << ( it3.isShared() ? " SHARED" : "" ) << '\n';
161  }
162  ofs.close();
163  }
164  }
165 
166  // cleanup FileAttrs
167  m_attr.clear();
168 
169  m_rfh.reset();
170  m_pfh.reset();
171 
172  StatusCode status = Service::finalize();
173 
174  ON_DEBUG
175  if ( status.isSuccess() ) debug() << "Service finalised successfully" << endmsg;
176 
177  return status;
178 }

◆ fname() [1/2]

const std::string & FileMgr::fname ( const Io::Fd fd) const
override

Definition at line 931 of file FileMgr.cpp.

931  {
932 
933  auto itr = std::find_if( std::begin( m_files ), std::end( m_files ),
934  [&]( fileMap::const_reference f ) { return f.second->fd() == fd; } );
935  return ( itr != std::end( m_files ) ) ? itr->second->name() : s_empty;
936 }

◆ fname() [2/2]

const std::string & FileMgr::fname ( void *  vp) const
override

Definition at line 940 of file FileMgr.cpp.

940  {
941 
942  auto itr = std::find_if( m_files.begin(), m_files.end(),
943  [&]( fileMap::const_reference f ) { return f.second->fptr() == vp; } );
944  return itr != m_files.end() ? itr->second->name() : s_empty;
945 }

◆ fptr() [1/2]

void * FileMgr::fptr ( const Io::Fd fd) const
override

Definition at line 976 of file FileMgr.cpp.

976  {
977 
978  auto itr = std::find_if( m_files.begin(), m_files.end(),
979  [&]( fileMap::const_reference f ) { return f.second->fd() == fd; } );
980  return itr != m_files.end() ? itr->second->fptr() : nullptr;
981 }

◆ fptr() [2/2]

void * FileMgr::fptr ( const std::string fname) const
override

Definition at line 967 of file FileMgr.cpp.

967  {
968  auto fitr = m_files.equal_range( fname );
969  auto itr =
970  std::find_if( fitr.first, fitr.second, []( fileMap::const_reference f ) -> bool { return f.second->fptr(); } );
971  return itr != fitr.second ? itr->second->fptr() : nullptr;
972 }

◆ getFd() [1/3]

int FileMgr::getFd ( const Io::IoTech tech,
const Io::IoFlags flags,
std::vector< Io::Fd > &  fd 
) const
override

Definition at line 919 of file FileMgr.cpp.

919  {
920 
921  fd.clear();
922  transform_if( m_descriptors.begin(), m_descriptors.end(), std::back_inserter( fd ), select1st,
923  [&]( const std::pair<Fd, FileAttr*>& d ) {
924  return ( d.second->tech() == tech || tech == UNKNOWN ) && ( d.second->flags() == flags );
925  } );
926  return fd.size();
927 }

◆ getFd() [2/3]

int FileMgr::getFd ( const Io::IoTech tech,
std::vector< Io::Fd > &  fd 
) const
override

Definition at line 904 of file FileMgr.cpp.

904  {
905 
906  if ( tech == UNKNOWN ) return getFd( fd );
907 
908  fd.clear();
909  transform_if( std::begin( m_descriptors ), std::end( m_descriptors ), std::back_inserter( fd ), select1st,
910  [&]( const std::pair<Fd, FileAttr*>& d ) { return d.second->tech() == tech; } );
911 
912  return fd.size();
913 }

◆ getFd() [3/3]

int FileMgr::getFd ( std::vector< Fd > &  ) const
override

◆ getFileAttr() [1/3]

StatusCode FileMgr::getFileAttr ( const  Fd,
const FileAttr *&   
) const
override

◆ getFileAttr() [2/3]

int FileMgr::getFileAttr ( const std::string fname,
std::vector< const FileAttr * > &  fa 
) const
override

Definition at line 723 of file FileMgr.cpp.

723  {
724 
725  fa.clear();
726 
727  auto fitr = m_files.equal_range( fname );
728  std::transform( fitr.first, fitr.second, std::back_inserter( fa ), select2nd );
729 
731  [&]( const FileAttr* f ) { return f->name() == fname; } );
732 
733  return fa.size();
734 }

◆ getFileAttr() [3/3]

StatusCode FileMgr::getFileAttr ( void *  vp,
const FileAttr *&  fa 
) const
override

Definition at line 759 of file FileMgr.cpp.

759  {
760 
762  [&]( fileMap::const_reference f ) { return f.second->fptr() == vp; } );
763  if ( i != std::end( m_files ) ) {
764  fa = i->second;
765  return StatusCode::SUCCESS;
766  }
767 
769  [&]( const FileAttr* f ) { return f->fptr() == vp; } );
770  if ( j != std::end( m_oldFiles ) ) {
771  fa = *j;
772  return StatusCode::SUCCESS;
773  }
774 
775  return StatusCode::FAILURE;
776 }

◆ getFiles() [1/6]

int FileMgr::getFiles ( const Io::IoTech tech,
const Io::IoFlags flags,
std::vector< const Io::FileAttr * > &  files,
bool  onlyOpen = true 
) const
override

Definition at line 870 of file FileMgr.cpp.

870  {
871 
872  files.clear();
873 
874  auto matches_tech_and_flags = [&]( const FileAttr* f ) {
875  return ( f->tech() == tech || tech == UNKNOWN ) && f->flags() == flags;
876  };
877 
878  transform_copy_if( std::begin( m_files ), std::end( m_files ), std::back_inserter( files ), select2nd,
879  matches_tech_and_flags );
880  if ( !op ) {
882  matches_tech_and_flags );
883  }
884 
885  return files.size();
886 }

◆ getFiles() [2/6]

int FileMgr::getFiles ( const Io::IoTech tech,
const Io::IoFlags flags,
std::vector< std::string > &  files,
bool  onlyOpen = true 
) const
override

Definition at line 847 of file FileMgr.cpp.

847  {
848 
849  files.clear();
850 
851  auto not_in_files = [&]( const std::string& n ) {
852  return std::none_of( std::begin( files ), std::end( files ), [&]( const std::string& f ) { return f == n; } );
853  };
854  auto matches_tech_and_flags = [&]( const FileAttr* f ) {
855  return ( f->tech() == tech || tech == UNKNOWN ) && f->flags() == flags;
856  };
857 
858  transform_if(
859  std::begin( m_files ), std::end( m_files ), std::back_inserter( files ), to_name,
860  [&]( fileMap::const_reference f ) { return matches_tech_and_flags( f.second ) && not_in_files( f.first ); } );
861  if ( !op ) {
862  transform_if( std::begin( m_oldFiles ), std::end( m_oldFiles ), std::back_inserter( files ), to_name,
863  [&]( const FileAttr* f ) { return matches_tech_and_flags( f ) && not_in_files( f->name() ); } );
864  }
865 
866  return files.size();
867 }

◆ getFiles() [3/6]

int FileMgr::getFiles ( const Io::IoTech tech,
std::vector< const Io::FileAttr * > &  files,
bool  onlyOpen = true 
) const
override

Definition at line 830 of file FileMgr.cpp.

830  {
831 
832  if ( tech == UNKNOWN ) return getFiles( files, op );
833 
834  auto matches_tech = [&]( const FileAttr* f ) { return f->tech() == tech; };
835 
836  files.clear();
837  transform_copy_if( std::begin( m_files ), std::end( m_files ), std::back_inserter( files ), select2nd, matches_tech );
838  if ( !op ) {
839  std::copy_if( std::begin( m_oldFiles ), std::end( m_oldFiles ), std::back_inserter( files ), matches_tech );
840  }
841 
842  return files.size();
843 }

◆ getFiles() [4/6]

int FileMgr::getFiles ( const Io::IoTech tech,
std::vector< std::string > &  files,
bool  onlyOpen = true 
) const
override

Definition at line 806 of file FileMgr.cpp.

806  {
807 
808  if ( tech == UNKNOWN ) return getFiles( files, op );
809 
810  files.clear();
811  transform_if( std::begin( m_files ), std::end( m_files ), std::back_inserter( files ), to_name,
812  [&]( fileMap::const_reference f ) {
813  return f.second->tech() == tech &&
814  std::none_of( std::begin( files ), std::end( files ),
815  [&]( const std::string& j ) { return j == f.first; } );
816  } );
817 
818  if ( !op ) {
819  transform_if( std::begin( m_oldFiles ), std::end( m_oldFiles ), std::back_inserter( files ), to_name,
820  [&]( const FileAttr* f ) {
821  return f->tech() == tech && std::none_of( std::begin( files ), std::end( files ),
822  [&]( const std::string& j ) { return j == f->name(); } );
823  } );
824  }
825  return files.size();
826 }

◆ getFiles() [5/6]

int FileMgr::getFiles ( std::vector< const Io::FileAttr * > &  files,
bool  onlyOpen = true 
) const
override

Definition at line 796 of file FileMgr.cpp.

796  {
797 
798  files.clear();
799  std::transform( std::begin( m_files ), std::end( m_files ), std::back_inserter( files ), select2nd );
800  if ( !op ) { std::copy( std::begin( m_oldFiles ), std::end( m_oldFiles ), std::back_inserter( files ) ); }
801  return files.size();
802 }

◆ getFiles() [6/6]

int FileMgr::getFiles ( std::vector< std::string > &  files,
bool  onlyOpen = true 
) const
override

Definition at line 780 of file FileMgr.cpp.

780  {
781 
782  files.clear();
783  auto not_in_files = [&]( const std::string& i ) {
784  return std::none_of( std::begin( files ), std::end( files ), [&]( const std::string& j ) { return j == i; } );
785  };
786  transform_copy_if( std::begin( m_files ), std::end( m_files ), std::back_inserter( files ), to_name, not_in_files );
787  if ( !op ) {
788  transform_copy_if( std::begin( m_oldFiles ), std::end( m_oldFiles ), std::back_inserter( files ), to_name,
789  not_in_files );
790  }
791  return files.size();
792 }

◆ getHandler() [1/2]

StatusCode FileMgr::getHandler ( const IoTech &  ,
FileHdlr  
) const
override

◆ getHandler() [2/2]

StatusCode FileMgr::getHandler ( const std::string fname,
Io::FileHdlr hdlr 
) const
override

Definition at line 1018 of file FileMgr.cpp.

1018  {
1019 
1020  auto fitr = m_files.equal_range( fname );
1021  if ( fitr.first == fitr.second ) {
1022  error() << "no file \"" << fname << "\" registered. Cannot determine tech" << endmsg;
1023  return StatusCode::FAILURE;
1024  }
1025 
1026  auto itr = fitr.first;
1027  IoTech tech = itr->second->tech();
1028 
1029  ++itr;
1030  while ( itr != fitr.second ) {
1031  if ( itr->second->tech() != tech ) {
1032  error() << "multiple technologies registered for file \"" << fname << "\". Cannot determine handler" << endmsg;
1033  return StatusCode::FAILURE;
1034  }
1035  ++itr;
1036  }
1037 
1038  return getHandler( tech, hdlr );
1039 }

◆ getLastError()

int FileMgr::getLastError ( std::string err) const
override

Definition at line 997 of file FileMgr.cpp.

997  {
998 
999  err = m_lastErrS;
1000  return m_lastErr;
1001 }

◆ handle()

void FileMgr::handle ( const Incident )
override

Definition at line 182 of file FileMgr.cpp.

182 {}

◆ hasHandler()

StatusCode FileMgr::hasHandler ( const IoTech ) const
override

Definition at line 234 of file FileMgr.cpp.

234  {
235 
236  auto itr = m_handlers.find( tech );
237  return ( itr != m_handlers.end() ) ? StatusCode::SUCCESS : StatusCode::FAILURE;
238 }

◆ initialize()

StatusCode FileMgr::initialize ( )
override

Definition at line 71 of file FileMgr.cpp.

71  {
73 
74  if ( status.isFailure() ) {
75 
76  ON_DEBUG
77  debug() << "Failed to initialize the base class (Service)" << endmsg;
78  return status;
79  }
80 
82  verbose() << "Initializing FileMgr" << endmsg;
83 
84  if ( m_loadRootHandler.value() ) {
85 
86  // setup file handler for ROOT
87 
88  msgSvc()->setOutputLevel( "RootFileHandler", m_outputLevel.value() );
89  m_rfh.emplace( msgSvc(), m_ssl_proxy, m_ssl_cert );
90 
91  auto& rfh = m_rfh.value(); // used in the lambdas to avoid capturing 'this'
92  Io::FileHdlr hdlr(
93  Io::ROOT,
94  [&rfh]( const std::string& n, const Io::IoFlags& f, const std::string& desc, Io::Fd& fd,
95  void*& ptr ) -> Io::open_t { return rfh.openRootFile( n, f, desc, fd, ptr ); },
96  [&rfh]( void* ptr ) -> Io::close_t { return rfh.closeRootFile( ptr ); },
97  [&rfh]( void* ptr, const Io::IoFlags& f ) -> Io::reopen_t { return rfh.reopenRootFile( ptr, f ); } );
98 
99  if ( regHandler( hdlr ).isFailure() ) { error() << "unable to register ROOT file handler with FileMgr" << endmsg; }
100  }
101 
102  if ( m_loadPosixHandler.value() ) {
103 
104  // setup file handler for POSIX
105 
106  msgSvc()->setOutputLevel( "POSIXFileHandler", m_outputLevel.value() );
107  m_pfh.emplace( msgSvc() );
108 
109  auto& pfh = m_pfh.value(); // used in the lambdas to avoid capturing 'this'
110  Io::FileHdlr hdlp(
111  Io::POSIX,
112  [&pfh]( const std::string& n, const Io::IoFlags& f, const std::string& desc, Io::Fd& fd,
113  void*& ptr ) -> Io::open_t { return pfh.openPOSIXFile( n, f, desc, fd, ptr ); },
114  [&pfh]( Io::Fd fd ) -> Io::close_t { return pfh.closePOSIXFile( fd ); },
115  [&pfh]( Io::Fd fd, const Io::IoFlags& f ) -> Io::reopen_t { return pfh.reopenPOSIXFile( fd, f ); } );
116 
117  if ( regHandler( hdlp ).isFailure() ) { error() << "unable to register ROOT file handler with FileMgr" << endmsg; }
118  }
119 
120  return StatusCode::SUCCESS;
121 }

◆ isShareable()

bool FileMgr::isShareable ( const std::string filename,
const Io::IoFlags  
) const
private

◆ listActions()

void FileMgr::listActions ( ) const
virtual

Definition at line 1072 of file FileMgr.cpp.

1072  {
1073 
1074  info() << "listing registered actions\n";
1075 
1076  for ( const auto& iit : m_actions ) {
1077  Io::IoTech t = iit.first;
1078  const actionMap& m = iit.second;
1079 
1080  if ( !m.empty() ) {
1081  info() << " --- Tech: ";
1082  if ( t == Io::UNKNOWN ) {
1083  info() << "ALL ---\n";
1084  } else {
1085  info() << t << " ---\n";
1086  }
1087  for ( const auto& iia : m ) {
1088  for ( const auto& it2 : iia.second ) { info() << " " << iia.first << " " << it2.second << '\n'; }
1089  }
1090  }
1091  }
1092  info() << endmsg;
1093 }

◆ listFiles()

void FileMgr::listFiles ( ) const
override

Definition at line 985 of file FileMgr.cpp.

985  {
986 
987  info() << "listing registered files [" << ( m_files.size() + m_oldFiles.size() ) << "]:\n";
988 
989  for ( auto& itr : m_files ) info() << itr.second << '\n';
990  for ( auto& it2 : m_oldFiles ) info() << *it2 << '\n';
991 
992  info() << endmsg;
993 }

◆ listHandlers()

void FileMgr::listHandlers ( ) const
override

Definition at line 1043 of file FileMgr.cpp.

1043  {
1044 
1045  info() << "Listing registered handlers:\n";
1046 
1047  for ( const auto& itr : m_handlers ) info() << " " << itr.first << '\n';
1048  info() << endmsg;
1049 }

◆ listSuppression()

void FileMgr::listSuppression ( ) const
virtual

Definition at line 1170 of file FileMgr.cpp.

1170  {
1171  if ( m_supMap.empty() ) return;
1172 
1173  info() << "listing suppressed file actions\n";
1174 
1175  for ( const auto& sup : m_supMap ) {
1176  info() << " " << sup.first;
1177  if ( sup.second[Io::INVALID_ACTION] ) {
1178  info() << " ALL\n";
1179  } else {
1180  for ( unsigned i = 0; i != sup.second.size(); ++i ) {
1181  if ( sup.second[i] ) info() << " " << (Io::Action)i;
1182  }
1183  info() << '\n';
1184  }
1185  }
1186  info() << endmsg;
1187 }

◆ open() [1/4]

open_t FileMgr::open ( const Io::IoTech tech,
const std::string caller,
const std::string fname,
const Io::IoFlags flags,
Io::Fd fd,
const std::string desc = "",
const bool  shared = false 
)
override

Definition at line 249 of file FileMgr.cpp.

250  {
251 
252  void* dummy( 0 );
253  return open( tech, caller, fname, desc, flags, fd, dummy, sh );
254 }

◆ open() [2/4]

open_t FileMgr::open ( const Io::IoTech tech,
const std::string caller,
const std::string fname,
const Io::IoFlags flags,
Io::Fd fd,
void *&  ptr,
const std::string desc = "",
const bool  shared = false 
)
override

Definition at line 242 of file FileMgr.cpp.

243  {
244 
245  return open( tech, caller, fname, desc, flags, fd, ptr, sh );
246 }

◆ open() [3/4]

open_t FileMgr::open ( const Io::IoTech tech,
const std::string caller,
const std::string fname,
const Io::IoFlags flags,
void *&  ptr,
const std::string desc = "",
const bool  shared = false 
)
override

Definition at line 257 of file FileMgr.cpp.

258  {
259 
260  Fd dummy( -1 );
261  return open( tech, caller, fname, desc, flags, dummy, ptr, sh );
262 }

◆ open() [4/4]

virtual Io::open_t FileMgr::open ( const IoTech &  ,
const std::string caller,
const std::string fname,
const std::string desc,
const IoFlags ,
Fd &  ,
void *&  ,
const bool  shared 
)
privatevirtual

◆ regAction() [1/2]

StatusCode FileMgr::regAction ( Io::bfcn_action_t  bf,
const Io::Action a,
const Io::IoTech t,
const std::string desc = "" 
)
override

Definition at line 1060 of file FileMgr.cpp.

1060  {
1061 
1062  ON_DEBUG
1063  debug() << "registering " << a << " action " << System::typeinfoName( bf.target_type() ) << " for tech " << t
1064  << endmsg;
1065 
1066  m_actions[t][a].emplace_back( bf, ( !d.empty() ) ? d : System::typeinfoName( bf.target_type() ) );
1067  return StatusCode::SUCCESS;
1068 }

◆ regAction() [2/2]

StatusCode FileMgr::regAction ( Io::bfcn_action_t  bf,
const Io::Action a,
const std::string desc = "" 
)
override

Definition at line 1053 of file FileMgr.cpp.

1053  {
1054 
1055  return regAction( bf, a, Io::UNKNOWN, d );
1056 }

◆ regHandler()

StatusCode FileMgr::regHandler ( FileHdlr  fh)
override

Definition at line 186 of file FileMgr.cpp.

186  {
187 
188  IoTech tech = fh.tech;
189 
190  if ( m_handlers.find( tech ) != m_handlers.end() ) {
191  warning() << "Handler for IoTech " << tech << " already registered. Ignoring." << endmsg;
192  return StatusCode::SUCCESS;
193  }
194 
195  if ( !fh.b_open_fcn ) {
196  error() << "open handler for tech " << tech << " is NULL" << endmsg;
197  return StatusCode::FAILURE;
198  }
199 
200  if ( !fh.b_close_fcn && !fh.b_closeP_fcn ) {
201  error() << "no close handler for tech " << tech << " registered" << endmsg;
202  return StatusCode::FAILURE;
203  }
204 
205  if ( !fh.b_reopen_fcn && !fh.b_reopenP_fcn ) {
206  error() << "no reopen handler for tech " << tech << " registered" << endmsg;
207  return StatusCode::FAILURE;
208  }
209 
210  ON_DEBUG
211  debug() << "Successfully registered handler for tech \"" << tech << "\"" << endmsg;
212 
213  m_handlers[tech] = fh;
214 
215  return StatusCode::SUCCESS;
216 }

◆ reopen() [1/2]

Io::reopen_t FileMgr::reopen ( const  Fd,
const IoFlags ,
const std::string caller 
)
override

◆ reopen() [2/2]

reopen_t FileMgr::reopen ( void *  vp,
const IoFlags flags,
const std::string caller 
)
override

Definition at line 665 of file FileMgr.cpp.

665  {
666  ON_VERBOSE
667  verbose() << "reopen(" << vp << "," << flags << "," << caller << ")" << endmsg;
668 
669  reopen_t r = -1;
670 
671  auto itr = std::find_if( std::begin( m_files ), std::end( m_files ),
672  [&]( fileMap::const_reference f ) { return f.second->fptr() == vp; } );
673  if ( itr == m_files.end() ) {
674  error() << "unregistered file ptr \"" << vp << "\" when calling reopen()" << endmsg;
675  return r;
676  }
677 
678  FileAttr* fa = itr->second;
679  FileHdlr fh;
680  IoTech tech = fa->tech();
681 
682  if ( getHandler( tech, fh ).isFailure() ) { return r; }
683 
684  if ( !fh.b_reopenP_fcn ) {
685  error() << "no reopen(" << tech << ",void*) function registered" << endmsg;
686  return -1;
687  }
688 
689  try {
690  r = fh.b_reopenP_fcn( vp, flags );
691  } catch ( const std::bad_function_call& err ) {
692  error() << "when calling reopen handler for " << tech << " on file " << fa->name() << " with flags " << flags
693  << " caught " << err.what() << endmsg;
694  return -1;
695  } catch ( ... ) {
696  error() << "when calling reopen handler for " << tech << " on file " << fa->name() << " with flags " << flags
697  << " caught an unknown exception." << endmsg;
698  return -1;
699  }
700 
701  if ( r < 0 ) {
702  warning() << "reopen of file with ptr \"" << vp << "\", name: \"" << fa->name() << "\", tech: \"" << tech
703  << "\", flags: \"" << flags << "\" failed" << endmsg;
704 
705  execAction( fa, caller, Io::REOPEN_ERR ).ignore();
706 
707  return r;
708  }
709 
710  fa->isOpen( true );
711  fa->flags( flags );
712 
713  // exec all callbacks
714  if ( execAction( fa, caller, Io::REOPEN ).isFailure() ) {
715  warning() << "at least one reopen callback action failed" << endmsg;
716  }
717 
718  return r;
719 }

◆ suppressAction() [1/2]

void FileMgr::suppressAction ( const std::string f)
override

Definition at line 1162 of file FileMgr.cpp.

1162 { return suppressAction( f, Io::INVALID_ACTION ); }

◆ suppressAction() [2/2]

void FileMgr::suppressAction ( const std::string f,
const Io::Action a 
)
override

Definition at line 1166 of file FileMgr.cpp.

1166 { m_supMap[f].set( a ); }

Member Data Documentation

◆ m_actions

std::map<IoTech, actionMap> FileMgr::m_actions
private

Definition at line 152 of file FileMgr.h.

◆ m_attr

std::vector<std::unique_ptr<FileAttr> > FileMgr::m_attr
private

Definition at line 148 of file FileMgr.h.

◆ m_descriptors

std::map<Fd, FileAttr*> FileMgr::m_descriptors
private

Definition at line 147 of file FileMgr.h.

◆ m_files

fileMap FileMgr::m_files
private

Definition at line 145 of file FileMgr.h.

◆ m_handlers

std::map<IoTech, FileHdlr> FileMgr::m_handlers
private

Definition at line 146 of file FileMgr.h.

◆ m_lastErr

int FileMgr::m_lastErr
private

Definition at line 157 of file FileMgr.h.

◆ m_lastErrS

std::string FileMgr::m_lastErrS
private

Definition at line 156 of file FileMgr.h.

◆ m_loadPosixHandler

Gaudi::Property<bool> FileMgr::m_loadPosixHandler { this, "LoadPOSIXHandler", true }
private

Definition at line 126 of file FileMgr.h.

◆ m_loadRootHandler

Gaudi::Property<bool> FileMgr::m_loadRootHandler { this, "LoadROOTHandler", true }
private

Definition at line 125 of file FileMgr.h.

◆ m_logfile

Gaudi::Property<std::string> FileMgr::m_logfile { this, "LogFile" }
private

Definition at line 123 of file FileMgr.h.

◆ m_oldFiles

std::vector<FileAttr*> FileMgr::m_oldFiles
private

Definition at line 150 of file FileMgr.h.

◆ m_pfh

std::optional<POSIXFileHandler> FileMgr::m_pfh
private

Definition at line 160 of file FileMgr.h.

◆ m_printSummary

Gaudi::Property<bool> FileMgr::m_printSummary { this, "PrintSummary", false }
private

Definition at line 124 of file FileMgr.h.

◆ m_rfh

std::optional<RootFileHandler> FileMgr::m_rfh
private

Definition at line 159 of file FileMgr.h.

◆ m_ssl_cert

Gaudi::Property<std::string> FileMgr::m_ssl_cert { this, "TSSL_CertDir", "X509" }
private

Definition at line 129 of file FileMgr.h.

◆ m_ssl_proxy

Gaudi::Property<std::string> FileMgr::m_ssl_proxy { this, "TSSL_UserProxy", "X509" }
private

Definition at line 128 of file FileMgr.h.

◆ m_supMap

std::map<std::string, Io::Action_bitmap> FileMgr::m_supMap
private

Definition at line 154 of file FileMgr.h.


The documentation for this class was generated from the following files:
Io::FileHdlr::b_closeP_fcn
bfcn_closeP_t b_closeP_fcn
Definition: IFileMgr.h:259
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:25
FileMgr::m_rfh
std::optional< RootFileHandler > m_rfh
Definition: FileMgr.h:159
Io::IoTech
IoTech
Definition: IFileMgr.h:156
Io::CLOSE
@ CLOSE
Definition: IFileMgr.h:278
FileMgr::execActs
StatusCode execActs(Io::FileAttr *, const std::string &, const Io::Action &, const actionMap &m) const
Definition: FileMgr.cpp:1115
FileMgr::m_pfh
std::optional< POSIXFileHandler > m_pfh
Definition: FileMgr.h:160
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:118
FileMgr::getFiles
int getFiles(std::vector< std::string > &, bool onlyOpen=true) const override
Definition: FileMgr.cpp:780
FileMgr::m_oldFiles
std::vector< FileAttr * > m_oldFiles
Definition: FileMgr.h:150
std::string
STL class.
FileMgr::m_loadPosixHandler
Gaudi::Property< bool > m_loadPosixHandler
Definition: FileMgr.h:126
Io::INVALID
@ INVALID
Definition: IFileMgr.h:47
Gaudi.Configuration.log
log
Definition: Configuration.py:28
Io::FileAttr::tech
IoTech tech() const
Definition: IFileMgr.h:188
FileMgr::m_ssl_proxy
Gaudi::Property< std::string > m_ssl_proxy
Definition: FileMgr.h:128
Io::open_t
int open_t
Definition: IFileMgr.h:243
FileMgr::fd
Io::Fd fd(const std::string &) const override
Definition: FileMgr.cpp:949
FileMgr::suppressAction
void suppressAction(const std::string &) override
Definition: FileMgr.cpp:1162
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
Io::FileAttr::flags
IoFlags flags() const
Definition: IFileMgr.h:189
std::pair
Io::CLOSE_ERR
@ CLOSE_ERR
Definition: IFileMgr.h:278
FileMgr::m_supMap
std::map< std::string, Io::Action_bitmap > m_supMap
Definition: FileMgr.h:154
FileMgr::m_loadRootHandler
Gaudi::Property< bool > m_loadRootHandler
Definition: FileMgr.h:125
std::find_if
T find_if(T... args)
std::vector::size
T size(T... args)
std::back_inserter
T back_inserter(T... args)
FileMgr::listActions
virtual void listActions() const
Definition: FileMgr.cpp:1072
std::none_of
T none_of(T... args)
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:315
std::function::target_type
T target_type(T... args)
FileMgr::getHandler
StatusCode getHandler(const IoTech &, FileHdlr &) const override
Io::FileHdlr::tech
IoTech tech
Definition: IFileMgr.h:255
Io::WRITE
@ WRITE
Definition: IFileMgr.h:38
ON_DEBUG
#define ON_DEBUG
Definition: FileMgr.cpp:17
FileMgr::open
Io::open_t open(const Io::IoTech &, const std::string &caller, const std::string &fname, const Io::IoFlags &, Io::Fd &fd, void *&ptr, const std::string &desc="", const bool shared=false) override
Definition: FileMgr.cpp:242
Io::REOPEN_ERR
@ REOPEN_ERR
Definition: IFileMgr.h:278
CommonMessaging< implements< IService, IProperty, IStateful > >::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition: CommonMessaging.h:148
Io::reopen_t
int reopen_t
Definition: IFileMgr.h:245
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:222
std::vector::clear
T clear(T... args)
AvalancheSchedulerErrorTest.msgSvc
msgSvc
Definition: AvalancheSchedulerErrorTest.py:80
std::vector::push_back
T push_back(T... args)
Io::FileAttr::name
const std::string & name() const
Definition: IFileMgr.h:186
bug_34121.t
t
Definition: bug_34121.py:31
FileMgr::fname
const std::string & fname(const Io::Fd &) const override
Definition: FileMgr.cpp:931
AlgSequencer.s1
s1
Definition: AlgSequencer.py:35
FileMgr::regHandler
StatusCode regHandler(FileHdlr) override
Definition: FileMgr.cpp:186
StatusCode
Definition: StatusCode.h:65
Io::ROOT
@ ROOT
Definition: IFileMgr.h:156
FileMgr::m_handlers
std::map< IoTech, FileHdlr > m_handlers
Definition: FileMgr.h:146
FileMgr::execAction
StatusCode execAction(Io::FileAttr *, const std::string &, const Io::Action &) const
Definition: FileMgr.cpp:1097
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:108
ProduceConsume.j
j
Definition: ProduceConsume.py:104
Io::FileHdlr::b_open_fcn
bfcn_open_t b_open_fcn
Definition: IFileMgr.h:257
std::ofstream
STL class.
Io::UNKNOWN
@ UNKNOWN
Definition: IFileMgr.h:156
Io::RDWR
@ RDWR
Definition: IFileMgr.h:39
FileMgr::m_logfile
Gaudi::Property< std::string > m_logfile
Definition: FileMgr.h:123
Io::FileAttr
Definition: IFileMgr.h:171
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:237
FileMgr::m_descriptors
std::map< Fd, FileAttr * > m_descriptors
Definition: FileMgr.h:147
Io::FileAttr::fptr
void * fptr() const
Definition: IFileMgr.h:191
std::ofstream::close
T close(T... args)
Io::FileHdlr::b_reopen_fcn
bfcn_reopen_t b_reopen_fcn
Definition: IFileMgr.h:260
std::multimap::erase
T erase(T... args)
std::copy_if
T copy_if(T... args)
FileMgr::m_ssl_cert
Gaudi::Property< std::string > m_ssl_cert
Definition: FileMgr.h:129
std::ofstream::open
T open(T... args)
genconfuser.verbose
verbose
Definition: genconfuser.py:28
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
FileMgr::m_lastErrS
std::string m_lastErrS
Definition: FileMgr.h:156
Io::FileAttr::fd
Fd fd() const
Definition: IFileMgr.h:185
std::bad_function_call
Io::Fd
int Fd
Definition: IFileMgr.h:169
Io::close_t
int close_t
Definition: IFileMgr.h:244
std::transform
T transform(T... args)
FileMgr::listSuppression
virtual void listSuppression() const
Definition: FileMgr.cpp:1170
cpluginsvc.n
n
Definition: cpluginsvc.py:234
Io::FileAttr::isShared
bool isShared() const
Definition: IFileMgr.h:193
FileMgr::m_printSummary
Gaudi::Property< bool > m_printSummary
Definition: FileMgr.h:124
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
Io::FileHdlr::b_reopenP_fcn
bfcn_reopenP_t b_reopenP_fcn
Definition: IFileMgr.h:261
std::multimap::equal_range
T equal_range(T... args)
FileMgr::regAction
StatusCode regAction(Io::bfcn_action_t, const Io::Action &, const std::string &desc="") override
Definition: FileMgr.cpp:1053
Io::INVALID_ACTION
@ INVALID_ACTION
Definition: IFileMgr.h:278
FileMgr::listFiles
void listFiles() const override
Definition: FileMgr.cpp:985
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
FileMgr::actionMap
std::map< Io::Action, std::list< bfcn_desc_t > > actionMap
Definition: FileMgr.h:136
std::begin
T begin(T... args)
Io::FileAttr::isOpen
bool isOpen() const
Definition: IFileMgr.h:192
FileMgr::m_actions
std::map< IoTech, actionMap > m_actions
Definition: FileMgr.h:152
std::set::insert
T insert(T... args)
Io::REOPEN
@ REOPEN
Definition: IFileMgr.h:278
FileMgr::listHandlers
void listHandlers() const override
Definition: FileMgr.cpp:1043
FileMgr::getFd
int getFd(std::vector< Fd > &) const override
Io::FileHdlr
Definition: IFileMgr.h:254
std::count_if
T count_if(T... args)
std::multimap::empty
T empty(T... args)
Io::POSIX
@ POSIX
Definition: IFileMgr.h:156
std::end
T end(T... args)
ON_VERBOSE
#define ON_VERBOSE
Definition: FileMgr.cpp:18
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Io::Action
Action
Definition: IFileMgr.h:278
Service::m_outputLevel
Gaudi::Property< int > m_outputLevel
flag indicating whether ToolHandle tools have been added to m_tools
Definition: Service.h:232
Io::IoFlags
Definition: IFileMgr.h:50
std::set
STL class.
FileMgr::m_files
fileMap m_files
Definition: FileMgr.h:145
Io::FileHdlr::b_close_fcn
bfcn_close_t b_close_fcn
Definition: IFileMgr.h:258
Io::READ
@ READ
Definition: IFileMgr.h:37
std::bad_function_call::what
T what(T... args)
FileMgr::m_lastErr
int m_lastErr
Definition: FileMgr.h:157
AlgSequencer.s2
s2
Definition: AlgSequencer.py:36
FileMgr::m_attr
std::vector< std::unique_ptr< FileAttr > > m_attr
Definition: FileMgr.h:148