Skip to content
Snippets Groups Projects
Commit a1b07dd4 authored by Martin Killenberg's avatar Martin Killenberg
Browse files

renamed the intermediate function 'new_create' back to create, which had been...

renamed the intermediate function 'new_create' back to create, which had been removed after it was obsolete
parent 7ed99cc0
No related branches found
No related tags found
No related merge requests found
...@@ -24,8 +24,7 @@ namespace ChimeraTK { ...@@ -24,8 +24,7 @@ namespace ChimeraTK {
*/ */
DoocsPVFactory(EqFct * const eqFct, DoocsUpdater & updater, boost::shared_ptr<ControlSystemPVManager> const & csPVManager); 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> create( std::shared_ptr<PropertyDescription> const & propertyDescription );
boost::shared_ptr<D_fct> new_create( std::shared_ptr<PropertyDescription> const & propertyDescription );
protected: protected:
EqFct * _eqFct; //< The EqFct which is holding the factory. Needed in the constructor of the doocs properties. EqFct * _eqFct; //< The EqFct which is holding the factory. Needed in the constructor of the doocs properties.
......
...@@ -47,7 +47,7 @@ namespace ChimeraTK{ ...@@ -47,7 +47,7 @@ namespace ChimeraTK{
doocsProperties_.reserve( mappingForThisLocation.size() ); doocsProperties_.reserve( mappingForThisLocation.size() );
for (auto & pvNameAndPropertyDescrition : mappingForThisLocation){ for (auto & pvNameAndPropertyDescrition : mappingForThisLocation){
doocsProperties_.push_back( factory.new_create( pvNameAndPropertyDescrition.second ) ); doocsProperties_.push_back( factory.create( pvNameAndPropertyDescrition.second ) );
} }
} }
......
...@@ -144,7 +144,7 @@ namespace ChimeraTK { ...@@ -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(); auto & requestedType = propertyDescription->type();
if (requestedType == typeid(AutoPropertyDescription)){ if (requestedType == typeid(AutoPropertyDescription)){
return autoCreate(propertyDescription); return autoCreate(propertyDescription);
......
...@@ -37,7 +37,7 @@ static void testCreateProcessScalar(std::shared_ptr<PropertyDescription> const & ...@@ -37,7 +37,7 @@ static void testCreateProcessScalar(std::shared_ptr<PropertyDescription> const &
DoocsPVFactory & factory, std::string const & expectedPropertyName){ DoocsPVFactory & factory, std::string const & expectedPropertyName){
// have the variable created and check that it is the right type // 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 // get the raw pointer and dynamic cast it to the expected type
DoocsProcessScalar<DOOCS_PRIMITIVE_T, DOOCS_T> * doocsScalarType = DoocsProcessScalar<DOOCS_PRIMITIVE_T, DOOCS_T> * doocsScalarType =
dynamic_cast< DoocsProcessScalar<DOOCS_PRIMITIVE_T, DOOCS_T> * > (doocsVariableAsDFct.get()); dynamic_cast< DoocsProcessScalar<DOOCS_PRIMITIVE_T, DOOCS_T> * > (doocsVariableAsDFct.get());
...@@ -145,7 +145,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testCreateSpectrum, T, simple_test_types ){ ...@@ -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 // have the variable created and check that it is the right type
for (auto const & description : propertyDescriptions){ 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 // get the raw pointer and dynamic cast it to the expected type
DoocsSpectrum * doocsSpectrum = DoocsSpectrum * doocsSpectrum =
...@@ -177,7 +177,7 @@ BOOST_AUTO_TEST_CASE( testErrorHandling ){ ...@@ -177,7 +177,7 @@ BOOST_AUTO_TEST_CASE( testErrorHandling ){
// Unfortunately BOOST_CHECK cannot deal with multiple template parameters, // Unfortunately BOOST_CHECK cannot deal with multiple template parameters,
// so we have to trick it // so we have to trick it
auto description = std::make_shared<AutoPropertyDescription>("I/toDeviceInt", "I", "toDeviceInt"); 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 // In a working unit test this line should not be hit, so er exclude it
// from the coverage report. // from the coverage report.
BOOST_ERROR( "createDoocsScalar did not throw as expected");//LCOV_EXCL_LINE BOOST_ERROR( "createDoocsScalar did not throw as expected");//LCOV_EXCL_LINE
......
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