From d1a276e5ba7b1cfa15036ab0abf5b6dbca9e19ac Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Tue, 21 Nov 2017 17:03:12 +0100 Subject: [PATCH] allow specific algo name in method registrator --- alib2cli/test-src/cli/CliTest.cpp | 2 +- alib2common/src/registration/AlgoRegistration.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alib2cli/test-src/cli/CliTest.cpp b/alib2cli/test-src/cli/CliTest.cpp index e236bb2e05..78c4248b2a 100644 --- a/alib2cli/test-src/cli/CliTest.cpp +++ b/alib2cli/test-src/cli/CliTest.cpp @@ -290,7 +290,7 @@ public: namespace { -auto fooBar = registration::MethodRegister < int, Foo, int > ( & Foo::bar, "bar" ); +auto fooBar = registration::MethodRegister < Foo, int, Foo, int > ( & Foo::bar, "bar" ); } /* namespace */ diff --git a/alib2common/src/registration/AlgoRegistration.hpp b/alib2common/src/registration/AlgoRegistration.hpp index 5d210c27df..8751a68be5 100644 --- a/alib2common/src/registration/AlgoRegistration.hpp +++ b/alib2common/src/registration/AlgoRegistration.hpp @@ -58,14 +58,14 @@ public: }; -template < class ReturnType, class ObjectType, class ... ParameterTypes > +template < class Algorithm, class ReturnType, class ObjectType, class ... ParameterTypes > class MethodRegister : public AlgoRegister { public: template < class ... ParamNames > MethodRegister ( ReturnType ( ObjectType::* callback ) ( ParameterTypes ... ), std::string methodName, ParamNames ... paramNames ) { std::array < std::string, sizeof ... ( ParameterTypes ) > parameterNames = generateNames < sizeof ... ( ParameterTypes ) > ( paramNames ... ); - abstraction::AlgorithmRegistry::registerMethod < ObjectType > ( callback, methodName, std::move ( parameterNames ) ); + abstraction::AlgorithmRegistry::registerMethod < Algorithm > ( callback, methodName, std::move ( parameterNames ) ); } }; -- GitLab