[Matlab] Add missing 'clear' functions

Without these functions, it was impossible to use these classes
without leaking memory. Even with these functions, the memory is
released only when these functions are explicitly called, as
old-style Matlab classes have no notion of a destructor.

Fixes #252.
This commit is contained in:
Ray Speth 2015-04-11 10:54:52 -04:00
parent 2161060743
commit 258fb8ed57
7 changed files with 57 additions and 0 deletions

View file

@ -0,0 +1,9 @@
function clear(d)
% CLEAR Delete the C++ Domain1D object.
% clear(d)
% :param d:
% Instance of class :mat:func:`Domain1D` (or another
% object that derives from Domain1D)
%
domain_methods(d.dom_id, 10);

View file

@ -0,0 +1,8 @@
function clear(s)
% CLEAR Delete the C++ Sim1D object.
% clear(s)
% :param s:
% Instance of class :mat:func:`Stack`
%
stack_methods(s.stack_id, 110);

View file

@ -0,0 +1,8 @@
function clear(f)
% CLEAR Delete the C++ Func1 object.
% clear(f)
% :param f:
% Instance of class :mat:func:`Func`
%
funcmethods(f.index, 1);

View file

@ -0,0 +1,8 @@
function clear(m)
% CLEAR Delete the C++ MultiPhase object.
% clear(m)
% :param m:
% Instance of class :mat:func:`Mixture`
%
mixturemethods(1, m.mixindex);

View file

@ -0,0 +1,8 @@
function clear(n)
% CLEAR Delete the C++ ReactorNet object.
% clear(n)
% :param n:
% Instance of class :mat:func:`ReactorNet`
%
reactornetmethods(1, n.index);

View file

@ -0,0 +1,8 @@
function clear(w)
% CLEAR Delete the C++ Wall object.
% clear(w)
% :param w:
% Instance of class :mat:func:`Wall`
%
wallmethods(1, w.index);

View file

@ -0,0 +1,8 @@
function clear(x)
% CLEAR Delete the C++ XML_Node object.
% clear(x)
% :param x:
% Instance of class :mat:func:`XML_Node`
%
ctmethods(10, 1, x.id);