4 #include <boost/foreach.hpp>
28 namespace gp =
Gaudi::Parsers;
40 if ( !tmp.empty() && (
"UNKNOWN" != tmp) ) { m_dir_search_path = tmp ; }
42 if ( !tmp.empty() && (
"UNKNOWN" != tmp) ) { m_dump = tmp ; }
44 m_pmgr.declareProperty(
"TYPE" , m_source_type ) ;
45 m_pmgr.declareProperty(
"PATH" , m_source_path ) ;
46 m_pmgr.declareProperty(
"SEARCHPATH" , m_dir_search_path ) ;
47 m_pmgr.declareProperty(
"DUMPFILE" , m_dump ) ;
83 (
const std::string& client,
88 return m_svc_catalog.addProperty( client , p );
93 (
const std::string& client,
94 const std::string& name )
96 return m_svc_catalog.removeProperty(client,name);
114 for ( std::vector<const Property*>::const_iterator cur = props->begin();
115 cur != props->end(); cur++)
123 <<
"Unable to set the property '" << (*cur)->name() <<
"'"
124 <<
" of '" << client <<
"'. "
125 <<
"Check option and algorithm names, type and bounds."
140 const gp::Catalog& catalog)
const {
143 ( file.c_str() , std::ios_base::out | std::ios_base::trunc ) ;
150 log <<
MSG::INFO <<
"Properties are dumped into \""+file+
"\"" <<
endmsg ;
157 BOOST_FOREACH(
const gp::Catalog::value_type& client, catalog) {
158 for (gp::Catalog::CatalogSet::mapped_type::const_iterator current
159 = client.second.begin(); current != client.second.end();
161 StringProperty tmp (current->NameInClient(), current->ValueAsString()) ;
168 const std::string&
path) {
169 std::string search_path =
path;
176 <<
"Reading options from the file "
177 <<
"'" << file <<
"'" <<
endmsg;
178 gp::Messages messages(my_log);
181 gp::PragmaOptions pragma;
189 if (pragma.IsPrintOptions()) {
190 my_log <<
MSG::INFO <<
"Print options" << std::endl << catalog
193 if (pragma.IsPrintTree()) {
194 my_log <<
MSG::INFO <<
"Print tree:" << std::endl << ast.ToString()
197 if (pragma.HasDumpFile()) {
198 dump(pragma.dumpFile(), catalog);
201 <<
"Job options successfully read in from " << file <<
endmsg;
GAUDI_API std::string getEnv(const char *var)
get a particular environment variable (returning "UNKNOWN" if not set)
StatusCode setProperty(const Property &p)
IProperty implementation (needed for initialisation)
Definition of the MsgStream class used to transmit messages.
StatusCode setProperty(const Property &p)
set the property form another property
void fillServiceCatalog(const Gaudi::Parsers::Catalog &catalog)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
virtual std::vector< std::string > getClients() const
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
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
bool isSuccess() const
Test for a status code of SUCCESS.
virtual StatusCode setMyProperties(const std::string &client, IProperty *me)
Override default properties of the calling client.
virtual StatusCode addPropertyToCatalogue(const std::string &client, const Property &property)
Add a property into the JobOptions catalog.
int outputLevel() const
get the Service's output level
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.
virtual StatusCode removePropertyFromCatalogue(const std::string &client, const std::string &name)
Remove a property from the JobOptions catalog.
bool isFailure() const
Test for a status code of FAILURE.
SimpleProperty< std::string > StringProperty
#define DECLARE_COMPONENT(type)
std::vector< std::string > getClients() const
std::string m_dir_search_path
void dump(const std::string &file, const Gaudi::Parsers::Catalog &catalog) const
StatusCode getProperty(Property *p) const
Get the property by property.
This class is used for returning status codes from appropriate routines.
virtual StatusCode setProperty(const Property &p)=0
Set the property by property.
StatusCode getProperty(Property *p) const
get the property
virtual const std::string & name() const
Retrieve name of the service.
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
virtual StatusCode finalize()
Service finalization method.
Property base class allowing Property* collections to be "homogeneous".
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Templated class to add the standard messaging functionalities.
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
PropertyMgr m_pmgr
dump the content of Properties catalog to the predefined file
std::vector< const Property * > PropertiesT
std::vector< const Property * > PropertiesT
This is a number of static methods for bootstrapping the Gaudi framework.
virtual StatusCode readOptions(const std::string &file, const std::string &path="")
look for file 'file' into search path 'path' and read it to update existing JobOptionsCatalogue ...
The IProperty is the basic interface for all components which have properties that can be set or get...
std::string m_source_path
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
virtual const std::vector< Property * > & getProperties() const
Get list of properties.