| The Gaudi Framework v32r1 (f65d50dc)

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/HashMap.h"
6 #include "GaudiKernel/IFileAccess.h"
7 #include "GaudiKernel/Service.h"
8
9 #include <list>
10
11 // Forward declarations
12 class IToolSvc;
13 class IAlgTool;
14
26 class VFSSvc : public extends<Service, IFileAccess> {
27 public:
29 using extends::extends;
31 StatusCode initialize() override;
33 StatusCode finalize() override;
34
36 std::unique_ptr<std::istream> open( const std::string& url ) override;
37
39 const std::vector<std::string>& protocols() const override;
40
41 private:
42 Gaudi::Property<std::vector<std::string>> m_urlHandlersNames{
43 this, "FileAccessTools", {{"FileReadTool"}}, "List of tools implementing the IFileAccess interface."};
44 Gaudi::Property<std::string> m_fallBackProtocol{this, "FallBackProtocol", "file",
45 "URL prefix to use if the prefix is not present."};
46
48 std::vector<std::string> m_protocols;
49
51 GaudiUtils::HashMap<std::string, std::vector<IFileAccess*>> m_urlHandlers;
52
54 SmartIF<IToolSvc> m_toolSvc;
55
57 std::vector<IAlgTool*> m_acquiredTools;
58 };
59
60 #endif
IToolSvc
The interface implemented by the IToolSvc base class.
Definition: IToolSvc.h:19
VFSSvc::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
Handle to the tool service.
Definition: VFSSvc.h:54
SmartIF< IToolSvc >
VFSSvc::open
std::unique_ptr< std::istream > open(const std::string &url) override
Definition: VFSSvc.cpp:66
VFSSvc::m_protocols
std::vector< std::string > m_protocols
Protocols registered.
Definition: VFSSvc.h:48
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
VFSSvc::initialize
StatusCode initialize() override
Initialize Service.
Definition: VFSSvc.cpp:10
IFileAccess.h
HashMap.h
std::string
STL class.
Service.h
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
VFSSvc::m_fallBackProtocol
Gaudi::Property< std::string > m_fallBackProtocol
Definition: VFSSvc.h:44
std::vector< std::string >
std::unique_ptr
STL class.
VFSSvc::finalize
StatusCode finalize() override
Finalize Service.
Definition: VFSSvc.cpp:51
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
VFSSvc::m_urlHandlersNames
Gaudi::Property< std::vector< std::string > > m_urlHandlersNames
Definition: VFSSvc.h:42
VFSSvc::m_acquiredTools
std::vector< IAlgTool * > m_acquiredTools
List of acquired tools (needed to release them).
Definition: VFSSvc.h:57
IAlgTool
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
GaudiUtils::HashMap
Common class providing an architecture-independent hash map.
Definition: HashMap.h:73
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:103
VFSSvc::m_urlHandlers
GaudiUtils::HashMap< std::string, std::vector< IFileAccess * > > m_urlHandlers
Map of the tools handling the known protocols.
Definition: VFSSvc.h:51