15 #include "GaudiKernel/IProperty.h"
16 #include "GaudiKernel/Property.h"
18 #include "GaudiKernel/MsgStream.h"
19 #include "GaudiKernel/System.h"
33 if ( !tmp.empty() && (
"UNKNOWN" != tmp) ) { m_dir_search_path = tmp ; }
35 if ( !tmp.empty() && (
"UNKNOWN" != tmp) ) { m_dump = tmp ; }
37 m_pmgr.declareProperty(
"TYPE" , m_source_type ) ;
38 m_pmgr.declareProperty(
"PATH" , m_source_path ) ;
39 m_pmgr.declareProperty(
"SEARCHPATH" , m_dir_search_path ) ;
40 m_pmgr.declareProperty(
"DUMPFILE" , m_dump ) ;
41 m_pmgr.declareProperty(
"PYTHONACTION" , m_pythonAction ) ;
42 m_pmgr.declareProperty(
"PYTHONPARAMS" , m_pythonParams ) ;
75 (
const std::string& client,
79 return property.
load( *p ) ? m_svc_catalog.addProperty( client , p.release() )
85 (
const std::string& client,
86 const std::string&
name )
88 return m_svc_catalog.removeProperty(client,name);
104 for (
const auto& cur : *props )
112 <<
"Unable to set the property '" << cur->name() <<
"'"
113 <<
" of '" << client <<
"'. "
114 <<
"Check option and algorithm names, type and bounds."
129 const gp::Catalog& catalog)
const {
131 std::ofstream out( file , std::ios_base::out | std::ios_base::trunc );
136 log <<
MSG::INFO <<
"Properties are dumped into \""+file+
"\"" <<
endmsg ;
142 for (
const auto& client : catalog) {
143 for (
const auto& current : client.second ) {
146 current.ValueAsString() } );
152 const std::string&
path) {
153 std::string search_path =
path;
160 <<
"Reading options from the file "
161 <<
"'" << file <<
"'" <<
endmsg;
162 gp::Messages messages(my_log);
165 gp::PragmaOptions pragma;
173 if (pragma.IsPrintOptions()) {
174 my_log <<
MSG::INFO <<
"Print options" << std::endl << catalog
177 if (pragma.IsPrintTree()) {
178 my_log <<
MSG::INFO <<
"Print tree:" << std::endl << ast.ToString()
181 if (pragma.HasDumpFile())
dump(pragma.dumpFile(), catalog);
183 <<
"Job options successfully read in from " << file <<
endmsg;
Definition of the MsgStream class used to transmit messages.
StatusCode initialize() override
void fillServiceCatalog(const Gaudi::Parsers::Catalog &catalog)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
std::vector< std::string > getClients() const override
Get the list of clients.
std::string m_source_type
const PropertiesT * getProperties(const std::string &client) const
const std::string & name() const
property name
StatusCode setProperty(const Property &p) override
set the property form another property
std::string m_pythonAction
bool isSuccess() const
Test for a status code of SUCCESS.
bool ReadOptions(const std::string &filename, const std::string &search_path, Messages *messages, Catalog *catalog, Units *units, PragmaOptions *pragma, Node *root)
Parse and analyze filename, save all messages and properties.
StatusCode evaluateConfig(const std::string &filename, const std::string &preAction, const std::string &postAction)
bool isFailure() const
Test for a status code of FAILURE.
StatusCode getProperty(Property *p) const override
std::vector< std::string > getClients() const
std::string m_dir_search_path
StatusCode getProperty(Property *p) const override
get the property
SimpleProperty< std::string > StringProperty
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.
#define DECLARE_COMPONENT(type)
virtual StatusCode setProperty(const Property &p)=0
Set the property by property.
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Property base class allowing Property* collections to be "homogeneous".
Base class used to extend a class implementing other interfaces.
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
bool load(Property &dest) const override
set value for another property
PropertyMgr m_pmgr
dump the content of Properties catalog to the predefined file
std::vector< const Property * > PropertiesT
The IProperty is the basic interface for all components which have properties that can be set or get...
std::string m_source_path
Helper functions to set/get the application return code.