Main Page
Namespaces
Classes
Files
File List
File Members
build
buildd
coinor-ipopt-3.10.2
Ipopt
contrib
MatlabInterface-Old
src
matlabfunctionhandle.h
Go to the documentation of this file.
1
#ifndef INCLUDE_MATLABFUNCTIONHANDLE
2
#define INCLUDE_MATLABFUNCTIONHANDLE
3
4
#include "mex.h"
5
6
// Class MatlabFunctionHandle.
7
// -----------------------------------------------------------------
8
class
MatlabFunctionHandle
{
9
public
:
10
11
// This is the default constructor. It stores a null function
12
// handle.
13
MatlabFunctionHandle
();
14
15
// This constructor accepts as input a pointer to a Matlab array,
16
// which must be of the function handle class.
17
explicit
MatlabFunctionHandle
(
const
mxArray* ptr);
18
19
// The copy constructor makes a full copy of the source object.
20
MatlabFunctionHandle
(
const
MatlabFunctionHandle
& source);
21
22
// The destructor.
23
~MatlabFunctionHandle
();
24
25
// Conversion operator for pointer to MATLAB array.
26
operator
mxArray* ()
const
{
return
f
; };
27
28
// Returns false if and only if we have the null function handle.
29
operator
bool()
const
{
return
f
!= 0; };
30
31
protected
:
32
mxArray*
f
;
// The MATLAB array storing information concerning
33
// the function handle.
34
35
// The copy assignment operator is not proper, thus remains protected.
36
MatlabFunctionHandle
&
operator=
(
const
MatlabFunctionHandle
& source)
37
{
return
*
this
; };
38
};
39
40
#endif
Generated on Fri Jun 29 2012 06:35:12 by
1.8.1.1