No-copy read object property from mex c++

조회 수: 2 (최근 30일)
Rasmus Damgaard Nielsen
Rasmus Damgaard Nielsen 2019년 5월 6일
댓글: Rasmus Damgaard Nielsen 2019년 5월 7일
How do i read properties of object arrays through the mex api? Right now i am using getProperty, which is an awfull function. Despite the name, it copies the object, reads the property, and then throw the object away. Then i ask for the next property of the object, the object is copied again and so-on. The c++ mex api was made for high performance supporting code, so of cause there should be some way of doing no-copy reads. Struct support this, and the old API support this, so how to do it in the new API?

답변 (1개)

James Tursa
James Tursa 2019년 5월 7일
편집: James Tursa 2019년 5월 7일
There is no official API method to do this with the C API. You have to resort to unofficial hacks. E.g., see this FEX submission for mxGetProperty and mxSetProperty replacements:
But I don't know if these will even work with the new C++ API.
  댓글 수: 1
Rasmus Damgaard Nielsen
Rasmus Damgaard Nielsen 2019년 5월 7일
Well... Do you know any way to combine functions from the two API's? MATLAB is quite explicit about the mutual exclusivity...

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler SDK에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by