Currently, the registerProxy macro in the Factory.h assumes that the classname from C++ and MATLAB is the same. We should also consider the scenario where this can be different.
One way to resolve this would be by updating the macro to also accept an optional second argument so that the first argument is the MATLAB packaged class name and the second argument is the C++ class name. Something like this:
#define registerProxy(matlabClassName, proxyClassName) if (class_name.compare(#matlabClassName) == 0) return std::make_shared<proxyClassName>(constructor_arguments)
With this, we might also no longer need the extractAfter(classNameWithPackage... call in MATLAB code for Proxy.m.
Currently, the
registerProxy
macro in theFactory.h
assumes that theclassname
from C++ and MATLAB is the same. We should also consider the scenario where this can be different.One way to resolve this would be by updating the macro to also accept an optional second argument so that the first argument is the MATLAB packaged class name and the second argument is the C++ class name. Something like this:
#define registerProxy(matlabClassName, proxyClassName) if (class_name.compare(#matlabClassName) == 0) return std::make_shared<proxyClassName>(constructor_arguments)
With this, we might also no longer need the
extractAfter(classNameWithPackage...
call in MATLAB code forProxy.m
.