MexReturn Class Reference

Class to help manage return values in mex files. More...

#include <Matlab/mexConverts.H>

List of all members.

Public Member Functions

 MexReturn (int nlhs, mxArray *plhs[])
 Constructor takes arguments from the mexFunction call.
virtual ~MexReturn ()
 Destructor checks that all arguments are assigned.
int numArgs ()
 returns the number of return arguments
bool isNumOK (int num)
 test if 0 <= num < numArgs()
bool store (int num, mxArray *val)
 store a mxArray as return argumnt num; true if successful
bool store (int num, double val)
 store double scalar
template<class T >
bool store (int num, const std::vector< T > &val)
 store a vector of numbers
template<class T >
bool store (int num, const Image< T > &val)
 store a grayscale image
template<class T >
bool store (int num, const Image< PixRGB< T > > &val)
 store an RGB image

Detailed Description

Class to help manage return values in mex files.

Definition at line 152 of file mexConverts.H.


Constructor & Destructor Documentation

MexReturn::MexReturn ( int  nlhs,
mxArray *  plhs[] 
)

Constructor takes arguments from the mexFunction call.

MexReturn::~MexReturn (  )  [virtual]

Destructor checks that all arguments are assigned.

Definition at line 567 of file mexConverts.C.

References mexError(), mexFatal(), and sformat().


Member Function Documentation

bool MexReturn::isNumOK ( int  num  ) 

test if 0 <= num < numArgs()

Definition at line 585 of file mexConverts.C.

References numArgs().

Referenced by store().

int MexReturn::numArgs (  ) 

returns the number of return arguments

Definition at line 581 of file mexConverts.C.

Referenced by isNumOK().

template<class T >
bool MexReturn::store ( int  num,
const Image< PixRGB< T > > &  val 
) [inline]

store an RGB image

Definition at line 618 of file mexConverts.C.

References isNumOK(), RGBImage2mexArray(), and store().

template<class T >
bool MexReturn::store ( int  num,
const Image< T > &  val 
) [inline]

store a grayscale image

Definition at line 610 of file mexConverts.C.

References Image2mexArray(), isNumOK(), and store().

template<class T >
bool MexReturn::store ( int  num,
const std::vector< T > &  val 
) [inline]

store a vector of numbers

Definition at line 602 of file mexConverts.C.

References isNumOK(), store(), and Vector2mexArr().

bool MexReturn::store ( int  num,
double  val 
)

store double scalar

Definition at line 597 of file mexConverts.C.

References store().

bool MexReturn::store ( int  num,
mxArray *  val 
)

store a mxArray as return argumnt num; true if successful

Definition at line 589 of file mexConverts.C.

References isNumOK().

Referenced by store().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:37 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3