VFSSvc.h
Go to the documentation of this file.
1 #ifndef GaudiSvc_VFSSvc_H
2 #define GaudiSvc_VFSSvc_H 1
3 
4 // Include files
5 #include "GaudiKernel/Service.h"
6 #include "GaudiKernel/IFileAccess.h"
7 #include "GaudiKernel/HashMap.h"
8 
9 #include <list>
10 
11 // Forward declarations
12 class IToolSvc;
13 class IAlgTool;
14 
26 class VFSSvc: public extends1<Service, IFileAccess> {
27 public:
29  StatusCode initialize() override;
31  StatusCode finalize() override;
32 
34  std::unique_ptr<std::istream> open(const std::string &url) override;
35 
37  const std::vector<std::string> &protocols() const override;
38 
40  VFSSvc(const std::string& name, ISvcLocator* svcloc);
41 
42  ~VFSSvc() override = default;
43 
44 private:
45 
47  std::vector<std::string> m_urlHandlersNames = { { "FileReadTool" } };
48 
50  std::vector<std::string> m_protocols;
51 
53  std::string m_fallBackProtocol;
54 
57 
60 
62  std::vector<IAlgTool*> m_acquiredTools;
63 
64 };
65 
66 #endif
The interface implemented by the IToolSvc base class.
Definition: IToolSvc.h:18
SmartIF< IToolSvc > m_toolSvc
Handle to the tool service.
Definition: VFSSvc.h:59
std::unique_ptr< std::istream > open(const std::string &url) override
Definition: VFSSvc.cpp:79
std::vector< std::string > m_protocols
Protocols registered.
Definition: VFSSvc.h:50
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
StatusCode initialize() override
Initialize Service.
Definition: VFSSvc.cpp:20
std::string m_fallBackProtocol
Protocol to use in case there is not a specific tool to handle the URL.
Definition: VFSSvc.h:53
GaudiUtils::HashMap< std::string, IFileAccess * > m_urlHandlers
Map of the tools handling the known protocols.
Definition: VFSSvc.h:56
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
VFSSvc(const std::string &name, ISvcLocator *svcloc)
Standard constructor.
Definition: VFSSvc.cpp:10
~VFSSvc() override=default
Destructor.
StatusCode finalize() override
Finalize Service.
Definition: VFSSvc.cpp:64
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
std::vector< IAlgTool * > m_acquiredTools
List of acquired tools (needed to release them).
Definition: VFSSvc.h:62
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
Simple service that allows to read files independently from the storage.
Definition: VFSSvc.h:26
const std::vector< std::string > & protocols() const override
Definition: VFSSvc.cpp:107
std::vector< std::string > m_urlHandlersNames
Names of the handlers to use.
Definition: VFSSvc.h:47