mclSetMCRUserData - Associate MATLAB data value with string key of MCR instance uniquely identified by mcrID

Synopsis

extern "C"
bool mclSetMCRUserData(
    long mcrID,        // Integer MCR instance identifier
    const char *key,    // Store user data under this key
    mxArray *value      // User data value
);

Description

This external C function associates a MATLAB data value with the string key of the MCR instance uniquely identified by mcrID. mclSetMCRUserData registers the mxArray value under the string key, which may later be used by mclGetMCRInstanceData to retrieve the data. mclSetMCRUserData is defined in the MCLMCR module and is only available to wrapper code in deployed applications. This function makes a shared copy of the input data and does not assume ownership of the mxArray value. You must call mxDestroyArray on value eventually in your application or memory leak problems may occur.

This command is part of the MCR User Data interface API. For information about this function, as well as complete examples of usage, see Improving Data Access Using the MCR User Data Interface.

Example

mxArray *value = mxCreateString("/usr/userdir/config.mat");
if (!mclSetMCRUserData(mcrID, "ParallelConfigurationFile", 
      "/usr/userdir/config.mat") )
{
    fprintf(stderr, "Could not set PCTConfigFile MCR user data.\n");
    return -3;
}

See Also

mclSetCmdLineMCRUserData, mclGetMCRUserData

  


 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS