Znav |
---|
next | Client-Side Slice-to-MATLAB Mapping |
---|
prev | MATLAB Mapping |
---|
|
Every Ice-based application needs to initialize the Ice run time, and this initialization returns an Ice::Communicator
object.
...
You initialize the Ice run time by calling Ice.initialize
, for example:
Code Block |
---|
language | matlab |
---|
title | MATLAB |
---|
|
[communicator, remArgsremainingArgs] = Ice.initialize(args); |
Ice.initialize
accepts the an optional argument list that is passed to the program by the operating system. The function scans the argument list for any command-line options that are relevant to the Ice run time; any such options are removed from the argument list so, when Ice.initialize
returns, the only options and arguments remaining in remArgs
remainingArgs
are those that concern your application. If anything goes wrong during initialization, initialize
throws an exception.
Before leaving your program, you must call Communicator.destroy
. The destroy
method is responsible for finalizing the Ice run time. In particular, destroy
ensures that any outstanding threads started by the underlying Ice C++ run-time are joined with and reclaims a number of operating system resources, such as file descriptors and memory. Never allow your program to terminate without calling destroy
first.
The general shape of our Ice MATLAB application is therefore:
Code Block |
---|
language | rubymatlab |
---|
title | Ruby | MATLAB |
---|
|
communicatortry
[communicator, remArgs] = Ice.initialize(args);
% here we ...
catch ex
if ~isempty(communicator)
ignore the remaining args
cleanup = onCleanup(@() communicator.destroy();
end
end)); |
Info |
---|
You can safely call destroy multiple times on a communicator. destroy does not throw any exception. |
See Also
Znav |
---|
next | Client-Side Slice-to-MATLAB Mapping |
---|
prev | MATLAB Mapping |
---|
|