#include <dcpptask.h>
Inheritance diagram for DcppTask:

This class was the original attempt at providing a C++ interface to DRAMA's message sending functions. The idea is that you maintain an object of this type for each task you want to send messages to. You can then use the various methods to send messages. The Action/UFACE routine which processes replies to these messages can use DcppDisptach() to dispatch the messages such that the callback functions which are specified when the message is sent, are invoked.
In addition, when invoked with an action, the used of DcppTask can be combined with a DcppHandler object to handle action rescheduling transparently. This is optional.
Public Member Functions | |
| DcppTask (const char *const name, const char *const location=0, const char *const file=0) | |
| Normal constructor. | |
| DcppTask (bool self) | |
| Path to self constructor. | |
| virtual | ~DcppTask () |
| Destructor. | |
| void | TaskLoggingOn () |
| Turn logging on for this object. | |
| void | TaskLoggingOff () |
| Turn logging off for this object. | |
| void | Report (StatusType *status) const |
| Dump details using. | |
| bool | GetPathLoaded () const |
| Indicate if a the task was loaded. | |
| const char * | TaskName () const |
| Fetch the task name. | |
| const char * | Location () const |
| Fetch the task location. | |
| const char * | GetArgument () const |
| Fetch the load argument. | |
| virtual void | SetName (const char *const TaskName) |
| Set the task name. | |
| virtual void | SetLocation (const char *const Location) |
| Set the task location. | |
| virtual void | SetFile (const char *const File) |
| Set the executable file name. | |
| virtual void | SetBuffers (const DcppBuffers &Buffers) |
| Set the DRAMA path buffers. | |
| virtual void | SetFlowControl () |
| Set the FLOW control flag. | |
| virtual void | SetProcess (const char *const ProcessName) |
| Set the process names. | |
| virtual void | SetStackSize (unsigned bytes) |
| Set the stack size for the load. | |
| virtual void | SetArgument (const char *const LoadArg, bool const Append=false) |
| Set the load time argument string. | |
| virtual void | SetPriority (const int Priority, const bool Absolute=false) |
| Set the load time priority for a task when loaded. | |
| virtual void | SetNames (const bool Flag=true) |
| Insist that symbols known to IMP_Master be known to the task. | |
| virtual void | SetSymbols (const bool Flag=true) |
| Interpert file name as a symbol (VMS Target only). | |
| virtual void | SetProg (const bool Flag=true) |
| Interpert file name as a program name. | |
| virtual void | LogLoad (const bool Flag=true) |
| Load use. | |
| virtual void | ClearState () |
| Clear the task state. | |
| virtual bool | Active () |
| Indicate if a task is active. | |
| virtual bool | IsDead () |
| Return true if a previously active task has disconnected. | |
| virtual bool | Initial () |
| Return true if a GetPath operation is required. | |
| virtual bool | Busy () |
| Returns true if we can't send a message because path is busy. | |
| virtual DcppHandlerRet | GetPath (StatusType *const status, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppVoidPnt ClientData=0) |
| Get a path to/load a the task. | |
| virtual void | Died () |
| Note that a task has died. | |
| virtual void | LosePath (StatusType *const status) |
| Lose the path and then set as if the task has died. | |
| virtual void | Delete (int force, StatusType *status) |
| Delete the task. | |
| virtual DcppHandlerRet | Obey (const char *const name, StatusType *const status, const SdsId &arg=SdsNull, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppHandlerRoutine TriggerHandler=0, const DcppVoidPnt ClientData=0, const DcppHandlerRoutine ErsHandler=0, const DcppHandlerRoutine MsgHandler=0, DitsTransIdType *const transid=0) |
| Send a DRAMA Obey message to the task. | |
| virtual DcppHandlerRet | Obey (const char *const name, StatusType *const status, const SdsId &arg, const DcppHandlerRoutine SuccessHandler, const DcppHandlerRoutine ErrorHandler, const DcppHandlerRoutine TriggerHandler, const DcppVoidPnt ClientData, const DcppHandlerRoutine ErsHandler, const DcppHandlerRoutine MsgHandler, SdsId *const tidArg) |
| Send a DRAMA Obey message to the task. | |
| virtual DcppHandlerRet | Obey (const char *const name, StatusType *const status, const SdsId &arg, const DcppHandlerRoutine SuccessHandler, const DcppHandlerRoutine ErrorHandler, const DcppHandlerRoutine TriggerHandler, const DcppVoidPnt ClientData, const DcppHandlerRoutine ErsHandler, const DcppHandlerRoutine MsgHandler, const SdsId *const tidArg) |
| Send a DRAMA Obey message to the task. | |
| virtual DcppHandlerRet | Kick (const char *const name, StatusType *const status, const SdsId &arg=SdsNull, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppVoidPnt ClientData=0, const DcppHandlerRoutine ErsHandler=0, const DcppHandlerRoutine MsgHandler=0) |
| Send a DRAMA Kick message to the task. | |
| virtual DcppHandlerRet | Obey (const char *const name, const DcppShared &SharedMem, const bool sds, const int NotifyBytes, StatusType *const status, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppBulkTransRoutine BulkTransHandler=0, const DcppHandlerRoutine BulkDoneHandler=0, const DcppHandlerRoutine TriggerHandler=0, const DcppVoidPnt ClientData=0, const DcppHandlerRoutine ErsHandler=0, const DcppHandlerRoutine MsgHandler=0, DitsTransIdType *const transid=0) |
| Send a DRAMA Obey bulk data message to the task. | |
| virtual DcppHandlerRet | Obey (const char *const name, const DcppShared &SharedMem, const bool sds, const int NotifyBytes, StatusType *const status, const DcppHandlerRoutine SuccessHandler, const DcppHandlerRoutine ErrorHandler, const DcppBulkTransRoutine BulkTransHandler, const DcppHandlerRoutine BulkDoneHandler, const DcppHandlerRoutine TriggerHandler, const DcppVoidPnt ClientData, const DcppHandlerRoutine ErsHandler, const DcppHandlerRoutine MsgHandler, SdsId *const tidArg) |
| Send a DRAMA Obey bulk data message to the task. | |
| virtual DcppHandlerRet | Obey (const char *const name, const DcppShared &SharedMem, const bool sds, const int NotifyBytes, StatusType *const status, const DcppHandlerRoutine SuccessHandler, const DcppHandlerRoutine ErrorHandler, const DcppBulkTransRoutine BulkTransHandler, const DcppHandlerRoutine BulkDoneHandler, const DcppHandlerRoutine TriggerHandler, const DcppVoidPnt ClientData, const DcppHandlerRoutine ErsHandler, const DcppHandlerRoutine MsgHandler, const SdsId *const tidArg) |
| Send a DRAMA Obey bulk data message to the task. | |
| virtual DcppHandlerRet | Kick (const char *const name, const DcppShared &SharedMem, const bool sds, const int NotifyBytes, StatusType *const status, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppBulkTransRoutine BulkTransHandler=0, const DcppHandlerRoutine BulkDoneHandler=0, const DcppVoidPnt ClientData=0, const DcppHandlerRoutine ErsHandler=0, const DcppHandlerRoutine MsgHandler=0) |
| Send a DRAMA bulk data Kick message to the task. | |
| virtual DcppHandlerRet | Get (const char *const name, StatusType *const status, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppVoidPnt ClientData=0, const DcppHandlerRoutine ErsHandler=0) |
| Send a DRAMA message to the task to get the value of a parameter. | |
| virtual DcppHandlerRet | MGet (const DcppHandlerRoutine SuccessHandler, const DcppHandlerRoutine ErrorHandler, const DcppVoidPnt ClientData, unsigned count, StatusType *status,...) |
| Send a DRAMA message to the task to get the value of multiple parameters. | |
| virtual DcppHandlerRet | MGet (const DcppHandlerRoutine SuccessHandler, const DcppHandlerRoutine ErrorHandler, const DcppHandlerRoutine ErsHandler, const DcppVoidPnt ClientData, unsigned count, StatusType *status,...) |
| Send a DRAMA message to the task to get the value of multiple parameters. | |
| virtual DcppHandlerRet | Set (const char *const name, StatusType *const status, const SdsId &arg=SdsNull, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppVoidPnt ClientData=0, const DcppHandlerRoutine ErsHandler=0) |
| Send a DRAMA set message to the task. | |
| virtual DcppHandlerRet | Control (const char *const name, StatusType *const status, const SdsId &arg=SdsNull, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppHandlerRoutine TriggerHandler=0, const DcppVoidPnt ClientData=0, const DcppHandlerRoutine ErsHandler=0) |
| Send a DRAMA Control message to the task. | |
| virtual DcppHandlerRet | Monitor (const char *name, StatusType *const status, const SdsId &arg=SdsNull, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppHandlerRoutine TriggerHandler=0, const DcppVoidPnt ClientData=0, const bool SendCurrent=false, const DcppHandlerRoutine ErsHandler=0) |
| Send a DRAMA Monitor message to the task. | |
| virtual void | ObeyForget (const char *const name, StatusType *const status, const SdsId &arg=SdsNull, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppHandlerRoutine TriggerHandler=0, const DcppVoidPnt ClientData=0, const DcppHandlerRoutine ErsHandler=0, const DcppHandlerRoutine MsgHandler=0, DitsTransIdType *const transid=0) |
| Send a DRAMA Obey message to the task, forgetting the transaction. | |
| virtual void | ObeyForget (const char *const name, StatusType *const status, const SdsId &arg, const DcppHandlerRoutine SuccessHandler, const DcppHandlerRoutine ErrorHandler, const DcppHandlerRoutine TriggerHandler, const DcppVoidPnt ClientData, const DcppHandlerRoutine ErsHandler, const DcppHandlerRoutine MsgHandler, SdsId *const tidArg) |
| Send a DRAMA Obey message to the task, forgetting the transaction. | |
| virtual void | ObeyForget (const char *const name, StatusType *const status, const SdsId &arg, const DcppHandlerRoutine SuccessHandler, const DcppHandlerRoutine ErrorHandler, const DcppHandlerRoutine TriggerHandler, const DcppVoidPnt ClientData, const DcppHandlerRoutine ErsHandler, const DcppHandlerRoutine MsgHandler, const SdsId *const tidArg) |
| Send a DRAMA Obey message to the task, forgetting the transaction. | |
| virtual void | KickForget (const char *const name, StatusType *const status, const SdsId &arg=SdsNull, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppVoidPnt ClientData=0, const DcppHandlerRoutine ErsHandler=0, const DcppHandlerRoutine MsgHandler=0) |
| Send a DRAMA OKick message to the task, forgetting the transaction. | |
| virtual void | MonitorForget (const char *name, StatusType *const status, const SdsId &arg=SdsNull, const DcppHandlerRoutine SuccessHandler=0, const DcppHandlerRoutine ErrorHandler=0, const DcppHandlerRoutine TriggerHandler=0, const DcppVoidPnt ClientData=0, const bool SendCurrent=false, const DcppHandlerRoutine ErsHandler=0) |
| Send a DRAMA Monitor message to the task, forgetting the transaction. | |
| virtual DisconHandler * | PutDisconnectHandler (DisconHandler *p) |
| Add a new disconnect handler for this task. | |
| DcppHandlerRet | HandleMessage (DcppTransaction *transaction, StatusType *status) |
| Function used by DcppDispatch in dispatching to handlers. | |
| virtual void | GetDitsPath (DitsPathType *path, StatusType *status) |
| Return the underlying DITS path object. | |
Static Public Member Functions | |
| void | LoggingOn () |
| Enable logging for all DcppTask objects. | |
| void | LoggingOff () |
| Disable logging for all tasks. | |
| DcppHandlerRet | DiscardResponse (DcppVoidPnt ClientData, StatusType *status) |
| Flag argument success handler indicating reponses are to be ignored. | |
| void | HandleDisconnected (const char *task, DitsPathType path, StatusType *status) |
| Handle task disconnection. | |
|
||||||||||||||||
|
Normal constructor. Allows the the task name, location and file to be set
|
|
|
Path to self constructor. Constructor a DcppTask object which can be used to send messages to the invoking task itself.
|
|
|
Destructor.
|
|
|
Indicate if a task is active.
|
|
|
Returns true if we can't send a message because path is busy. You can't send a message along a path whilst the getting a path on it or whilst a Notify operation is current.
|
|
|
Clear the task state. This function clears the state of the DcppTask object, such that it will will presume is has just been constructed. |
|
||||||||||||||||||||||||||||||||||||
|
Send a DRAMA Control message to the task. This sends a DRAMA control message to the task referred to by this object. We must already have path to the task. If this function returns DcppReschedule, then messages are expected and should be dispatched using DcppDispatch() when they arrive. This will ensure that future processing occurs correctly and the the appropriate handler is invoked when the operation completes.
|
|
||||||||||||
|
Delete the task. Tell IMP to delete the task.
|
|
|
Note that a task has died.
|
|
||||||||||||
|
Flag argument success handler indicating reponses are to be ignored. If this function is specified as a SuccessHandler to any of the functions which send messages to tasks (other then DcppTask::GetPath) then the target task is told not to return any reponses to that message.
|
|
||||||||||||||||||||||||||||
|
Send a DRAMA message to the task to get the value of a parameter. This is the basic method for sending an GET message to the task referred to by this object - to return the value of a single parameter. We must already have path to the task. If this function returns DcppReschedule, then messages are expected and should be dispatched using DcppDispatch() when they arrive. This will ensure that future processing occurs correctly and the the appropriate handler is invoked when the operation completes.
|
|
|
Fetch the load argument. returns A const pointer to the load argument previously specified. |
|
||||||||||||
|
Return the underlying DITS path object. This method returns the underlying DITS path object being used by the DcppTask object. If it is not yet active then status will be set to DCPP__INVSTATE
|
|
||||||||||||||||||||
|
Get a path to/load a the task. This call initiates getting a path to the task. If the task is not running, it will be loaded if a sufficent information has been specified. If this function returns DcppReschedule, then messages are expected and should be dispatched using DcppDispatch() when they arrive. This will ensure that future processing occurs correctly and the the appropaite handler is invoked when the operation completes.
|
|
|
Indicate if a the task was loaded. returns True if the task we are talking too was loaded. |
|
||||||||||||||||
|
Handle task disconnection. Used internally only. |
|
||||||||||||
|
Function used by DcppDispatch in dispatching to handlers.
|
|
|
Return true if a GetPath operation is required.
|
|
|
Return true if a previously active task has disconnected.
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Send a DRAMA bulk data Kick message to the task. This method is used for sending an KICK message with a bulk data argument to the task referred to by this object. We must already have path to the task. If this function returns DcppReschedule, then messages are expected and should be dispatched using DcppDispatch() when they arrive. This will ensure that future processing occurs correctly and the the appropriate handler is invoked when the operation completes.
|
|
||||||||||||||||||||||||||||||||||||
|
Send a DRAMA Kick message to the task. This is the basic method for sending a KICK message to the task referred to by this object. We must already have path to the task. If this function returns DcppReschedule, then messages are expected and should be dispatched using DcppDispatch() when they arrive. This will ensure that future processing occurs correctly and the the appropriate handler is invoked when the operation completes.
|
|
||||||||||||||||||||||||||||||||||||
|
Send a DRAMA OKick message to the task, forgetting the transaction. This a method for sending an KICK message to the task referred to by this object, but immediately orphaning the resulting transaction. We must already have path to the task. If all handlers are null (0) then the transaction is completely orphaned and will not be handled by DcppDispatch(). If the success handler is set to "DcppTask::DiscardResponse" then the other handlers are ignored and reponses are not even sent back to this task at all. Otherwise, the various handlers will be invoked if DcppDispatch() is invoked by an orphan handler in response to reply message from this message.
|
|
|
Fetch the task location. Returns the name of the node on which the task is running (unless it was already known locally when DcppTask::GetPath was running, in which case we don't know where it is, but the value specified to the constructor is returns) returns A const pointer to the node name. |
|
|
Disable logging for all tasks. Turn logging for all tasks off. Logging is now determined by the object specific log flag |
|
|
Enable logging for all DcppTask objects. This static method can be used to enable logging for all DcppTask objects, ignoring the object specific log flag |
|
|
Load use. MsgOut()a lines indicating the load operations If set true, this flag causes MsgOut()messages to be output around the load operations, if they occur.
|
|
|
Lose the path and then set as if the task has died. This will send a full DRAMA DitsPathGet()operation will be done by the next DcppTask::GetPath operation. After doing this, you can no longer sends messages to the specified task.
|
|
||||||||||||||||||||||||||||||||
|
Send a DRAMA message to the task to get the value of multiple parameters. This is the a method for sending an MGET message to the task referred to by this object - to return the value of a multiple parameters. We must already have path to the task. This version supports explict handling of any Ers messages. If this function returns DcppReschedule, then messages are expected and should be dispatched using DcppDispatch() when they arrive. This will ensure that future processing occurs correctly and the the appropriate handler is invoked when the operation completes.
|
|
||||||||||||||||||||||||||||
|
Send a DRAMA message to the task to get the value of multiple parameters. This a method for sending an MGET message to the task referred to by this object - to return the value of a multiple parameters. We must already have path to the task. If this function returns DcppReschedule, then messages are expected and should be dispatched using DcppDispatch() when they arrive. This will ensure that future processing occurs correctly and the the appropriate handler is invoked when the operation completes.
|
|
||||||||||||||||||||||||||||||||||||||||
|
Send a DRAMA Monitor message to the task. This methods sendis a DRAMA Monitor message to the task referred to by this object. We must already have path to the task. If this function returns DcppReschedule, then messages are expected and should be dispatched using DcppDispatch() when they arrive. This will ensure that future processing occurs correctly and the the appropriate handler is invoked when the operation completes. You should note that normally the DcppMonitor:: class is used to run monitor transactions. It uses this method to start the monitors.
|
|
||||||||||||||||||||||||||||||||||||||||
|
Send a DRAMA Monitor message to the task, forgetting the transaction. This a method for sending an Monitor message to the task referred to by this object, but immediately orphaning the resulting transaction. We must already have path to the task. If all handlers are null (0) then the transaction is completely orphaned and will not be handled by DcppDispatch(). If the success handler is set to "DcppTask::DiscardResponse" then the other handlers are ignored and reponses are not even sent back to this task at all. Otherwise, the various handlers will be invoked if DcppDispatch() is invoked by an orphan handler in response to reply message from this message.
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Send a DRAMA Obey bulk data message to the task. This method is used for sending an OBEY message with a bulk data argument to the task referred to by this object. We must already have path to the task. This version returns the transaction id in a SDS structure set up ready for sending with a Kick message. (It is set up by DcppSpawnKickArgUpdate()). If this function returns DcppReschedule, then messages are expected and should be dispatched using DcppDispatch() when they arrive. This will ensure that future processing occurs correctly and the the appropriate handler is invoked when the operation completes.
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Send a DRAMA Obey bulk data message to the task. This method is used for sending an OBEY message with a bulk data argument to the task referred to by this object. We must already have path to the task. This version returns the transaction id in a SDS structure set up ready for sending with a Kick message. (It is set up by DcppSpawnKickArg()). If this function returns DcppReschedule, then messages are expected and should be dispatched using DcppDispatch() when they arrive. This will ensure that future processing occurs correctly and the the appropriate handler is invoked when the operation completes.
|