Skip to content

Commit

Permalink
Fix MATLAB
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier committed Apr 19, 2024
1 parent 42f9455 commit 8ffc0f9
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 223 deletions.
41 changes: 0 additions & 41 deletions matlab/lib/+Ice/ACM.m

This file was deleted.

48 changes: 0 additions & 48 deletions matlab/lib/+Ice/ACMClose.m

This file was deleted.

41 changes: 0 additions & 41 deletions matlab/lib/+Ice/ACMHeartbeat.m

This file was deleted.

37 changes: 0 additions & 37 deletions matlab/lib/+Ice/Connection.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
% connection.
% heartbeat - Send a heartbeat message.
% heartbeatAsync - Send a heartbeat message.
% setACM - Set the active connection management parameters.
% getACM - Get the ACM parameters.
% type - Return the connection type.
% timeout - Get the timeout for the connection.
% toString - Return a description of the connection as human readable
Expand Down Expand Up @@ -151,41 +149,6 @@ function heartbeat(obj)
assert(~isNull(future));
r = Ice.Future(future, 'heartbeat', 0, 'Ice_SimpleFuture', @(fut) fut.iceCall('check'));
end
function setACM(obj, timeout, close, heartbeat)
% setACM Set the active connection management parameters.
%
% Parameters:
% timeout (int32) - The timeout value in milliseconds.
% close (Ice.ACMClose) - The close condition.
% heartbeat (Ice.ACMHeartbeat) - The hertbeat condition.

if timeout == Ice.Unset
timeout = [];
end
if close == Ice.Unset
close = [];
end
if heartbeat == Ice.Unset
heartbeat = [];
end
obj.iceCall('setACM', timeout, close, heartbeat);
end
function r = getACM(obj)
% getACM Get the ACM parameters.
%
% Returns (Ice.ACM) - The ACM parameters.

r = obj.iceCallWithResult('getACM');
if isempty(r.timeout)
r.timeout = Ice.Unset;
end
if isempty(r.close)
r.close = Ice.Unset;
end
if isempty(r.heartbeat)
r.heartbeat = Ice.Unset;
end
end
function r = type(obj)
% type Return the connection type. This corresponds to the
% endpoint type, i.e., "tcp", "udp", etc.
Expand Down
56 changes: 0 additions & 56 deletions matlab/src/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,62 +282,6 @@ extern "C"
return 0;
}

mxArray* Ice_Connection_setACM(void* self, mxArray* t, mxArray* c, mxArray* h)
{
optional<int> timeout;
optional<Ice::ACMClose> close;
optional<Ice::ACMHeartbeat> heartbeat;

try
{
if (!mxIsEmpty(t))
{
if (!mxIsScalar(t))
{
throw invalid_argument("scalar value required for timeout");
}
if (!mxIsNumeric(t))
{
throw invalid_argument("numeric value required for timeout");
}
timeout = static_cast<int>(mxGetScalar(t));
}
if (!mxIsEmpty(c))
{
close = static_cast<Ice::ACMClose>(getEnumerator(c, "Ice.ACMClose"));
}
if (!mxIsEmpty(h))
{
heartbeat = static_cast<Ice::ACMHeartbeat>(getEnumerator(h, "Ice.ACMHeartbeat"));
}
deref<Ice::Connection>(self)->setACM(timeout, close, heartbeat);
}
catch (...)
{
return convertException(std::current_exception());
}
return 0;
}

mxArray* Ice_Connection_getACM(void* self)
{
try
{
auto acm = deref<Ice::Connection>(self)->getACM();
mxArray* params[3];
params[0] = createInt(acm.timeout);
params[1] = createInt(static_cast<int>(acm.close)); // The integer is converted to the enumerator.
params[2] = createInt(static_cast<int>(acm.heartbeat)); // The integer is converted to the enumerator.
mxArray* r;
mexCallMATLAB(1, &r, 3, params, "Ice.ACM");
return createResultValue(r);
}
catch (...)
{
return createResultException(convertException(std::current_exception()));
}
}

mxArray* Ice_Connection_type(void* self)
{
try
Expand Down

0 comments on commit 8ffc0f9

Please sign in to comment.