| The Gaudi Framework v32r1 (f65d50dc)

JobOptionsSvc.h
Go to the documentation of this file.
1 #ifndef JOBOPTIONSSVC_H_
2 #define JOBOPTIONSSVC_H_
3
4 #include "GaudiKernel/IJobOptionsSvc.h"
5 #include "GaudiKernel/IProperty.h"
6 #include "GaudiKernel/Property.h"
7 #include "GaudiKernel/PropertyHolder.h"
8 #include "GaudiKernel/Service.h"
9 #include "GaudiKernel/StatusCode.h"
10
11 #include "SvcCatalog.h"
12
13 #include <vector>
14
15 namespace Gaudi {
16 namespace Parsers {
17 class Catalog;
18 }
19 } // namespace Gaudi
20
21 class JobOptionsSvc : public extends<Service, IJobOptionsSvc> {
22 public:
23 typedef std::vector<const Gaudi::Details::PropertyBase*> PropertiesT;
24 // Constructor
25 JobOptionsSvc( const std::string& name, ISvcLocator* svc );
26
27 StatusCode initialize() override;
28
33 StatusCode setMyProperties( const std::string& client, IProperty* me ) override;
34
36 StatusCode addPropertyToCatalogue( const std::string& client, const Gaudi::Details::PropertyBase& property ) override;
37
39 StatusCode removePropertyFromCatalogue( const std::string& client, const std::string& name ) override;
40
41 using Service::getProperties;
43 const std::vector<const Gaudi::Details::PropertyBase*>* getProperties( const std::string& client ) const override;
44
45 using Service::getProperty;
47 const Gaudi::Details::PropertyBase* getClientProperty( const std::string& client,
48 const std::string& name ) const override {
49 return m_svc_catalog.getProperty( client, name );
50 }
52 std::vector<std::string> getClients() const override;
53
60 StatusCode readOptions( const std::string& file, const std::string& path = "" ) override;
61
62 private:
63 void fillServiceCatalog( const Gaudi::Parsers::Catalog& catalog );
64 void dump( const std::string& file, const Gaudi::Parsers::Catalog& catalog ) const;
66
67 private:
68 Gaudi::Property<std::string> m_source_type{this, "TYPE"};
69 Gaudi::Property<std::string> m_source_path{this, "PATH"};
70 Gaudi::Property<std::string> m_dir_search_path{this, "SEARCHPATH"};
71 Gaudi::Property<std::string> m_dump{this, "DUMPFILE"};
72 Gaudi::Property<std::string> m_pythonAction{this, "PYTHONACTION"};
73 Gaudi::Property<std::string> m_pythonParams{this, "PYTHONPARAMS"};
74
75 SvcCatalog m_svc_catalog;
76 };
77 #endif /* JOBOPTIONSSVC_H_ */
PropertyHolder.h
JobOptionsSvc::m_source_path
Gaudi::Property< std::string > m_source_path
Definition: JobOptionsSvc.h:69
JobOptionsSvc::fillServiceCatalog
void fillServiceCatalog(const Gaudi::Parsers::Catalog &catalog)
Definition: JobOptionsSvc.cpp:92
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >::property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition: PropertyHolder.h:264
JobOptionsSvc::getClients
std::vector< std::string > getClients() const override
Get the list of clients.
Definition: JobOptionsSvc.cpp:79
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
JobOptionsSvc::m_pythonAction
Gaudi::Property< std::string > m_pythonAction
Definition: JobOptionsSvc.h:72
SvcCatalog::getProperty
const Gaudi::Details::PropertyBase * getProperty(const std::string &client, const std::string &name) const
Definition: SvcCatalog.cpp:107
JobOptionsSvc::m_svc_catalog
SvcCatalog m_svc_catalog
Definition: JobOptionsSvc.h:75
JobOptionsSvc::m_dump
Gaudi::Property< std::string > m_dump
Definition: JobOptionsSvc.h:71
std::string
STL class.
Service.h
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
JobOptionsSvc::setMyProperties
StatusCode setMyProperties(const std::string &client, IProperty *me) override
Override default properties of the calling client.
Definition: JobOptionsSvc.cpp:61
JobOptionsSvc
Definition: JobOptionsSvc.h:21
JobOptionsSvc::m_pythonParams
Gaudi::Property< std::string > m_pythonParams
Definition: JobOptionsSvc.h:73
JobOptionsSvc::m_dir_search_path
Gaudi::Property< std::string > m_dir_search_path
Definition: JobOptionsSvc.h:70
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
JobOptionsSvc::PropertiesT
std::vector< const Gaudi::Details::PropertyBase * > PropertiesT
Definition: JobOptionsSvc.h:23
IProperty.h
std::vector
STL class.
Gaudi::Parsers::Catalog
Definition: Catalog.h:29
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
SvcCatalog.h
Property.h
JobOptionsSvc::readOptions
StatusCode readOptions(const std::string &file, const std::string &path="") override
look for file 'file' into search path 'path' and read it to update existing JobOptionsCatalogue
Definition: JobOptionsSvc.cpp:101
JobOptionsSvc::removePropertyFromCatalogue
StatusCode removePropertyFromCatalogue(const std::string &client, const std::string &name) override
Remove a property from the JobOptions catalog.
Definition: JobOptionsSvc.cpp:53
JobOptionsSvc::initialize
StatusCode initialize() override
Definition: JobOptionsSvc.cpp:29
JobOptionsSvc::m_source_type
Gaudi::Property< std::string > m_source_type
dump the content of Properties catalog to the predefined file
Definition: JobOptionsSvc.h:68
JobOptionsSvc::dump
void dump(const std::string &file, const Gaudi::Parsers::Catalog &catalog) const
Definition: JobOptionsSvc.cpp:81
JobOptionsSvc::JobOptionsSvc
JobOptionsSvc(const std::string &name, ISvcLocator *svc)
Definition: JobOptionsSvc.cpp:24
PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >::getProperty
StatusCode getProperty(Gaudi::Details::PropertyBase *p) const override
get the property
Definition: PropertyHolder.h:219
PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >::getProperties
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
Definition: PropertyHolder.h:251
StatusCode.h
JobOptionsSvc::getClientProperty
const Gaudi::Details::PropertyBase * getClientProperty(const std::string &client, const std::string &name) const override
Get a property for a client.
Definition: JobOptionsSvc.h:47
JobOptionsSvc::addPropertyToCatalogue
StatusCode addPropertyToCatalogue(const std::string &client, const Gaudi::Details::PropertyBase &property) override
Add a property into the JobOptions catalog.
Definition: JobOptionsSvc.cpp:47
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:20
SvcCatalog
Definition: SvcCatalog.h:25
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
IJobOptionsSvc.h