JobOptionsSvc.h
Go to the documentation of this file.
1 #ifndef JOBOPTIONSSVC_H_
2 #define JOBOPTIONSSVC_H_
3 
4 #include "GaudiKernel/StatusCode.h"
5 #include "GaudiKernel/IProperty.h"
6 #include "GaudiKernel/IJobOptionsSvc.h"
7 #include "GaudiKernel/Property.h"
8 #include "GaudiKernel/PropertyMgr.h"
9 #include "GaudiKernel/Service.h"
10 
11 #include "SvcCatalog.h"
12 
13 #include <vector>
14 
15 namespace Gaudi { namespace Parsers {
16  class Catalog;
17 }}
18 
19 
20 class JobOptionsSvc : public extends2<Service, IProperty, IJobOptionsSvc> {
21  public:
22  typedef std::vector<const Property*> PropertiesT;
23  // unhides some of Service's methods
27  // Constructor
28  JobOptionsSvc(const std::string& name,ISvcLocator* svc);
30  ~JobOptionsSvc() override = default;
31  StatusCode initialize () override;
32 
37  StatusCode setMyProperties(const std::string& client,
38  IProperty* me ) override ;
39 
41  StatusCode addPropertyToCatalogue( const std::string& client,
42  const Property& property ) override;
43 
45  StatusCode removePropertyFromCatalogue( const std::string& client,
46  const std::string& name ) override;
48  const std::vector<const Property*>*
49  getProperties( const std::string& client) const override;
50 
52  std::vector<std::string> getClients() const override;
53 
60  StatusCode readOptions ( const std::string& file,
61  const std::string& path = "" ) override;
62 
64  StatusCode setProperty(const Property& p) override;
65  StatusCode getProperty(Property *p) const override;
66  private:
67  void fillServiceCatalog(const Gaudi::Parsers::Catalog& catalog);
68  void dump (const std::string& file,
69  const Gaudi::Parsers::Catalog& catalog) const ;
71 
72  private:
74  std::string m_source_path;
75  std::string m_source_type;
76  std::string m_dir_search_path;
77  std::string m_dump;
78  std::string m_pythonAction;
79  std::string m_pythonParams;
81 };
82 #endif /* JOBOPTIONSSVC_H_ */
void fillServiceCatalog(const Gaudi::Parsers::Catalog &catalog)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
std::vector< std::string > getClients() const override
Get the list of clients.
std::string m_source_type
Definition: JobOptionsSvc.h:75
std::string m_pythonAction
Definition: JobOptionsSvc.h:78
SvcCatalog m_svc_catalog
Definition: JobOptionsSvc.h:80
list path
Definition: __init__.py:15
StatusCode setProperty(const Property &p) override
Definition: Service.cpp:331
Property manager helper class.
Definition: PropertyMgr.h:35
StatusCode getProperty(Property *p) const override
std::string m_dir_search_path
Definition: JobOptionsSvc.h:76
const std::vector< Property * > & getProperties() const override
Definition: Service.cpp:355
void dump(const std::string &file, const Gaudi::Parsers::Catalog &catalog) const
StatusCode setMyProperties(const std::string &client, IProperty *me) override
Override default properties of the calling client.
StatusCode setProperty(const Property &p) override
IProperty implementation (needed for initialisation)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::string m_dump
Definition: JobOptionsSvc.h:77
list file
Definition: ana.py:160
~JobOptionsSvc() override=default
destructor
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
StatusCode getProperty(Property *p) const override
Definition: Service.cpp:343
const std::vector< const Property * > * getProperties(const std::string &client) const override
Get the properties associated to a given client.
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 ...
StatusCode removePropertyFromCatalogue(const std::string &client, const std::string &name) override
Remove a property from the JobOptions catalog.
StatusCode addPropertyToCatalogue(const std::string &client, const Property &property) override
Add a property into the JobOptions catalog.
StatusCode initialize() override
std::string m_pythonParams
Definition: JobOptionsSvc.h:79
JobOptionsSvc(const std::string &name, ISvcLocator *svc)
PropertyMgr m_pmgr
dump the content of Properties catalog to the predefined file
Definition: JobOptionsSvc.h:73
std::vector< const Property * > PropertiesT
Definition: JobOptionsSvc.h:22
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
std::string m_source_path
Definition: JobOptionsSvc.h:74
Helper functions to set/get the application return code.
Definition: __init__.py:1