36 bool serialize (
const mxArray* pItem, mxArray*& pByteStream );
37 bool deserialize (
const mxArray* pByteStream, mxArray*& pItem );
43 bool serialize(
const mxArray* pItem, mxArray*& pByteStream )
45 assert( NULL == pByteStream && NULL != pItem );
47 #if CONFIG_EARLY_BIND_SERIALIZE 49 return NULL != pByteStream;
54 mexCallMATLAB( 1, &pByteStream, 1, const_cast<mxArray**>( &pItem ),
"getByteStreamFromArray" ) ;
57 return NULL != pByteStream;
62 bool deserialize(
const mxArray* pByteStream, mxArray*& pItem )
64 assert( NULL != pByteStream && NULL == pItem );
66 #if CONFIG_EARLY_BIND_SERIALIZE 67 pItem =
mxDeserialize( mxGetData( pByteStream ), mxGetNumberOfElements( pByteStream ) );
73 mexCallMATLAB( 1, &pItem, 1, const_cast<mxArray**>( &pByteStream ),
"getArrayFromByteStream" );
84 #if CONFIG_EARLY_BIND_SERIALIZE 85 static int flagHaveSerialize = 1;
87 static int flagHaveSerialize = -1;
90 if( flagHaveSerialize < 0 )
92 mxArray* pResult = NULL;
93 mxArray* pFuncName = mxCreateString(
"getByteStreamFromArray" );
95 flagHaveSerialize = pFuncName
96 && 0 == mexCallMATLAB( 1, &pResult, 1, &pFuncName,
"exist" )
104 return flagHaveSerialize > 0;
Encapsulating a MATLAB mxArray.
bool deserialize(const mxArray *pByteStream, mxArray *&pItem)
Converts byte stream back into originally MATLAB variable.
mxArray * mxSerialize(const mxArray *)
Serialize a MATLAB array.
mxArray * mxDeserialize(const void *, size_t)
Deserialize a MATLAB array.
int GetInt(int errval=0) const
Get integer value from item.
Utilities used in all files.
void utils_destroy_array(mxArray *&pmxarr)
Freeing memory allocated by mxCreateNumericMatrix() or mxCreateNumericArray().
int g_streaming
Flag: Allow streaming.
bool can_serialize()
Returns true, if streaming is switched on (user setting) and serialization is accessible.
bool serialize(const mxArray *pItem, mxArray *&pByteStream)
Converts MATLAB variable of any complexity into byte stream.
bool have_serialize()
Returns true, if current MATLAB version supports serialization.
Value container for MATLAB/SQL data.