Add separate functions for setting the master callbacks

git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@1360 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
gombasg 2008-02-18 10:04:15 +00:00 committed by Adam Visegradi
parent fb679d3d07
commit dc63accd89
4 changed files with 50 additions and 2 deletions

View File

@ -224,6 +224,22 @@ void DC_setMasterCb(DC_ResultCallback resultcb,
_dc_messagecb = msgcb;
}
void DC_setResultCb(DC_ResultCallback cb)
{
_dc_resultcb = cb;
}
void DC_setSubresultCb(DC_SubresultCallback cb)
{
_dc_subresultcb = cb;
}
void DC_setMessageCb(DC_MessageCallback cb)
{
_dc_messagecb = cb;
}
/********************************************************************
* XML file definition parser
*/

View File

@ -58,7 +58,6 @@ DC_MasterEvent
DC_ResultCallback
DC_SubresultCallback
DC_MessageCallback
DC_SuspendCallback
<SUBSECTION>
DC_initMaster
@ -66,7 +65,6 @@ DC_setMasterCb
DC_setMessageCb
DC_setResultCb
DC_setSubresultCb
DC_setSuspendCb
<SUBSECTION>
DC_processMasterEvents

View File

@ -120,12 +120,41 @@ Sets the callback functions to be used for event reporting. One or more of the
callbacks may be %NULL if the master does not wish to receive the specific
event.
</para>
<para>
This function is deprecated, use the separate DC_setMessageCb(), DC_setResultCb()
and DC_setSubresultCb() functions instead.
</para>
@resultcb: the callback to be used to report results.
@subresultcb: the callback to be used to report subresults.
@msgcb: the callback for reporting messages.
<!-- ##### FUNCTION DC_setMessageCb ##### -->
<para>
Sets the callback function that will be called when the master receives a
new message from one of the running workunits.
</para>
@cb: the callback to be used to report messages.
<!-- ##### FUNCTION DC_setResultCb ##### -->
<para>
Sets the callback function that will be called when a workunit finishes.
</para>
@cb: the callback to be used to report results.
<!-- ##### FUNCTION DC_setSubresultCb ##### -->
<para>
Sets the callback function that will be called when a subresult becomes available.
</para>
@cb: the callback to be used to report subresults.
<!-- ##### FUNCTION DC_processMasterEvents ##### -->
<para>
Processes work unit events. In case of a work unit completes and its result is

View File

@ -97,6 +97,11 @@ int DC_initMaster(const char *configFile);
void DC_setMasterCb(DC_ResultCallback resultcb,
DC_SubresultCallback subresultcb, DC_MessageCallback msgcb);
/* Set the callback functions for particular events */
void DC_setResultCb(DC_ResultCallback cb);
void DC_setSubresultCb(DC_SubresultCallback cb);
void DC_setMessageCb(DC_MessageCallback cb);
/* Queries the number of WUs known to the API in the given state. */
int DC_getWUNumber(DC_WUState state);