diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/HLTJobOptionsSvc.h b/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/HLTJobOptionsSvc.h index a8064c1b551d2ff427f4a91cc271e4f0f2e4e62c..47e3d4580d41491a87734e453a655da6975b1010 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/HLTJobOptionsSvc.h +++ b/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/HLTJobOptionsSvc.h @@ -70,6 +70,12 @@ namespace TrigConf { virtual const std::vector<Property*> & getProperties() const { return Service::getProperties(); } + /// Get a property for a client + virtual const Property* + getClientProperty( const std::string& client, + const std::string& name ) const; + + /// implementation of IJobOptionsSvc::getClients virtual std::vector<std::string> getClients() const; diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/JobOptionsCatalogue.h b/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/JobOptionsCatalogue.h index 594e342649d114e64c7ec11ccaf2899b56e0f0cd..8c9eb9bf4869e6282f8d672b206c6b658f58b1ae 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/JobOptionsCatalogue.h +++ b/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/JobOptionsCatalogue.h @@ -10,12 +10,11 @@ #include <vector> #include "GaudiKernel/StatusCode.h" +#include "GaudiKernel/Property.h" #include "TrigConfigSvc/JobOptionsList.h" class MsgStream; -class Property; - namespace TrigConf { /** @brief Collection of JobOptionsList 's, one for each algorithm*/ @@ -34,7 +33,7 @@ namespace TrigConf { * * @param[in] myOpt property to be added */ - virtual void addOption( const std::string myAlg, const Property* const& myOpt ); + virtual void addOption( const std::string& myAlg, const Property* const& myOpt ); /**@brief retrieve all properties of an algorithm * @@ -84,7 +83,7 @@ namespace TrigConf { * * @returns StatusCode about the success of the operation (success if it found the algorithm) */ - StatusCode findAlgorithm( const std::string myAlg, JobOptionsList*& myList ) const; + StatusCode findAlgorithm( const std::string& myAlg, JobOptionsList*& myList ) const; // data members std::vector<JobOptionsList*> m_algorithmoptions; ///< vector of JobOptionList 's, one for each algorithm diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/JobOptionsList.h b/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/JobOptionsList.h index 9176add850daa4ae4ea762e19818da002a7b11f7..2b22fabf9a23bb968dce59fd7cdf0885af0599ad 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/JobOptionsList.h +++ b/Trigger/TrigConfiguration/TrigConfigSvc/TrigConfigSvc/JobOptionsList.h @@ -11,9 +11,7 @@ #include <string> #include <vector> -//#include "GaudiKernel/Property.h" - -class Property; +#include "GaudiKernel/Property.h" namespace TrigConf { @@ -27,7 +25,7 @@ namespace TrigConf { * * @param myOpt first property */ - JobOptionsList( const std::string myAlg, const Property* const& myOpt ); + JobOptionsList( const std::string& myAlg, const Property* const& myOpt ); /**@brief destructor * @@ -47,7 +45,7 @@ namespace TrigConf { * * @returns name of algorithm */ - virtual std::string algorithmName() const; + virtual const std::string& algorithmName() const; /**@brief accessor to the vector of properties * diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTJobOptionsSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTJobOptionsSvc.cxx index f4615656a6c51187f8f1a1095ddbe09c7157d65b..3728f6511dc00603d80810fdaa77a9b80dcbe8b9 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTJobOptionsSvc.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTJobOptionsSvc.cxx @@ -502,6 +502,24 @@ TrigConf::HLTJobOptionsSvc::getProperties( const std::string& client) const } return 0; } + +//---------------------------------------------------------------------------- +const Property* +TrigConf::HLTJobOptionsSvc::getClientProperty( const std::string& client, + const std::string& name ) const +//---------------------------------------------------------------------------- +{ + auto props = getProperties(client); + for (auto p: *props) { + if (p->name() == name) { + return p; + } + } + + return nullptr; + +} + //---------------------------------------------------------------------------- std::vector<std::string> TrigConf::HLTJobOptionsSvc::getClients() const diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/JobOptionsCatalogue.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/JobOptionsCatalogue.cxx index 01384e48546552023969aaf3e337dafff825552f..b0b0d339cfe57dabb5180ec841e3fc5a5adb9e56 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/JobOptionsCatalogue.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/JobOptionsCatalogue.cxx @@ -25,7 +25,7 @@ TrigConf::JobOptionsCatalogue::~JobOptionsCatalogue() { //---------------------------------------------------------------------------- StatusCode -TrigConf::JobOptionsCatalogue::findAlgorithm( const std::string myAlg, +TrigConf::JobOptionsCatalogue::findAlgorithm( const std::string& myAlg, JobOptionsList*& myList ) const { std::vector<JobOptionsList*>::const_iterator iter; for( iter = m_algorithmoptions.begin(); @@ -42,7 +42,7 @@ TrigConf::JobOptionsCatalogue::findAlgorithm( const std::string myAlg, //---------------------------------------------------------------------------- void -TrigConf::JobOptionsCatalogue::addOption( const std::string myAlg, +TrigConf::JobOptionsCatalogue::addOption( const std::string& myAlg, const Property* const& myOpt ) { JobOptionsList* myList; StatusCode sc = this->findAlgorithm( myAlg, myList ); diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/JobOptionsList.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/JobOptionsList.cxx index c912eb9648234d08a503a10ab9733bc8f0eef94a..81b3f60bb8be2f0e3c68313601d63b2164347e8e 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/JobOptionsList.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/JobOptionsList.cxx @@ -17,12 +17,12 @@ TrigConf::JobOptionsList::~JobOptionsList() { } } -TrigConf::JobOptionsList::JobOptionsList( const std::string myAlg, const Property* const& myOpt ){ +TrigConf::JobOptionsList::JobOptionsList( const std::string& myAlg, const Property* const& myOpt ){ m_algorithmName = myAlg; this->addOption( myOpt ); } -std::string +const std::string& TrigConf::JobOptionsList::algorithmName() const { return m_algorithmName; }