33 using extends::extends;
40 std::unique_ptr<std::istream>
open( std::string
const& url )
override;
43 const std::vector<std::string>&
protocols()
const override;
47 this,
"FileAccessTools", { {
"FileReadTool" } },
"List of tools implementing the IFileAccess interface." };
49 "URL prefix to use if the prefix is not present." };
88 error() << i <<
" does not implement IFileAccess" <<
endmsg;
94 for (
const auto& prot : hndlr->protocols() )
m_urlHandlers[prot].emplace_back( hndlr.get() );
125 auto pos = url.find(
"://" );
127 if ( url.npos == pos ) {
132 const std::string url_prefix( url, 0, pos );
140 std::unique_ptr<std::istream> out;
142 for (
auto hndlr : handlers->second ) {
143 out = hndlr->open( url );
155 [](
const auto& pair ) { return pair.first; } );
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
#define DECLARE_COMPONENT(type)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Implementation of property with value of concrete type.
Common class providing an architecture-independent hash map.
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
StatusCode finalize() override
StatusCode initialize() override
Small smart pointer class with automatic reference counting for IInterface.
This class is used for returning status codes from appropriate routines.
constexpr static const auto FAILURE
Simple service that allows to read files independently from the storage.
std::vector< IAlgTool * > m_acquiredTools
List of acquired tools (needed to release them).
Gaudi::Property< std::string > m_fallBackProtocol
Gaudi::Property< std::vector< std::string > > m_urlHandlersNames
StatusCode initialize() override
Initialize Service.
const std::vector< std::string > & protocols() const override
StatusCode finalize() override
Finalize Service.
std::unique_ptr< std::istream > open(std::string const &url) override
std::vector< std::string > m_protocols
Protocols registered.
SmartIF< IToolSvc > m_toolSvc
Handle to the tool service.
GaudiUtils::HashMap< std::string, std::vector< IFileAccess * > > m_urlHandlers
Map of the tools handling the known protocols.
Base class used to extend a class implementing other interfaces.