Refactoring matlab functions (internally)

parent ffbd25d0
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
function [output] = generateStubs() function [output] = generateStubs()
% Get interface describtion % Get interface describtion
d = VAMatlab('enumerateFunctions'); d = VAMatlab('enumerate_functions');
code = ''; code = '';
for i=1:length(d) for i=1:length(d)
......
...@@ -67,7 +67,7 @@ if ~isempty( current_va_mex_dir ) ...@@ -67,7 +67,7 @@ if ~isempty( current_va_mex_dir )
set( handles.edit_vamatlab_full_path, 'String', current_va_mex_dir ) set( handles.edit_vamatlab_full_path, 'String', current_va_mex_dir )
try try
v = VAMatlab( 'getVersion' ); v = VAMatlab( 'get_version' );
set( handles.edit_vamatlab_version, 'String', v ) set( handles.edit_vamatlab_version, 'String', v )
catch catch
set( handles.edit_vamatlab_version, 'String', 'Failed to execute VAMatlab, probably a depending library is missing.' ) set( handles.edit_vamatlab_version, 'String', 'Failed to execute VAMatlab, probably a depending library is missing.' )
......
...@@ -127,7 +127,7 @@ ConnectionHandle GetConnectionHandle( const mxArray *pArray, bool bAllowNullHand ...@@ -127,7 +127,7 @@ ConnectionHandle GetConnectionHandle( const mxArray *pArray, bool bAllowNullHand
// USED FOR? Convenience baby! This saves some lines of code below ... // USED FOR? Convenience baby! This saves some lines of code below ...
// NOTE: In this MEX we are always checking for the exact number of arguments // NOTE: In this MEX we are always checking for the exact number of arguments
// Optional values are predefined in the Matlab facade class // Optional values are predefined in the Matlab facade class
void vCheckInputArguments( int nrhs, int iRequiredNumArgs ) void CheckInputArguments( int nrhs, int iRequiredNumArgs )
{ {
if( nrhs != iRequiredNumArgs ) if( nrhs != iRequiredNumArgs )
{ {
...@@ -175,7 +175,7 @@ void banner() ...@@ -175,7 +175,7 @@ void banner()
} }
// Helper macro // Helper macro
#define REQUIRE_INPUT_ARGS( N ) vCheckInputArguments( nrhs, N ) #define REQUIRE_INPUT_ARGS( N ) CheckInputArguments( nrhs, N )
/* +------------------------------------------------------+ /* +------------------------------------------------------+
| | | |
...@@ -231,9 +231,9 @@ void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) ...@@ -231,9 +231,9 @@ void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
// Reflexion function. Returns cell-array of structs with information on the command functions. // Reflexion function. Returns cell-array of structs with information on the command functions.
// Used for code generation of the Matlab MEX facade class [private] // Used for code generation of the Matlab MEX facade class [private]
REGISTER_PRIVATE_FUNCTION( enumerateFunctions ); REGISTER_PRIVATE_FUNCTION( enumerate_functions );
void enumerateFunctions( int nlhs, mxArray *plhs[], int nrhs, const mxArray** ) void enumerate_functions( int nlhs, mxArray *plhs[], int nrhs, const mxArray** )
{ {
// Count public functions // Count public functions
mwSize nPublicFuncs = 0; mwSize nPublicFuncs = 0;
...@@ -265,8 +265,8 @@ void enumerateFunctions( int nlhs, mxArray *plhs[], int nrhs, const mxArray** ) ...@@ -265,8 +265,8 @@ void enumerateFunctions( int nlhs, mxArray *plhs[], int nrhs, const mxArray** )
// ------------------------------------------------------------ // ------------------------------------------------------------
REGISTER_PRIVATE_FUNCTION( getVersion ); REGISTER_PRIVATE_FUNCTION( get_version );
void getVersion( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) void get_version( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{ {
std::stringstream ss; std::stringstream ss;
ss << "VAMatlab " << VAMATLAB_VERSION_MAJOR << "." << VAMATLAB_VERSION_MINOR; ss << "VAMatlab " << VAMATLAB_VERSION_MAJOR << "." << VAMATLAB_VERSION_MINOR;
...@@ -284,8 +284,8 @@ void getVersion( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) ...@@ -284,8 +284,8 @@ void getVersion( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
// ------------------------------------------------------------ // ------------------------------------------------------------
REGISTER_PRIVATE_FUNCTION( setVerboseMode ); REGISTER_PRIVATE_FUNCTION( set_verbose_mode );
void setVerboseMode( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) void set_verbose_mode( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{ {
REQUIRE_INPUT_ARGS( 1 ); REQUIRE_INPUT_ARGS( 1 );
...@@ -303,7 +303,7 @@ void setVerboseMode( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ...@@ -303,7 +303,7 @@ void setVerboseMode( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]
return; return;
} }
VA_EXCEPT1( "Invalid verbose mode" ); VA_EXCEPT1( "Invalid verbose mode, use 'quiet' or 'normal'" );
} }
// ------------------------------------------------------------ // ------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment