code generation of MEX marshalling functions
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, (my first one)
I have a MEX function made of C/C++/Fortran legacy code, and I want to mexCallMATLAB() from it a MATLAB function.
So I have to write (a lot of) marshalling code between C/C++ data structs and mxArray data.
There is a straight naming scheme between C/C++ struct fields and MATLAB struct()'s fields. E.g :
----- C/C++ types/datas :
struct rep { float x, y; };
struct sxx { struct rep rep; int n; } sxx;
struct syy { struct rep rep; int m; } syy;
...
mxArray *foo = <marshalling code to/from sxx and syy>
mexCallMATLAB(..., 'fn');
---- versus MATLAB datas :
sxx.rep.x = single(0);
sxx.rep.y = single(0);
sxx.n = int32(0);
syy.rep.x = single(0);
syy.rep.y = single(0);
syy.m = int32(0);
...
function fn (sxx, syy) ...
For some modules, the C/C++ types are made of codegen'd source code, because in some configuration the MATLAB function is codegen'ed to C/C++ and the MEX Function is a native executable.
Is it possible to codegen the marshalling code ? I would like it to use only mex.h API, not EMLRT.
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Simulink Coder in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!