Skip to content

Commit

Permalink
add missing 'this->' in CjvxMexCallsProfileTpl.h and CjvxMexCallsTpl.h
Browse files Browse the repository at this point in the history
without this only MSVC accepts this (which is non-standard)
  • Loading branch information
Florian Wickert committed Jun 20, 2024
1 parent 5954933 commit b24cb4d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class CjvxMexCallsProfileTpl : public CjvxMexCallsTpl<T>, public CjvxMexCallsPro
{
jvxErrorType res = JVX_NO_ERROR;

CjvxMexCalls::prepare_connect_icon_enter(_common_set_icon.theData_in);
CjvxMexCalls::prepare_connect_icon_enter(this->_common_set_icon.theData_in);

// Run this code before actually preparing this component to allow pre-run configuration in jvxDebugConfigAec
if (_theExtCallHandler)
if (this->_theExtCallHandler)
{
// We need to run this BEFORE we run any prepare call to obtain the
// modified parameter settings in the Matlab startup
Expand All @@ -57,15 +57,15 @@ class CjvxMexCallsProfileTpl : public CjvxMexCallsTpl<T>, public CjvxMexCallsPro
if (res == JVX_NO_ERROR)
{
// Matlab initialization is complete here
res = CjvxMexCalls::prepare_connect_icon_leave(_common_set_icon.theData_in, &_common_set_ocon.theData_out);
res = CjvxMexCalls::prepare_connect_icon_leave(this->_common_set_icon.theData_in, &this->_common_set_ocon.theData_out);
}

if (res == JVX_NO_ERROR)
{
JVX_SAFE_ALLOCATE_2DFIELD_CPP_Z(dbgFldCopyInputs,
jvxData,
_common_set_icon.theData_in->con_params.number_channels,
_common_set_icon.theData_in->con_params.buffersize);
this->_common_set_icon.theData_in->con_params.number_channels,
this->_common_set_icon.theData_in->con_params.buffersize);

if (config.matlab_profiling_enabled)
{
Expand Down Expand Up @@ -93,17 +93,17 @@ class CjvxMexCallsProfileTpl : public CjvxMexCallsTpl<T>, public CjvxMexCallsPro
res = local_deallocate_profiling();
}

CjvxMexCalls::postprocess_connect_icon_enter(_common_set_icon.theData_in);
CjvxMexCalls::postprocess_connect_icon_enter(this->_common_set_icon.theData_in);

JVX_SAFE_DELETE_2DFIELD(dbgFldCopyInputs, _common_set_icon.theData_in->con_params.number_channels);
JVX_SAFE_DELETE_2DFIELD(dbgFldCopyInputs, this->_common_set_icon.theData_in->con_params.number_channels);

// Ignore all return values - if these functions fail we have a more severe problem!!

res = local_postprocess_connect_icon(JVX_CONNECTION_FEEDBACK_CALL(fdb));

res = T::postprocess_connect_icon(JVX_CONNECTION_FEEDBACK_CALL(fdb));

res = CjvxMexCalls::postprocess_connect_icon_leave(_common_set_icon.theData_in);
res = CjvxMexCalls::postprocess_connect_icon_leave(this->_common_set_icon.theData_in);

return res;
};
Expand All @@ -125,15 +125,15 @@ class CjvxMexCallsProfileTpl : public CjvxMexCallsTpl<T>, public CjvxMexCallsPro

// Check if checkbox in Matlab processing was checked
// The checkbox can be activated/deactivated while processing!!
if (_theExtCallHandler)
if (this->_theExtCallHandler)
{
CjvxMexCalls::is_matlab_processing_engaged(&engaged);
}

if(engaged)
{
jvxData** buffers_in = jvx_process_icon_extract_input_buffers<jvxData>(_common_set_icon.theData_in, idx_stage);
jvxData** buffers_out = jvx_process_icon_extract_output_buffers<jvxData>(_common_set_ocon.theData_out);
jvxData** buffers_in = jvx_process_icon_extract_input_buffers<jvxData>(this->_common_set_icon.theData_in, idx_stage);
jvxData** buffers_out = jvx_process_icon_extract_output_buffers<jvxData>(this->_common_set_ocon.theData_out);

// ===================================================
// This case to run Matlab and C code in parallel
Expand All @@ -148,26 +148,26 @@ class CjvxMexCallsProfileTpl : public CjvxMexCallsTpl<T>, public CjvxMexCallsPro
if (!skipCCode)
{
// Copy input data for later usage
for (i = 0; i < _common_set_icon.theData_in->con_params.number_channels; i++)
for (i = 0; i < this->_common_set_icon.theData_in->con_params.number_channels; i++)
{
jvxData* ptrTo = dbgFldCopyInputs[i];
jvxData* ptrFrom = (jvxData*)buffers_in[i];
memcpy(ptrTo, ptrFrom, sizeof(jvxData) * _common_set_icon.theData_in->con_params.buffersize);
memcpy(ptrTo, ptrFrom, sizeof(jvxData) * this->_common_set_icon.theData_in->con_params.buffersize);
}
}

// This lets Matlab run one frame of processing
// ======================================================================================
res = CjvxMexCalls::process_buffers_icon(_common_set_icon.theData_in, &_common_set_ocon.theData_out);
res = CjvxMexCalls::process_buffers_icon(this->_common_set_icon.theData_in, &this->_common_set_ocon.theData_out);
// ======================================================================================

if (!skipCCode)
{
for (i = 0; i < _common_set_icon.theData_in->con_params.number_channels; i++)
for (i = 0; i < this->_common_set_icon.theData_in->con_params.number_channels; i++)
{
jvxData* ptrFrom = dbgFldCopyInputs[i];
jvxData* ptrTo = (jvxData*)buffers_in[i];
memcpy(ptrTo, ptrFrom, sizeof(jvxData) * _common_set_icon.theData_in->con_params.buffersize);
memcpy(ptrTo, ptrFrom, sizeof(jvxData) * this->_common_set_icon.theData_in->con_params.buffersize);
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions sources/jvxLibraries/jvxLexternalCall/include/CjvxMexCallsTpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CjvxMexCallsTpl : public CjvxMexCalls, public T
initExternalCall();

// Run mex call base classes function to init matlab call handles
res = CjvxMexCalls::select(_common_set_min.theHostRef, static_cast<CjvxProperties*>(this), "",
res = CjvxMexCalls::select(this->_common_set_min.theHostRef, static_cast<CjvxProperties*>(this), "",
_theExtCallObjectName.c_str());
}
return(res);
Expand Down Expand Up @@ -93,25 +93,25 @@ class CjvxMexCallsTpl : public CjvxMexCalls, public T
jvxErrorType res = JVX_NO_ERROR;
// onPrepareConnectMexCalls();

CjvxMexCalls::prepare_sender_to_receiver(_common_set_icon.theData_in);
CjvxMexCalls::prepare_sender_to_receiver(this->_common_set_icon.theData_in);
res = T::prepare_connect_icon(JVX_CONNECTION_FEEDBACK_CALL(fdb));
if (res == JVX_NO_ERROR)
{
CjvxMexCalls::prepare_complete_receiver_to_sender(_common_set_icon.theData_in, &_common_set_ocon.theData_out);
CjvxMexCalls::prepare_complete_receiver_to_sender(this->_common_set_icon.theData_in, &this->_common_set_ocon.theData_out);
}
else
{
CjvxMexCalls::postprocess_sender_to_receiver(_common_set_icon.theData_in);
CjvxMexCalls::postprocess_sender_to_receiver(this->_common_set_icon.theData_in);
}
return res;
};

jvxErrorType postprocess_connect_icon(JVX_CONNECTION_FEEDBACK_TYPE(fdb)) override
{
jvxErrorType res = JVX_NO_ERROR;
CjvxMexCalls::before_postprocess_receiver_to_sender(_common_set_icon.theData_in);
CjvxMexCalls::before_postprocess_receiver_to_sender(this->_common_set_icon.theData_in);
res = T::postprocess_connect_icon(JVX_CONNECTION_FEEDBACK_CALL(fdb));
CjvxMexCalls::postprocess_sender_to_receiver(_common_set_icon.theData_in);
CjvxMexCalls::postprocess_sender_to_receiver(this->_common_set_icon.theData_in);
return res;
};

Expand All @@ -129,7 +129,7 @@ class CjvxMexCallsTpl : public CjvxMexCalls, public T

// This lets Matlab run one frame of processing
// ======================================================================================
res = CjvxMexCalls::process_buffers_icon(_common_set_icon.theData_in, &_common_set_ocon.theData_out);
res = CjvxMexCalls::process_buffers_icon(this->_common_set_icon.theData_in, &this->_common_set_ocon.theData_out);
// ======================================================================================

return T::fwd_process_buffers_icon(mt_mask, idx_stage);
Expand Down

0 comments on commit b24cb4d

Please sign in to comment.