Commit 569f81cf authored by Charles Leggett's avatar Charles Leggett
Browse files

Migrate to Gaudi/Property.h

See merge request gaudi/Gaudi!1105
parents 76eeb0b9 c6fdef9a
......@@ -15,8 +15,8 @@
#include "fixture.h"
#include <Gaudi/Interfaces/IOptionsSvc.h>
#include <Gaudi/Property.h>
#include <GaudiKernel/ISvcLocator.h>
#include <GaudiKernel/Property.h>
BOOST_AUTO_TEST_CASE( PropertyBinding ) {
Fixture f;
......
......@@ -14,9 +14,9 @@
#include "fixture.h"
#include <Gaudi/Property.h>
#include <GaudiKernel/IJobOptionsSvc.h>
#include <GaudiKernel/ISvcLocator.h>
#include <GaudiKernel/Property.h>
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
BOOST_AUTO_TEST_CASE( BackwardCompatibility ) {
......
......@@ -15,9 +15,9 @@
#include "fixture.h"
#include <Gaudi/Interfaces/IOptionsSvc.h>
#include <Gaudi/Property.h>
#include <GaudiKernel/IJobOptionsSvc.h>
#include <GaudiKernel/ISvcLocator.h>
#include <GaudiKernel/Property.h>
#include <GaudiKernel/Service.h>
#include <algorithm>
#include <map>
......
......@@ -10,9 +10,9 @@
\***********************************************************************************/
#pragma once
#include "Gaudi/Property.h"
#include "GaudiKernel/IAlgResourcePool.h"
#include "GaudiKernel/ICondSvc.h"
#include "GaudiKernel/Property.h"
#include "GaudiKernel/Service.h"
#include "GaudiKernel/SmartIF.h"
......
......@@ -10,8 +10,8 @@
\***********************************************************************************/
#pragma once
#include <Gaudi/Property.h>
#include <GaudiKernel/EventContext.h>
#include <GaudiKernel/Property.h>
#include <GaudiKernel/StateMachine.h>
#include <GaudiKernel/StatusCode.h>
#include <any>
......
......@@ -30,6 +30,7 @@ See the comments in the code for the details.
#include <Gaudi/Application.h>
#include <Gaudi/Interfaces/IQueueingEventProcessor.h>
#include <Gaudi/Property.h>
#include <GaudiKernel/AppReturnCode.h>
#include <GaudiKernel/IAppMgrUI.h>
#include <GaudiKernel/IJobOptionsSvc.h>
......@@ -37,7 +38,6 @@ See the comments in the code for the details.
#include <GaudiKernel/IProperty.h>
#include <GaudiKernel/IStateful.h>
#include <GaudiKernel/ISvcLocator.h>
#include <GaudiKernel/Property.h>
#include <GaudiKernel/SmartIF.h>
#include <queue>
#include <thread>
......
......@@ -25,7 +25,7 @@
* Collection of utilities, which allows to use class boost::array
* as property for Gaudi-components
*
* @attention this file must be "included" before GaudiKernel/Property.h
* @attention this file must be "included" before Gaudi/Property.h
*
* @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
* @date 2009-09-16
......
......@@ -8,10 +8,9 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\***********************************************************************************/
#ifndef GAUDIKERNEL_DATAOBJECTHANDLEPROPERTY_H
#define GAUDIKERNEL_DATAOBJECTHANDLEPROPERTY_H 1
#pragma once
#include "GaudiKernel/Property.h"
#include "Gaudi/Property.h"
#include "GaudiKernel/StatusCode.h"
#include <iostream>
......@@ -36,8 +35,8 @@ public:
DataObjectHandleProperty& operator=( const DataObjectHandleBase& value );
DataObjectHandleProperty* clone() const override;
bool load( Property& destination ) const override;
bool assign( const Property& source ) override;
bool load( Gaudi::Details::PropertyBase& destination ) const override;
bool assign( const Gaudi::Details::PropertyBase& source ) override;
std::string toString() const override;
void toStream( std::ostream& out ) const override;
StatusCode fromString( const std::string& s ) override;
......@@ -48,7 +47,5 @@ private:
/** Pointer to the real property. Reference would be better,
* but Reflex does not support references yet
*/
DataObjectHandleBase* m_pValue;
DataObjectHandleBase* m_pValue = nullptr;
};
#endif
......@@ -23,7 +23,7 @@
* Collection of utilities, which allows to use class std::array
* as property for Gaudi-components
*
* @attention this file must be "included" before GaudiKernel/Property.h
* @attention this file must be "included" before Gaudi/Property.h
*
* @author Alexander Mazurov alexander.mazurov@cern.ch
* @date 2015-02-23
......
......@@ -10,6 +10,7 @@
\***********************************************************************************/
#include <Gaudi/Application.h>
#include <Gaudi/Interfaces/IOptionsSvc.h>
#include <Gaudi/Property.h>
#include <GaudiKernel/AppReturnCode.h>
#include <GaudiKernel/Bootstrap.h>
#include <GaudiKernel/IAppMgrUI.h>
......@@ -19,7 +20,6 @@
#include <GaudiKernel/INamedInterface.h>
#include <GaudiKernel/IProperty.h>
#include <GaudiKernel/ISvcLocator.h>
#include <GaudiKernel/Property.h>
#include <gsl/span>
#include <type_traits>
......
......@@ -76,11 +76,15 @@ DataObjectHandleProperty* DataObjectHandleProperty::clone() const { return new D
//---------------------------------------------------------------------------
bool DataObjectHandleProperty::load( Property& destination ) const { return destination.assign( *this ); }
bool DataObjectHandleProperty::load( Gaudi::Details::PropertyBase& destination ) const {
return destination.assign( *this );
}
//---------------------------------------------------------------------------
bool DataObjectHandleProperty::assign( const Property& source ) { return fromString( source.toString() ).isSuccess(); }
bool DataObjectHandleProperty::assign( const Gaudi::Details::PropertyBase& source ) {
return fromString( source.toString() ).isSuccess();
}
//---------------------------------------------------------------------------
......
......@@ -8,12 +8,12 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\***********************************************************************************/
#include "Gaudi/Property.h"
#include "GaudiKernel/IAlgManager.h"
#include "GaudiKernel/IAlgorithm.h"
#include "GaudiKernel/IMessageSvc.h"
#include "GaudiKernel/IProperty.h"
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/Property.h"
namespace {
/// Recursive function to print the algorithm name and its sub algorithms
......
......@@ -73,8 +73,7 @@ PropertyBase* PropertyMgr::declareRemoteProperty( const std::string& name, IProp
// ============================================================================
PropertyBase* PropertyMgr::declareProperty( const std::string& name, GaudiHandleBase& ref, const std::string& doc ) {
assertUniqueName( name );
m_todelete.emplace_back( new typename GaudiHandleBase::PropertyType( name, ref ) );
Property* p = m_todelete.back().get();
auto p = m_todelete.emplace_back( std::make_unique<typename GaudiHandleBase::PropertyType>( name, ref ) ).get();
//
p->setDocumentation( doc );
m_properties.push_back( p );
......@@ -85,8 +84,7 @@ PropertyBase* PropertyMgr::declareProperty( const std::string& name, GaudiHandle
PropertyBase* PropertyMgr::declareProperty( const std::string& name, GaudiHandleArrayBase& ref,
const std::string& doc ) {
assertUniqueName( name );
m_todelete.emplace_back( new typename GaudiHandleArrayBase::PropertyType( name, ref ) );
Property* p = m_todelete.back().get();
auto p = m_todelete.emplace_back( std::make_unique<typename GaudiHandleArrayBase::PropertyType>( name, ref ) ).get();
//
p->setDocumentation( doc );
m_properties.push_back( p );
......@@ -98,8 +96,7 @@ PropertyBase* PropertyMgr::declareProperty( const std::string& name, GaudiHandle
PropertyBase* PropertyMgr::declareProperty( const std::string& name, DataObjectHandleBase& ref,
const std::string& doc ) {
assertUniqueName( name );
m_todelete.emplace_back( new typename DataObjectHandleBase::PropertyType( name, ref ) );
Property* p = m_todelete.back().get();
auto p = m_todelete.emplace_back( std::make_unique<typename DataObjectHandleBase::PropertyType>( name, ref ) ).get();
//
p->setDocumentation( doc );
m_properties.push_back( p );
......
......@@ -60,7 +60,7 @@ Gaudi = gbl.Gaudi
_gaudi = None
# ---- Useful shortcuts for classes -------------------------------------------
gbl.gInterpreter.Declare('#include "GaudiKernel/Property.h"')
gbl.gInterpreter.Declare('#include "Gaudi/Property.h"')
Helper = gbl.GaudiPython.Helper
StringProperty = gbl.Gaudi.Property('std::string')
StringPropertyRef = gbl.Gaudi.Property('std::string&')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment