Skip to content
Snippets Groups Projects
Commit 804e6efd authored by Charles Leggett's avatar Charles Leggett Committed by Graeme Stewart
Browse files

updates for Property modernization (TrigConfigSvc-01-01-75)

	* HLTJobOptionsSvc: added getClientProperty() for Gaudi v28 compat
	* don't forward declare Property
	* tag TrigConfigSvc-01-01-75

M       TrigConfigSvc/HLTJobOptionsSvc.h
M       TrigConfigSvc/JobOptionsCatalogue.h
M       TrigConfigSvc/JobOptionsList.h
M       src/HLTJobOptionsSvc.cxx

2016-12-16 Stewart Martin-Haugh <smh@cern.ch>
	* Pass strings by const reference (ATR-15683)
	* TrigConfigSvc-01-01-74


Former-commit-id: 200b7959
parent 4beffdcd
No related branches found
No related tags found
No related merge requests found
...@@ -70,6 +70,12 @@ namespace TrigConf { ...@@ -70,6 +70,12 @@ namespace TrigConf {
virtual const std::vector<Property*> & getProperties() const { return Service::getProperties(); } 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 /// implementation of IJobOptionsSvc::getClients
virtual std::vector<std::string> getClients() const; virtual std::vector<std::string> getClients() const;
......
...@@ -10,12 +10,11 @@ ...@@ -10,12 +10,11 @@
#include <vector> #include <vector>
#include "GaudiKernel/StatusCode.h" #include "GaudiKernel/StatusCode.h"
#include "GaudiKernel/Property.h"
#include "TrigConfigSvc/JobOptionsList.h" #include "TrigConfigSvc/JobOptionsList.h"
class MsgStream; class MsgStream;
class Property;
namespace TrigConf { namespace TrigConf {
/** @brief Collection of JobOptionsList 's, one for each algorithm*/ /** @brief Collection of JobOptionsList 's, one for each algorithm*/
...@@ -34,7 +33,7 @@ namespace TrigConf { ...@@ -34,7 +33,7 @@ namespace TrigConf {
* *
* @param[in] myOpt property to be added * @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 /**@brief retrieve all properties of an algorithm
* *
...@@ -84,7 +83,7 @@ namespace TrigConf { ...@@ -84,7 +83,7 @@ namespace TrigConf {
* *
* @returns StatusCode about the success of the operation (success if it found the algorithm) * @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 // data members
std::vector<JobOptionsList*> m_algorithmoptions; ///< vector of JobOptionList 's, one for each algorithm std::vector<JobOptionsList*> m_algorithmoptions; ///< vector of JobOptionList 's, one for each algorithm
......
...@@ -11,9 +11,7 @@ ...@@ -11,9 +11,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
//#include "GaudiKernel/Property.h" #include "GaudiKernel/Property.h"
class Property;
namespace TrigConf { namespace TrigConf {
...@@ -27,7 +25,7 @@ namespace TrigConf { ...@@ -27,7 +25,7 @@ namespace TrigConf {
* *
* @param myOpt first property * @param myOpt first property
*/ */
JobOptionsList( const std::string myAlg, const Property* const& myOpt ); JobOptionsList( const std::string& myAlg, const Property* const& myOpt );
/**@brief destructor /**@brief destructor
* *
...@@ -47,7 +45,7 @@ namespace TrigConf { ...@@ -47,7 +45,7 @@ namespace TrigConf {
* *
* @returns name of algorithm * @returns name of algorithm
*/ */
virtual std::string algorithmName() const; virtual const std::string& algorithmName() const;
/**@brief accessor to the vector of properties /**@brief accessor to the vector of properties
* *
......
...@@ -502,6 +502,24 @@ TrigConf::HLTJobOptionsSvc::getProperties( const std::string& client) const ...@@ -502,6 +502,24 @@ TrigConf::HLTJobOptionsSvc::getProperties( const std::string& client) const
} }
return 0; 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> std::vector<std::string>
TrigConf::HLTJobOptionsSvc::getClients() const TrigConf::HLTJobOptionsSvc::getClients() const
......
...@@ -25,7 +25,7 @@ TrigConf::JobOptionsCatalogue::~JobOptionsCatalogue() { ...@@ -25,7 +25,7 @@ TrigConf::JobOptionsCatalogue::~JobOptionsCatalogue() {
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
StatusCode StatusCode
TrigConf::JobOptionsCatalogue::findAlgorithm( const std::string myAlg, TrigConf::JobOptionsCatalogue::findAlgorithm( const std::string& myAlg,
JobOptionsList*& myList ) const { JobOptionsList*& myList ) const {
std::vector<JobOptionsList*>::const_iterator iter; std::vector<JobOptionsList*>::const_iterator iter;
for( iter = m_algorithmoptions.begin(); for( iter = m_algorithmoptions.begin();
...@@ -42,7 +42,7 @@ TrigConf::JobOptionsCatalogue::findAlgorithm( const std::string myAlg, ...@@ -42,7 +42,7 @@ TrigConf::JobOptionsCatalogue::findAlgorithm( const std::string myAlg,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
TrigConf::JobOptionsCatalogue::addOption( const std::string myAlg, TrigConf::JobOptionsCatalogue::addOption( const std::string& myAlg,
const Property* const& myOpt ) { const Property* const& myOpt ) {
JobOptionsList* myList; JobOptionsList* myList;
StatusCode sc = this->findAlgorithm( myAlg, myList ); StatusCode sc = this->findAlgorithm( myAlg, myList );
......
...@@ -17,12 +17,12 @@ TrigConf::JobOptionsList::~JobOptionsList() { ...@@ -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; m_algorithmName = myAlg;
this->addOption( myOpt ); this->addOption( myOpt );
} }
std::string const std::string&
TrigConf::JobOptionsList::algorithmName() const { TrigConf::JobOptionsList::algorithmName() const {
return m_algorithmName; return m_algorithmName;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment