mathworks / libmexclass

libmexclass is a MATLAB framework which enables users to implement the functionality of MATLAB classes in terms of equivalent C++ classes using MEX.
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Enable using C++ namespaces and fully specified MATLAB class name for the Proxy #20

Closed sreeharihegden closed 1 year ago

sreeharihegden commented 1 year ago

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.