|
Audio Processing Framework (APF) version 0.5.0
|
Helper functions for creating MEX files. More...
Functions | |
| bool | convert (const mxArray *in, std::string &out) |
Convert mxArray to std::string. More... | |
| bool | convert (const mxArray *in, double &out) |
Convert mxArray to double. More... | |
| bool | convert (const mxArray *in, int &out) |
Convert mxArray to int. More... | |
| bool | convert (const mxArray *in, long int &out) |
Convert mxArray to long int More... | |
| bool | convert (const mxArray *in, bool &out) |
Convert mxArray to bool. More... | |
| bool | convert (const mxArray *in, size_t &out) |
Convert mxArray to size_t. More... | |
| bool | convert (const mxArray *in, std::map< std::string, std::string > &out) |
Convert mxArray to a std::map of std::strings. More... | |
| bool | convert (const mxArray *in, std::vector< std::string > &out) |
Convert mxArray to a std::vector of std::strings. More... | |
| template<typename T > | |
| bool | next_arg (int &n, const mxArray **&p, T &data) |
Get next argument, converted to T. More... | |
| template<typename T > | |
| bool | next_optarg (int &n, const mxArray **&p, T &data) |
Get next optional argument, converted to T. More... | |
| template<typename T > | |
| void | next_arg (int &n, const mxArray **&p, T &data, const std::string &error) |
Get next argument, converted to T. More... | |
| template<typename T > | |
| void | next_optarg (int &n, const mxArray **&p, T &data, const std::string &error) |
Get next optional argument, converted to T. More... | |
Helper functions for creating MEX files.
| bool apf::mex::convert | ( | const mxArray * | in, |
| std::string & | out | ||
| ) |
| bool apf::mex::convert | ( | const mxArray * | in, |
| double & | out | ||
| ) |
Convert mxArray to double.
Definition at line 124 of file mextools.h.
| bool apf::mex::convert | ( | const mxArray * | in, |
| int & | out | ||
| ) |
Convert mxArray to int.
Definition at line 133 of file mextools.h.
| bool apf::mex::convert | ( | const mxArray * | in, |
| long int & | out | ||
| ) |
Convert mxArray to long int
Definition at line 144 of file mextools.h.
| bool apf::mex::convert | ( | const mxArray * | in, |
| bool & | out | ||
| ) |
Convert mxArray to bool.
Definition at line 155 of file mextools.h.
| bool apf::mex::convert | ( | const mxArray * | in, |
| size_t & | out | ||
| ) |
Convert mxArray to size_t.
Definition at line 164 of file mextools.h.
| bool apf::mex::convert | ( | const mxArray * | in, |
| std::map< std::string, std::string > & | out | ||
| ) |
Convert mxArray to a std::map of std::strings.
This expects a scalar structure! Values must be real scalar numbers or strings!
Definition at line 179 of file mextools.h.
References apf::str::A2S(), and convert().
| bool apf::mex::convert | ( | const mxArray * | in, |
| std::vector< std::string > & | out | ||
| ) |
Convert mxArray to a std::vector of std::strings.
This expects a cell array of strings!
Definition at line 217 of file mextools.h.
References convert().
| bool apf::mex::next_arg | ( | int & | n, |
| const mxArray **& | p, | ||
| T & | data | ||
| ) |
Get next argument, converted to T.
| [in,out] | n | Number of arguments, typically nrhs |
| [in,out] | p | Pointer to arguments, typically prhs |
| [out] | data | If conversion is successful, the result is stored here |
n is decremented and p is incremented. If not, n and p are unchanged, data may be corrupted. Definition at line 265 of file mextools.h.
Referenced by next_arg().
| bool apf::mex::next_optarg | ( | int & | n, |
| const mxArray **& | p, | ||
| T & | data | ||
| ) |
Get next optional argument, converted to T.
| [in,out] | data | Default value. If there is an argument left and if the conversion is successful, the result is stored here. |
data, n is decremented and p is incremented. If the conversion failed, n and p are unchanged, data may be corrupted. If there was no argument available, n, p and data are unchanged. Definition at line 281 of file mextools.h.
Referenced by next_optarg().
| void apf::mex::next_arg | ( | int & | n, |
| const mxArray **& | p, | ||
| T & | data, | ||
| const std::string & | error | ||
| ) |
Get next argument, converted to T.
| error | Message to be displayed on error |
Definition at line 290 of file mextools.h.
References next_arg().
| void apf::mex::next_optarg | ( | int & | n, |
| const mxArray **& | p, | ||
| T & | data, | ||
| const std::string & | error | ||
| ) |
Get next optional argument, converted to T.
| error | Message to be displayed on error |
Definition at line 299 of file mextools.h.
References next_optarg().