Skip to content
Snippets Groups Projects
Commit d1a276e5 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

allow specific algo name in method registrator

parent 54b8d3ff
No related branches found
No related tags found
No related merge requests found
...@@ -290,7 +290,7 @@ public: ...@@ -290,7 +290,7 @@ public:
   
namespace { namespace {
   
auto fooBar = registration::MethodRegister < int, Foo, int > ( & Foo::bar, "bar" ); auto fooBar = registration::MethodRegister < Foo, int, Foo, int > ( & Foo::bar, "bar" );
   
} /* namespace */ } /* namespace */
   
......
...@@ -58,14 +58,14 @@ public: ...@@ -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 { class MethodRegister : public AlgoRegister {
public: public:
template < class ... ParamNames > template < class ... ParamNames >
MethodRegister ( ReturnType ( ObjectType::* callback ) ( ParameterTypes ... ), std::string methodName, ParamNames ... paramNames ) { MethodRegister ( ReturnType ( ObjectType::* callback ) ( ParameterTypes ... ), std::string methodName, ParamNames ... paramNames ) {
std::array < std::string, sizeof ... ( ParameterTypes ) > parameterNames = generateNames < sizeof ... ( ParameterTypes ) > ( 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 ) );
} }
   
}; };
......
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