rymut/mexcppclass

版本 1.0.0.0 (71.0 KB) 作者: Boguslaw Rymut
MEX function for wrapping, managing and using C++ resources within MATLAB.
23.0 次下载
更新时间 2017/8/10

mexcppclass
MEX function and a library for wrapping, managing and using C++ resources objects, function and classes within MATLAB.
Usage

Compile cppmexclass mex function.
Create resource wrapper and export create/destory functions.
Wrapper and functions can reside inside mexcppclass mex function or can
reside inside a shared library:
wrapper for C++ resource which implements mexcppclass::ModuleInterface,
write and export functions for creating wrapper instance
void Destroy<ClassName>ModuleInterface(mexcppclass::ModuleInterface *obj)
and destroying wrapper instance
void Destroy<ClassName>ModuleInterface(mexcppclass::ModuleInterface *obj).
Put created .(dll|so) library and mexcppclass mex
in the same directory. Object can be accessed by Matlab by use of commands:
% Create wrapper handle
handle = mexcppclass('create', 'ClassName=LibraryName.so')
% Create object constructor
mexcppclass('call', handle, 'create');
% Call simple methods
mexcppclass('call', handle, 'setvalue', 10);
v = mexcppclass('call', handle, 'getvalue');
% destroy object and wrapper
mexcppclass('destroy', handle);
Example

See test/unit/testmodule.hpp and test/unit/testmodule.cpp for as a reference
point.

引用格式

Boguslaw Rymut (2026). rymut/mexcppclass (https://github.com/rymut/mexcppclass), GitHub. 检索时间: .

MATLAB 版本兼容性
创建方式 R2017a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Call C++ from MATLAB 的更多信息

无法下载基于 GitHub 默认分支的版本

版本 已发布 发行说明
1.0.0.0

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库