| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 extends<Service,
27 IFileAccess> {
28 public:
30 StatusCode initialize() override;
32 StatusCode finalize() override;
33
35 std::unique_ptr<std::istream> open(const std::string &url) override;
36
38 const std::vector<std::string> &protocols() const override;
39
41 VFSSvc(const std::string& name, ISvcLocator* svcloc);
42
43 ~VFSSvc() override = default;
44
45 private:
46
48 std::vector<std::string> m_urlHandlersNames = { { "FileReadTool" } };
49
51 std::vector<std::string> m_protocols;
52
54 std::string m_fallBackProtocol;
55
57 GaudiUtils::HashMap<std::string,IFileAccess*> m_urlHandlers;
58
60 SmartIF<IToolSvc> m_toolSvc;
61
63 std::vector<IAlgTool*> m_acquiredTools;
64
65 };
66
67 #endif
IToolSvc
The interface implemented by the IToolSvc base class.
Definition: IToolSvc.h:18
VFSSvc::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
Handle to the tool service.
Definition: VFSSvc.h:60
SmartIF< IToolSvc >
VFSSvc::open
std::unique_ptr< std::istream > open(const std::string &url) override
Definition: VFSSvc.cpp:78
VFSSvc::m_protocols
std::vector< std::string > m_protocols
Protocols registered.
Definition: VFSSvc.h:51
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
VFSSvc::initialize
StatusCode initialize() override
Initialize Service.
Definition: VFSSvc.cpp:20
VFSSvc::m_fallBackProtocol
std::string m_fallBackProtocol
Protocol to use in case there is not a specific tool to handle the URL.
Definition: VFSSvc.h:54
IFileAccess.h
VFSSvc::m_urlHandlers
GaudiUtils::HashMap< std::string, IFileAccess * > m_urlHandlers
Map of the tools handling the known protocols.
Definition: VFSSvc.h:57
HashMap.h
std::string
STL class.
Service.h
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
VFSSvc::VFSSvc
VFSSvc(const std::string &name, ISvcLocator *svcloc)
Standard constructor.
Definition: VFSSvc.cpp:10
VFSSvc::~VFSSvc
~VFSSvc() override=default
Destructor.
std::vector< std::string >
std::unique_ptr
STL class.
VFSSvc::finalize
StatusCode finalize() override
Finalize Service.
Definition: VFSSvc.cpp:63
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
VFSSvc::m_acquiredTools
std::vector< IAlgTool * > m_acquiredTools
List of acquired tools (needed to release them).
Definition: VFSSvc.h:63
IAlgTool
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
GaudiUtils::HashMap< std::string, IFileAccess * >
VFSSvc
Simple service that allows to read files independently from the storage.
Definition: VFSSvc.h:26
VFSSvc::protocols
const std::vector< std::string > & protocols() const override
Definition: VFSSvc.cpp:106
VFSSvc::m_urlHandlersNames
std::vector< std::string > m_urlHandlersNames
Names of the handlers to use.
Definition: VFSSvc.h:48