From a1b07dd43d28ea75825def8dcd144b71bd49594a Mon Sep 17 00:00:00 2001 From: Martin Killenberg <martin.killenberg@desy.de> Date: Wed, 11 Oct 2017 12:29:41 +0200 Subject: [PATCH] renamed the intermediate function 'new_create' back to create, which had been removed after it was obsolete --- include/DoocsPVFactory.h | 3 +-- src/CSAdapterEqFct.cc | 2 +- src/DoocsPVFactory.cc | 2 +- tests/src/testDoocsPVFactory.cpp | 6 +++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/DoocsPVFactory.h b/include/DoocsPVFactory.h index b7be672..4b7828a 100644 --- a/include/DoocsPVFactory.h +++ b/include/DoocsPVFactory.h @@ -24,8 +24,7 @@ namespace ChimeraTK { */ DoocsPVFactory(EqFct * const eqFct, DoocsUpdater & updater, boost::shared_ptr<ControlSystemPVManager> const & csPVManager); - /// @todo FIXME: This is for brainstorming and quick protoryping. Did not want to call it create. - boost::shared_ptr<D_fct> new_create( std::shared_ptr<PropertyDescription> const & propertyDescription ); + boost::shared_ptr<D_fct> create( std::shared_ptr<PropertyDescription> const & propertyDescription ); protected: EqFct * _eqFct; //< The EqFct which is holding the factory. Needed in the constructor of the doocs properties. diff --git a/src/CSAdapterEqFct.cc b/src/CSAdapterEqFct.cc index 0b360f1..b451007 100644 --- a/src/CSAdapterEqFct.cc +++ b/src/CSAdapterEqFct.cc @@ -47,7 +47,7 @@ namespace ChimeraTK{ doocsProperties_.reserve( mappingForThisLocation.size() ); for (auto & pvNameAndPropertyDescrition : mappingForThisLocation){ - doocsProperties_.push_back( factory.new_create( pvNameAndPropertyDescrition.second ) ); + doocsProperties_.push_back( factory.create( pvNameAndPropertyDescrition.second ) ); } } diff --git a/src/DoocsPVFactory.cc b/src/DoocsPVFactory.cc index e9e40f5..2317a99 100644 --- a/src/DoocsPVFactory.cc +++ b/src/DoocsPVFactory.cc @@ -144,7 +144,7 @@ namespace ChimeraTK { } } - boost::shared_ptr<D_fct> DoocsPVFactory::new_create( std::shared_ptr<PropertyDescription> const & propertyDescription ){ + boost::shared_ptr<D_fct> DoocsPVFactory::create( std::shared_ptr<PropertyDescription> const & propertyDescription ){ auto & requestedType = propertyDescription->type(); if (requestedType == typeid(AutoPropertyDescription)){ return autoCreate(propertyDescription); diff --git a/tests/src/testDoocsPVFactory.cpp b/tests/src/testDoocsPVFactory.cpp index 96e9acd..238a10d 100644 --- a/tests/src/testDoocsPVFactory.cpp +++ b/tests/src/testDoocsPVFactory.cpp @@ -37,7 +37,7 @@ static void testCreateProcessScalar(std::shared_ptr<PropertyDescription> const & DoocsPVFactory & factory, std::string const & expectedPropertyName){ // have the variable created and check that it is the right type - boost::shared_ptr<D_fct> doocsVariableAsDFct = factory.new_create( propertyDescription ); + boost::shared_ptr<D_fct> doocsVariableAsDFct = factory.create( propertyDescription ); // get the raw pointer and dynamic cast it to the expected type DoocsProcessScalar<DOOCS_PRIMITIVE_T, DOOCS_T> * doocsScalarType = dynamic_cast< DoocsProcessScalar<DOOCS_PRIMITIVE_T, DOOCS_T> * > (doocsVariableAsDFct.get()); @@ -145,7 +145,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testCreateSpectrum, T, simple_test_types ){ // have the variable created and check that it is the right type for (auto const & description : propertyDescriptions){ - boost::shared_ptr<D_fct> doocsVariableAsDFct = factory.new_create(description); + boost::shared_ptr<D_fct> doocsVariableAsDFct = factory.create(description); // get the raw pointer and dynamic cast it to the expected type DoocsSpectrum * doocsSpectrum = @@ -177,7 +177,7 @@ BOOST_AUTO_TEST_CASE( testErrorHandling ){ // Unfortunately BOOST_CHECK cannot deal with multiple template parameters, // so we have to trick it auto description = std::make_shared<AutoPropertyDescription>("I/toDeviceInt", "I", "toDeviceInt"); - try{ factory.new_create( description ); + try{ factory.create( description ); // In a working unit test this line should not be hit, so er exclude it // from the coverage report. BOOST_ERROR( "createDoocsScalar did not throw as expected");//LCOV_EXCL_LINE -- GitLab