14 #include "GaudiKernel/IProperty.h"
15 #include "GaudiKernel/Property.h"
17 #include "GaudiKernel/MsgStream.h"
18 #include "GaudiKernel/System.h"
32 if ( !tmp.empty() && (
"UNKNOWN" != tmp) ) { m_dir_search_path = tmp ; }
34 if ( !tmp.empty() && (
"UNKNOWN" != tmp) ) { m_dump = tmp ; }
36 m_pmgr.declareProperty(
"TYPE" , m_source_type ) ;
37 m_pmgr.declareProperty(
"PATH" , m_source_path ) ;
38 m_pmgr.declareProperty(
"SEARCHPATH" , m_dir_search_path ) ;
39 m_pmgr.declareProperty(
"DUMPFILE" , m_dump ) ;
68 (
const std::string& client,
73 return m_svc_catalog.addProperty( client , p.release() );
78 (
const std::string& client,
79 const std::string&
name )
81 return m_svc_catalog.removeProperty(client,name);
99 for (
const auto& cur : *props )
107 <<
"Unable to set the property '" << cur->name() <<
"'"
108 <<
" of '" << client <<
"'. "
109 <<
"Check option and algorithm names, type and bounds."
124 const gp::Catalog& catalog)
const {
127 ( file.c_str() , std::ios_base::out | std::ios_base::trunc ) ;
134 log <<
MSG::INFO <<
"Properties are dumped into \""+file+
"\"" <<
endmsg ;
141 for (
const auto& client : catalog) {
142 for (
const auto& current : client.second ) {
145 current.ValueAsString() } );
151 const std::string&
path) {
152 std::string search_path =
path;
159 <<
"Reading options from the file "
160 <<
"'" << file <<
"'" <<
endmsg;
161 gp::Messages messages(my_log);
164 gp::PragmaOptions pragma;
172 if (pragma.IsPrintOptions()) {
173 my_log <<
MSG::INFO <<
"Print options" << std::endl << catalog
176 if (pragma.IsPrintTree()) {
177 my_log <<
MSG::INFO <<
"Print tree:" << std::endl << ast.ToString()
180 if (pragma.HasDumpFile()) {
181 dump(pragma.dumpFile(), catalog);
184 <<
"Job options successfully read in from " << file <<
endmsg;
StatusCode setProperty(const Property &p)
IProperty implementation (needed for initialisation)
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...
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
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
bool isSuccess() const
Test for a status code of SUCCESS.
virtual bool load(Property &dest) const =0
export the property value to the destination
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.
bool isFailure() const
Test for a status code of FAILURE.
std::vector< std::string > getClients() const
std::string m_dir_search_path
StatusCode getProperty(Property *p) const override
get the property
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 getProperty(Property *p) const
#define DECLARE_COMPONENT(type)
This class is used for returning status codes from appropriate routines.
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)
SimpleProperty< std::string > StringProperty
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
PropertyMgr m_pmgr
dump the content of Properties catalog to the predefined file
std::vector< const Property * > PropertiesT
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.