Go to the documentation of this file.
34 #if __cplusplus >= 201703
35 # include <string_view>
37 # include <experimental/string_view>
39 using experimental::string_view;
83 if ( !p.second.isBound() ) unused.
emplace_back( p.first );
86 if ( !unused.
empty() ) {
88 auto&
log = warning();
89 log << unused.
size() <<
" unused properties:";
90 for (
const auto& k : unused )
log <<
"\n - " << k;
106 error() <<
"Unable to open dump-file \"" + file +
"\"" <<
endmsg;
109 info() <<
"Properties are dumped into \"" + file +
"\"" <<
endmsg;
117 error() <<
"Unable to open dump-file \"" + file +
"\"" <<
endmsg;
119 info() <<
"Properties are dumped into \"" + file +
"\"" <<
endmsg;
120 for (
const auto& [
key, value] :
items() ) {
121 out <<
key <<
" = " << value <<
';';
129 for (
const auto& client : catalog ) {
130 for (
const auto& current : client.second ) {
131 set( client.first +
'.' + current.NameInClient(), current.ValueAsString() );
141 debug() <<
"Reading options from the file "
142 <<
"'" << file <<
"'" <<
endmsg;
156 info() <<
"Job options successfully read in from " << file <<
endmsg;
159 fatal() <<
"Job options errors." <<
endmsg;
172 if ( regex_match(
key, match, p.first ) ) { defaultValue = {
true, p.second}; }
179 if ( std::get<0>( defaultValue ) )
set(
key,
std::string{std::get<1>( defaultValue )} );
185 if ( !defaults_only || !p.second.isSet() ) {
186 if ( regex_match( p.first, match, filter ) ) { p.second = value; }
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
StatusCode initialize() override
Gaudi::Property< bool > m_reportUnused
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
Gaudi::Property< std::string > m_pythonAction
Gaudi::Property< std::string > m_source_path
void set(const std::string &key, const std::string &value) override
void bind(const std::string &prefix, Gaudi::Details::PropertyBase *property) override
Gaudi::Property< std::string > m_pythonParams
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Gaudi::Details::PropertyBase * property(std::string_view name) const
\fixme property and bindPropertiesTo should be protected
void broadcast(const std::regex &filter, const std::string &value, OnlyDefaults defaults_only) override
StatusCode start() override
std::string ToString(int indent=0) const
Gaudi::Property< std::string > m_dump
StatusCode stop() override
Gaudi::Property< std::vector< std::pair< std::string, std::string > > > m_globalDefaultsProp
Details::PropertyBase & declareUpdateHandler(std::function< void(Details::PropertyBase &)> fun) override
set new callback for update
StatusCode readOptions(std::string_view file, std::string_view path="") override
look for file 'file' into search path 'path' and read it to update existing JobOptionsCatalogue
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
GAUDI_API bool isEnvSet(const char *var)
Check if an environment variable is set or not.
bool ReadOptions(std::string_view filename, std::string_view search_path, Messages *messages, Catalog *catalog, Units *units, PragmaOptions *pragma, Node *root)
Parse and analyze filename, save all messages and properties.
void dump(const std::string &file, const Gaudi::Parsers::Catalog &catalog) const
dump properties catalog to file
Gaudi::Property< std::string > m_dir_search_path
T emplace_back(T... args)
constexpr static const auto SUCCESS
StatusCode stop() override
StatusCode initialize() override
Gaudi::Property< std::string > m_source_type
#define DECLARE_COMPONENT(type)
constexpr static const auto FAILURE
void fillServiceCatalog(const Gaudi::Parsers::Catalog &catalog)
std::vector< std::tuple< std::string, std::string > > items() const override
const std::string & dumpFile() const
bool has(const std::string &key) const override
std::vector< std::pair< std::regex, std::string > > m_globalDefaults
JobOptionsSvc(const std::string &name, ISvcLocator *svc)