92#include "dcppcallbackbase.h"
155 DitsDeltaTimeType delay;
157 StatusType errorStat;
171 DcppCallbackBase* callbackObj;
173 void ErrorHandler(StatusType * status);
174 void TimeoutHandler(StatusType * status);
175 void FinishedHandler(StatusType * status);
184 return ((DitsGetContext() == DITS_CTX_UFACE) ?
true :
false);
230 const float Timeout = -1);
257 const float Timeout = -1);
273 virtual void Install(StatusType * status,
int threads = 1);
295 finishedHandler = FinishedHandler;
350 void Wait(DitsTransIdType transId, StatusType* status,
double timeout = 0);
374 void WaitAll(StatusType* status,
double timeout = 0);
383 errorHandler = ErrorHandler;
390 clientData = ClientData;
409 const float Timeout) {
411 timeoutHandler = TimeoutHandler;
438 if (TheTask(debug) & DITS_LOG_LIBS)
439 Dits___Log(
"DcppHd::++[pre]",
440 "Thread count incremented for %p from %d to %d",
441 (
void *)
this, threadCount, threadCount+1);
449 if (TheTask(debug) & DITS_LOG_LIBS)
450 Dits___Log(
"DcppHd::++[post]",
451 "Thread count incremented for %p from %d to %d",
452 (
void *)
this, threadCount, threadCount+1);
463 if (TheTask(debug) & DITS_LOG_LIBS)
464 Dits___Log(
"DcppHd::NewThread",
465 "Thread count incremented for %p from %d to %d",
466 (
void *)
this, threadCount, threadCount+1);
void Wait(DitsTransIdType transId, StatusType *status, double timeout=0)
Wait for the completion of the action supplied with the transaction id.
virtual StatusType ErrorStatus() const
Return the status associated with the first error event.
Definition dcpphandler.h:423
virtual void Install(StatusType *status, int threads=1)
Install this handler object for the current action.
virtual void SetFinished(const DcppHandlerRoutine FinishedHandler)
Change the finished handler routine.
Definition dcpphandler.h:294
void HandleReschedule(StatusType *status)
Used internally to handle a reschedule event.
virtual int ThreadCount() const
Return the number messages being controlled at the moment.
Definition dcpphandler.h:432
virtual void SetTimeout(const float Timeout)
Change the timeout.
void SetupTimeout(const float Timeout)
Used internally.
DcppHandler(DcppCallbackBase *CallbackObj, const float Timeout=-1)
Construct a DcppHandler object.
virtual void SetError(const DcppHandlerRoutine ErrorHandler)
Change the error handler routine.
Definition dcpphandler.h:382
void operator++()
Increase the thread count by one.
Definition dcpphandler.h:437
void WaitAll(StatusType *status, double timeout=0)
Wait for all outstanding messages to complete.
void operator++(int)
Increase the thread count by one.
Definition dcpphandler.h:448
virtual void SetMultiCallErrorMode(int enable=true)
Set the multi error call mode.
Definition dcpphandler.h:418
virtual void SetData(const DcppVoidPnt ClientData)
Change the handler routine client data item.
Definition dcpphandler.h:389
virtual void DeInstall(StatusType *const status)
Remove this handler.
virtual void SetTimeout(const DcppHandlerRoutine TimeoutHandler, const float Timeout)
Set a timeout handler routine and new timeout.
Definition dcpphandler.h:408
virtual void NewThread()
Increase the thread count by one.
Definition dcpphandler.h:462
virtual DcppVoidPnt GetData() const
Return the client data value.
Definition dcpphandler.h:428
virtual ~DcppHandler()
Destructor.
DcppHandler(const DcppHandlerRoutine FinishedHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppVoidPnt ClientData=0, const float Timeout=-1)
Construct a DcppHandler object.
A DRAMA Action reschedule handler used in conjunction with DcppTask.
Definition dcpphandler.h:148
void * DcppVoidPnt
A pointer to void
Definition dcpp.h:59
DcppHandlerRet(* DcppHandlerRoutine)(DcppVoidPnt ClientData, StatusType *status)
Type for call backs when messages arrive.
Definition dcpp.h:92