urbiDeleteCallBack

PURPOSE ^

Remove the specified callback

SYNOPSIS ^

function urbiDeleteCallBack(con, callBackID)

DESCRIPTION ^

Remove the specified callback
 This function removes a callback from the list of the callbacks processed
 by the urbiProcessEvent function.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function urbiDeleteCallBack(con, callBackID)
0002 %Remove the specified callback
0003 % This function removes a callback from the list of the callbacks processed
0004 % by the urbiProcessEvent function.
0005 
0006 if (nargin ~= 2)
0007     error('urbiDeleteCallBack(con, callBackID)\n con : connection to urbi server\n callBackID : id of the callBack',1);
0008 end
0009 
0010 global Internal_Call_Back_Array Internal_Call_Back_connections
0011 
0012 n = size(Internal_Call_Back_Array{con + 1}, 1);
0013 for i=1:n
0014     Array = Internal_Call_Back_Array{con + 1};
0015     S = Array(i);
0016     if (S.id == callBackID)
0017         head = Array (1:i-1);
0018         tail = Array (i+1:n);
0019         Internal_Call_Back_Array{con + 1} = [ head ; tail ];
0020         % No callBack on this connection -> retrieve con
0021         if (size(Internal_Call_Back_Array{con + 1}, 1) == 0)
0022             n = size(Internal_Call_Back_connections, 2);
0023             for j=1:n
0024                 if (Internal_Call_Back_connections(j) == con)
0025                     head = Internal_Call_Back_connections (1:j-1);
0026                     tail = Internal_Call_Back_connections (i+j:n);
0027                     Internal_Call_Back_connections = [head tail];
0028                     return;
0029                 end;
0030             end;
0031         end;
0032         return;
0033     end;
0034 end;
0035 
0036 error('Callback %d is not defined', callBackID);

Generated on Tue 20-Dec-2005 19:05:34 by m2html © 2003