15 m_toolSvc = serviceLocator()->service(
"ToolSvc" );
17 error() <<
"Cannot locate ToolSvc" <<
endmsg;
22 for (
const auto& i : m_urlHandlersNames ) {
26 error() <<
"Cannot get tool " << i <<
endmsg;
29 m_acquiredTools.push_back( tool );
32 error() << i <<
" does not implement IFileAccess" <<
endmsg;
38 for (
const auto& prot : hndlr->protocols() ) m_urlHandlers[prot].emplace_back( hndlr.get() );
42 if ( m_urlHandlers.find( m_fallBackProtocol ) == m_urlHandlers.end() ) {
43 error() <<
"No handler specified for fallback protocol prefix " << m_fallBackProtocol.value() <<
endmsg;
71 auto pos = url.
find(
"://" );
73 if ( std::string::npos == pos ) {
88 for (
auto hndlr : handlers->second ) {
89 out = hndlr->open( url );
99 constexpr
struct select1st_t {
100 template <
typename S,
typename T>
SmartIF< IToolSvc > m_toolSvc
Handle to the tool service.
constexpr static const auto FAILURE
StatusCode initialize() override
std::unique_ptr< std::istream > open(const std::string &url) override
std::vector< std::string > m_protocols
Protocols registered.
StatusCode finalize() override
const std::vector< std::string > & protocols() const override
#define DECLARE_COMPONENT(type)
This class is used for returning status codes from appropriate routines.
iterator find(const key_type &key)
Gaudi::Property< std::string > m_fallBackProtocol
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
StatusCode finalize() override
Finalize Service.
T back_inserter(T...args)
std::vector< IAlgTool * > m_acquiredTools
List of acquired tools (needed to release them).
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Simple service that allows to read files independently from the storage.
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
GaudiUtils::HashMap< std::string, std::vector< IFileAccess * > > m_urlHandlers
Map of the tools handling the known protocols.