mwArray
API を使用した C++ アプリケーションへのデプロイ
mwArray
関数を C++ アプリケーションに統合するこの方法では、デプロイする MATLAB 関数から C++ 共有ライブラリおよびヘッダー ファイルを作成します。C++ アプリケーションとデプロイされた MATLAB 関数とのインターフェイスとして C++ 用のレガシ MATLAB Compiler SDK™ API を使用します。mwArray
API を使用して、C++ アプリケーションとデプロイされた MATLAB 関数間のデータ交換を処理します。デプロイされた MATLAB 関数を C++ コード内でメンバー関数として使用可能にするには、プリプロセッサ命令を使用して C++ アプリケーションに生成済みのヘッダー ファイルを組み込む必要があります。デプロイされた MATLAB 関数で使用される MATLAB Runtime インスタンスのライフサイクルを明示的に管理する必要があります。Runtime インスタンスは、C++ アプリケーションでインプロセスでのみ実行できます。デプロイされた MATLAB 関数は同期的にのみ実行できます。
C++ mwArray
API は C++03 の機能のみをサポートします。mwArray
API を使用する C++ 共有ライブラリのインターフェイスは、C スタイルの関数を使用して MATLAB Runtime の初期化、パッケージ化された MATLAB 関数の MATLAB Runtime への読み込み、および C++ ドライバー コードと MATLAB Runtime の間で渡されるデータの管理を行います。これらの関数は C/C++ API で説明されています。C++ mwArray
API の下にリストされている関数は mwArray
API に固有であり、他の API 用に作成された共有ライブラリには使用できません。
関数
compiler.build.cppSharedLibrary | C++ 共有ライブラリの作成 |
compiler.build.CppSharedLibraryOptions | C++ 共有ライブラリのビルド オプション |
mbuild | MATLAB の生成された共有ライブラリに対してソース ファイルをコンパイルおよびリンクする |
C/C++ API
mclmcrInitialize | MATLAB Runtime プロキシ ライブラリの初期化 |
mclInitializeApplication | 現在のプロセスで作成されたすべての MATLAB Runtime インスタンスによって共有されるアプリケーション状態の設定 |
mclTerminateApplication | MATLAB Runtime 内部アプリケーション状態を閉じる |
<library>Initialize[WithHandlers] | Initialize MATLAB Runtime instance associated with
|
<library>Terminate | に関連付けられている MATLAB Runtime インスタンスによって割り当てられているリソースをすべて解放する |
mclRunMain | Mechanism for creating identical wrapper code across all platforms |
mclIsMCRInitialized | Determine if MATLAB Runtime has been properly initialized |
mclWaitForFiguresToDie | Enable deployed applications to process graphics events so that figure windows remain displayed |
mclGetLastErrorMessage | Last error message from unsuccessful library initialization or MATLAB function call |
mclGetLogFileName | Retrieve name of log file used by MATLAB Runtime |
mclIsJVMEnabled | Determine if MATLAB Runtime was started with instance of Java Virtual Machine (JVM) |
mclIsNoDisplaySet | -nodisplay モードが有効かどうかを判定 |
C++ mwArray API
mwArray | Class used to pass input/output arguments to C++ functions generated by MATLAB Compiler SDK |
mwException | Exception type used by the mwArray API
and the C++ interface functions |
mwString | String class used by the mwArray API
to pass string data as output from certain methods |
トピック
要件
- MATLAB Compiler SDK C++ Target Requirements
Refer to the software requirements for using MATLAB Compiler SDK to deploy MATLAB functions to C++ applications. - C++ Development Environment
Set up development environment to develop C++ applications that integrate deployed MATLAB functions.
C++ mwArray
API 共有ライブラリの作成
- C++ mwArray API 共有ライブラリの生成と C++ アプリケーションのビルド
MATLAB コードから C++ mwArray API 共有ライブラリを作成し、サンプル C++ ドライバー コードを使って実装する。 - Create C/C++ Shared Libraries from Command Line
Use the command-line compiler to create C/C++ shared libraries.
C++ 共有ライブラリと C++ アプリケーションの統合
- Call MATLAB Compiler SDK API Functions from C/C++
Use MATLAB Compiler SDK shared library functions in C and C++ code. - Integrate C++ Shared Libraries with mwArray
Write C++ code to reference shared libraries that use themwArray
API. - mbuild オプション ファイルの構成
mbuild
オプション ファイルを構成する方法。 - Use Multiple Shared Libraries in Single Application
Use multiple generated shared libraries in a single C/C++ application.
Mac OS X
- Write Applications for macOS
Write deployable C++ applications specifically for macOS.
保守
- メモリの管理およびクリーンアップ
メモリ管理の推奨について説明する。 - Understand the mclmcrrt Proxy Layer
All application and software components generated by MATLAB Compiler™ and MATLAB Compiler SDK need to link against only one MATLAB library,mclmcrrt
. This library provides a proxy API for all the public functions in MATLAB libraries used for matrix operations, MAT-file access, utility and memory management, and application MATLAB Runtime. Themclmcrrt
library lies between deployed MATLAB code and these other version-dependent libraries, providing the following functionality: - Compilation Failures
List of possible failures during compilation. - Testing Failures
List of possible failures during testing. - Deployment Failures
List of possible failures during deployment.