3 #include "GaudiKernel/MsgStream.h"
4 #include "GaudiKernel/IToolSvc.h"
5 #include "GaudiKernel/IAlgTool.h"
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.");
26 m_toolSvc = serviceLocator()->service(
"ToolSvc");
54 log <<
MSG::ERROR <<
"No handler specified for fallback protocol prefix "
79 std::unique_ptr<std::istream>
VFSSvc::open(
const std::string &url){
82 auto pos = url.find(
"://");
84 if (std::string::npos == pos) {
88 std::string url_prefix(url,0,pos);
100 constexpr
struct select1st_t
102 template <
typename S,
typename T>
103 const S& operator() (
const std::pair<S,T> &x)
const {
return x.first; }
112 std::back_inserter(const_cast<VFSSvc*>(
this)->
m_protocols),
SmartIF< IToolSvc > m_toolSvc
Handle to the tool service.
Definition of the MsgStream class used to transmit messages.
StatusCode initialize() override
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
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
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)
This class is used for returning status codes from appropriate routines.
iterator find(const key_type &key)
StatusCode finalize() override
Finalize Service.
Base class used to extend a class implementing other interfaces.
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
std::vector< std::string > m_urlHandlersNames
Names of the handlers to use.