13 declareProperty(
"FileAccessTools",m_urlHandlersNames,
14 "List of tools implementing the IFileAccess interface.");
16 declareProperty(
"FallBackProtocol",m_fallBackProtocol =
"file",
17 "URL prefix to use if the prefix is not present.");
42 error() <<
i <<
" does not implement IFileAccess" <<
endmsg;
53 error() <<
"No handler specified for fallback protocol prefix "
81 auto pos = url.
find(
"://");
83 if (std::string::npos == pos) {
99 constexpr
struct select1st_t
101 template <
typename S,
typename T>
102 const S& operator() (
const std::pair<S,T> &x)
const {
return x.first; }
SmartIF< IToolSvc > m_toolSvc
Handle to the tool service.
StatusCode initialize() override
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
std::unique_ptr< std::istream > open(const std::string &url) override
std::vector< std::string > m_protocols
Protocols registered.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
StatusCode finalize() override
StatusCode initialize() override
Initialize Service.
constexpr struct select1st_t select1st
std::string m_fallBackProtocol
Protocol to use in case there is not a specific tool to handle the URL.
GaudiUtils::HashMap< std::string, IFileAccess * > m_urlHandlers
Map of the tools handling the known protocols.
bool isFailure() const
Test for a status code of FAILURE.
#define DECLARE_COMPONENT(type)
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
iterator find(const key_type &key)
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.
const std::vector< std::string > & protocols() const override
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.
std::vector< std::string > m_urlHandlersNames
Names of the handlers to use.