Changeset 154 for trunk/src/matlab/rpLibElement.cc
- Timestamp:
- Jan 11, 2006, 3:55:15 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/matlab/rpLibElement.cc
r135 r154 3 3 * INTERFACE: Matlab Rappture Library Source 4 4 * 5 * nodeHandle= rpLibElement(libHandle,path)5 * [nodeHandle,err] = rpLibElement(libHandle,path) 6 6 * 7 7 * ====================================================================== … … 16 16 #include "RpMatlabInterface.h" 17 17 18 /**********************************************************************/ 19 // METHOD: [retVal,err] = rpLibElement(libHandle,path) 20 /// Return a handle to the element at location 'path' in 'libHandle' 21 /** 22 * This method searches the Rappture Library Object 'libHandle' for the 23 * node at the location described by the path 'path' and returns 24 * a handle to it. 25 * 26 * If path is an empty string, the root of the node is used. 'libHandle' 27 * is the handle representing the instance of the RpLibrary object. 28 * Error code, err=0 on success, anything else is failure. 29 */ 30 31 18 32 void mexFunction(int nlhs, mxArray *plhs[], 19 33 int nrhs, const mxArray *prhs[]) … … 21 35 int libIndex = 0; 22 36 int retLibIndex = 0; 37 int err = 1; 23 38 RpLibrary* lib = NULL; 24 39 RpLibrary* retLib = NULL; … … 28 43 if (nrhs != 2) 29 44 mexErrMsgTxt("Two input required."); 30 else if (nlhs > 1)45 else if (nlhs > 2) 31 46 mexErrMsgTxt("Too many output arguments."); 32 47 … … 40 55 retLib = rpElement(lib,path); 41 56 retLibIndex = storeObject_Lib(retLib); 57 if (retLibIndex) { 58 err = 0; 59 } 42 60 } 43 61 } … … 45 63 /* Set double scalar node handle to MATLAB mexFunction output*/ 46 64 plhs[0] = mxCreateDoubleScalar(retLibIndex); 65 plhs[1] = mxCreateDoubleScalar(err); 47 66 48 67 return;
Note: See TracChangeset
for help on using the changeset viewer.