The Gaudi Framework  v33r1 (b1225454)
JobOptionsSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2020 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef JOBOPTIONSSVC_H_
12 #define JOBOPTIONSSVC_H_
13 
15 #include "GaudiKernel/IProperty.h"
16 #include "GaudiKernel/Property.h"
18 #include "GaudiKernel/Service.h"
19 #include "GaudiKernel/StatusCode.h"
20 
21 #include "SvcCatalog.h"
22 
23 #include <vector>
24 
25 namespace Gaudi {
26  namespace Parsers {
27  class Catalog;
28  }
29 } // namespace Gaudi
30 
31 class JobOptionsSvc : public extends<Service, IJobOptionsSvc> {
32 public:
34  // Constructor
35  JobOptionsSvc( const std::string& name, ISvcLocator* svc );
36 
37  StatusCode initialize() override;
38  StatusCode start() override;
39 
44  StatusCode setMyProperties( const std::string& client, IProperty* me ) override;
45 
48 
50  StatusCode removePropertyFromCatalogue( const std::string& client, const std::string& name ) override;
51 
54  const std::vector<const Gaudi::Details::PropertyBase*>* getProperties( const std::string& client ) const override;
55 
59  const std::string& name ) const override {
60  return m_svc_catalog.getProperty( client, name );
61  }
63  std::vector<std::string> getClients() const override;
64 
71  StatusCode readOptions( const std::string& file, const std::string& path = "" ) override;
72 
73 private:
74  void fillServiceCatalog( const Gaudi::Parsers::Catalog& catalog );
75 
77  template <typename C>
78  void dump( const std::string& file, const C& catalog ) const;
79 
80 private:
87 
89 };
90 #endif /* JOBOPTIONSSVC_H_ */
Gaudi::Property< std::string > m_source_path
Definition: JobOptionsSvc.h:82
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:35
Gaudi::Details::PropertyBase * property(const std::string &name) const
std::vector< std::string > getClients() const override
Get the list of clients.
Implementation of property with value of concrete type.
Definition: Property.h:370
Gaudi::Property< std::string > m_pythonAction
Definition: JobOptionsSvc.h:85
const Gaudi::Details::PropertyBase * getProperty(const std::string &client, const std::string &name) const
Definition: SvcCatalog.cpp:117
SvcCatalog m_svc_catalog
Definition: JobOptionsSvc.h:88
StatusCode start() override
Gaudi::Property< std::string > m_dump
Definition: JobOptionsSvc.h:84
void dump(const std::string &file, const C &catalog) const
dump properties catalog to file
STL class.
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:284
StatusCode setMyProperties(const std::string &client, IProperty *me) override
Override default properties of the calling client.
Gaudi::Property< std::string > m_pythonParams
Definition: JobOptionsSvc.h:86
Gaudi::Property< std::string > m_dir_search_path
Definition: JobOptionsSvc.h:83
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:42
std::vector< const Gaudi::Details::PropertyBase * > PropertiesT
Definition: JobOptionsSvc.h:33
STL class.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
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 initialize() override
Gaudi::Property< std::string > m_source_type
Definition: JobOptionsSvc.h:81
JobOptionsSvc(const std::string &name, ISvcLocator *svc)
StatusCode getProperty(Gaudi::Details::PropertyBase *p) const override
get the property
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
const Gaudi::Details::PropertyBase * getClientProperty(const std::string &client, const std::string &name) const override
Get a property for a client.
Definition: JobOptionsSvc.h:58
StatusCode addPropertyToCatalogue(const std::string &client, const Gaudi::Details::PropertyBase &property) override
Add a property into the JobOptions catalog.
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:30
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1