DRAMA C++ Intro   Class Hierarchy   Alphabetical List of types   List of Classes   File List   Class Member Index   File Members Index   Related Pages  

Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
GitTask Class Reference

A class built on DcppTask which control AAO GIT Tasks. More...

#include <gittask.h>

Inheritance diagram for GitTask:
DcppTask

Public Types

enum  SelfPathType { SelfPath }
 Use to ensure the constructor knows it is constructing a self path. More...
 

Public Member Functions

 GitTask (const std::string &name, const std::string &node="", const std::string &file="")
 Construct a GitTask object. More...
 
 GitTask (SelfPathType)
 Path to self constructor. More...
 
virtual void SetSimulation (const std::string &value, const float TimeBase, const std::string &string, StatusType *status)
 Set simulation and timebase. More...
 
virtual void SetResetMode (GitResetType &mode, StatusType *status)
 Set the reset mode. More...
 
virtual DcppHandlerRet Initialise (StatusType *status, GitTaskResponseHandler *responseHandler=0, bool freeResponse=false)
 Perform the complete initialisation sequence for a GIT task. More...
 
virtual DcppHandlerRet Poll (StatusType *status, GitTaskResponseHandler *responseHandler=0, bool freeResponse=false)
 Send POLL to the GIT task. More...
 
virtual DcppHandlerRet Exit (StatusType *status, GitTaskResponseHandler *responseHandler=0, bool freeResponse=false)
 Cause a GIT task to exit. More...
 
virtual void Report (StatusType *status)
 Dump details using MsgOut. More...
 
virtual int IsActive () const
 Returns true if the task is active (on active list) More...
 
virtual ~GitTask ()
 Destructor. More...
 
- Public Member Functions inherited from DcppTask
 DcppTask (const char *const name, const char *const location=0, const char *const file=0)
 Normal constructor. More...
 
 DcppTask (bool self)
 Path to self constructor. More...
 
 DcppTask (DitsPathType p)
 Constructor from existing path. More...
 
virtual ~DcppTask ()
 Destructor. More...
 
void TaskLoggingOn ()
 Turn logging on for this object. More...
 
void TaskLoggingOff ()
 Turn logging off for this object. More...
 
void Report (StatusType *status) const
 Dump details using MsgOut(). More...
 
bool GetPathLoaded () const
 Indicate if a the task was loaded. More...
 
const char * TaskName () const
 Fetch the task name. More...
 
const char * Location () const
 Fetch the task location. More...
 
const char * GetArgument () const
 Fetch the load argument. More...
 
virtual void SetName (const char *const TaskName)
 Set the task name. More...
 
virtual void SetLocation (const char *const Location)
 Set the task location. More...
 
virtual void SetFile (const char *const File)
 Set the executable file name. More...
 
virtual void SetBuffers (const DcppBuffers &Buffers)
 Set the DRAMA path buffers. More...
 
virtual void SetFlowControl ()
 Set the FLOW control flag. More...
 
virtual void SetProcess (const char *const ProcessName)
 Set the process names. More...
 
virtual void SetStackSize (unsigned bytes)
 Set the stack size for the load. More...
 
virtual void SetArgument (const char *const LoadArg, bool const Append=false)
 Set the load time argument string. More...
 
virtual void SetPriority (const int Priority, const bool Absolute=false)
 Set the load time priority for a task when loaded. More...
 
virtual void SetNames (const bool Flag=true)
 Insist that symbols known to IMP_Master be known to the task. More...
 
virtual void SetSymbols (const bool Flag=true)
 Interpert file name as a symbol (VMS Target only) More...
 
virtual void SetProg (const bool Flag=true)
 Interpert file name as a program name. More...
 
virtual void LogLoad (const bool Flag=true)
 Load use MsgOut() a lines indicating the load operations. More...
 
virtual void ClearState ()
 Clear the task state. More...
 
virtual bool Active () const
 Indicate if a task is active. More...
 
virtual bool IsDead () const
 Return true if a previously active task has disconnected. More...
 
virtual bool Initial () const
 Return true if a GetPath operation is required. More...
 
virtual bool Busy () const
 Returns true if we can't send a message because path is busy. More...
 
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. More...
 
virtual void GetPathImmed (StatusType *const status)
 Get a path to a task if DITS already has it. More...
 
virtual void Died ()
 Note that a task has died. More...
 
virtual void LosePath (StatusType *const status)
 Lose the path and then set as if the task has died. More...
 
virtual void Delete (int force, StatusType *status)
 Delete the task. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual DisconHandlerPutDisconnectHandler (DisconHandler *p)
 Add a new disconnect handler for this task. More...
 
DcppHandlerRet HandleMessage (DcppTransaction *transaction, StatusType *status)
 Function used by DcppDispatch in dispatching to handlers. More...
 
virtual void GetDitsPath (DitsPathType *path, StatusType *status)
 Return the underlying DITS path object. More...
 

Protected Member Functions

virtual DcppHandlerRet SendSimulate (StatusType *status)
 Obey the SIMULATE_LEVEL action to the task. More...
 
virtual DcppHandlerRet GetVersionInfo (StatusType *status)
 Send the parameter get message which fetchs the version details. More...
 
virtual DcppHandlerRet GetInitialisedPar (StatusType *status)
 Send the parameter get message which fetchs the INITIALISED parameter. More...
 
virtual DcppHandlerRet HandleVerComp (StatusType *status)
 Continue on after fetch version information. More...
 
virtual DcppHandlerRet HandleInitParGetComp (bool initialised, StatusType *status)
 Continue on after fetching the INITIALISED parameter value. More...
 
virtual DcppHandlerRet SendInitialise (StatusType *status)
 Actually send the initialise. More...
 
virtual DcppHandlerRet NoNetOnRemote (StatusType *status)
 Invoked when the get path operation finds that there is no network on the remote node. More...
 
virtual void SetInfo (const Arg &info, StatusType *status)
 Set the version information for the sub-tasks. More...
 
virtual void SetInitial (StatusType *status)
 Set task to its Initial state. More...
 
virtual void SetPathWait (StatusType *status)
 Indicate we are waiting for a path to the task. More...
 
virtual void SetInitialising (StatusType *status)
 Indicate we are Initialising the task. More...
 
virtual void SetResetting (StatusType *status)
 Indicate we are Restting the task. More...
 
virtual void SetIdle (StatusType *status)
 Indicate the task is idle. More...
 
virtual void SetExiting (StatusType *status)
 Indicate the task is exiting. More...
 
virtual void SetFailed ()
 Indicate an operation has failed. More...
 
virtual void SetDied ()
 Indicate the task has died. More...
 
virtual DcppHandlerRet RemoteNetStarted (StatusType *status)
 To be invoked when a REMOTE DRAMA network has started. More...
 
virtual DcppHandlerRet RemoteNetStartErr (StatusType *status)
 To be invoked when a REMOTE DRAMA network start has failed. More...
 
virtual bool RecoveryNeeded ()
 Returns true if recovery is needed. More...
 

Static Protected Member Functions

static DcppHandlerRet HandleSimSuccess (DcppVoidPnt ClientData, StatusType *status)
 To be invoked when the SIMULATE_LEVEL action completes ok. More...
 
static DcppHandlerRet HandleSimError (DcppVoidPnt ClientData, StatusType *status)
 To be invoked when the SIMULATE_LEVEL action fails. More...
 
static DcppHandlerRet HandleInitSuccess (DcppVoidPnt ClientData, StatusType *status)
 To be invoked when the INITIAISE/RESET action completes ok. More...
 
static DcppHandlerRet HandleInitError (DcppVoidPnt ClientData, StatusType *status)
 To be invoked when the INITIAISE/RESET action fails. More...
 

Protected Attributes

int pollDont
 If > PollRetry, don't poll. More...
 
bool pollCancelling
 Polling is being cancelled. More...
 
GitResetType resetMode
 Mode of reset. More...
 
std::string simulationLevel
 Simulate level. More...
 
std::string simulationArg
 Extra simulation level argument. More...
 
float timeBase
 Timebase for simulation. More...
 
bool havePath
 Set true when we have the path. More...
 
bool failed
 Task has failed in some way and should be reset on Initiailse() More...
 
bool amExiting
 Set true when the EXIT message is sent. More...
 
bool resetting
 Set true if we are resetting. More...
 
bool firstTime
 Set true for first init attempt. More...
 
std::string verDate
 From ENQ_VER_DATE parameter. More...
 
std::string verNum
 From ENQ_VER_NUM parameter. More...
 
std::string taskDescr
 From ENQ_DEV_DESCR parameter. More...
 

Static Protected Attributes

static const int PollRetry = 5
 How many times to try poll. More...
 

Friends

class GitTaskActiveList
 
class GitTaskActiveListIterator
 
class GitTaskKnownList
 
class GitTaskKnownListIterator
 

Additional Inherited Members

- Static Public Member Functions inherited from DcppTask
static void LoggingOn ()
 Enable logging for all DcppTask objects. More...
 
static void LoggingOff ()
 Disable logging for all tasks. More...
 
static DcppHandlerRet DiscardResponse (DcppVoidPnt ClientData, StatusType *status)
 Flag argument success handler indicating reponses are to be ignored. More...
 
static void HandleDisconnected (const char *task, DitsPathType path, StatusType *status)
 Handle task disconnection. More...
 

Detailed Description

A class built on DcppTask which control AAO GIT Tasks.

DcppTask intended to abstract the control of tasks which obey the GIT specification.

The basic concept is that much of the time, we will want to perform the same operation (say INITIALISE/RESET) on every task we control. This class can implement that operation using the underlying DcppTask primitives providing us with a simple interface.

Then all we need to do to perform such an action is to loop round a list of the tasks invoking the appropiate function for each task.

Now when a particular type of task needs to modify such an operation, it can sub-class GitTask. Thus the general parts of a control such as Initialisation, are presented with a standard interface, regardless of the types of tasks being controlled.

Each GitTask object may be put on one of two internally supported lists, classes for both of which are defined in the assocaited include file. An object of class GitTaskActiveList is used to maintain a list of the currently controlled tasks. GitTaskKnownList is used to maintain a list of all known task objects, whether currently controlled or not. Note that both these lists are special purpose lists that make use of data storage within the GitTask object type and thus each task can only be on one of each type of this list at a time (which is normally all the the program requires).

We also define an Iterator class for each list type.

 For each method which returns a DcppHandlerType, action rescheduling
 should be handled using DcppDispatch() (or via a DcppHandler object).

 Each of these such methods also take an optional address of an object
 of type GitTaskResponseHandler.  The CompleteOk() method of this
 object is invoked if the operation completes ok, whilst the 
 CompleteWithError()method is invoked if it completes in error.  The
 Triggered() method is invoked if a trigger message is received.  This
 object is only used if the call returned DcppReschedule.  If not 
 supplied, then a default version is used with does nothing but return 
 DcppFinished such that DcppDispatch()/ DcppHandler() know the action 
 is complete.

 An optional third argument, freeHandler, can be used to indicate the
 GitTaskResponseHandler object, if any, should be deleted using the
 delete operator after the CompleteOk/CompleteError method is invoked.

 If you want notifiction of completion, you should subclass 
 GitTaskResponseHandler appropiately.


 There are a set of functions called when the state of the
 task is seen to change.  These may be overriden as required, but the
 GitTask version should also be invoked.   Most take a status argument, 
 but SetFailed() and SetDied() need to work regardless so don't take a
 status argument.

Member Enumeration Documentation

Use to ensure the constructor knows it is constructing a self path.

This enum has one value, which is passed to the SelfPath constructor to ensure it

Constructor & Destructor Documentation

GitTask::GitTask ( const std::string &  name,
const std::string &  node = "",
const std::string &  file = "" 
)

Construct a GitTask object.

Allows the the task name, location and file to be set. Details are the same as the DcppTask:: standard constructor.

Parameters
nameThe name the task will be known as (unless loaded, when the name the task registers as will be used)
nodeThe node name on which the task is running or is to be loaded. Only used if not already running locally or known locally.
fileThe file of the task, as required by DitsLoad(). Normally a file name, but may be different depending on the location, e.g. on a VxWorks machine.
GitTask::GitTask ( SelfPathType  )
inline

Path to self constructor.

Constructor a GitTask object which can be used to send messages to the invoking task itself.

Note
It is unclear how usefull this constructor is, but it is provided for consistency with the equivalent DcppTask:: constructor.
Parameters
selfDistingishes this constructor from the other constructor. Value is ignored, just specify GitTask::SelfPath (an enumerated value) .

References SetInitial(), and GitResetType::SetRecover().

virtual GitTask::~GitTask ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual DcppHandlerRet GitTask::Exit ( StatusType *  status,
GitTaskResponseHandler responseHandler = 0,
bool  freeResponse = false 
)
virtual

Cause a GIT task to exit.

This method sends the EXIT action to the task

This function returns DcppReschedule if it sent a message. In that case, replies 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.

Note
This operation may return DcppFinished with status ok. This will occur if as a result of sub-classing no messages are sent.
If status is set bad on the call (as against during processing of responses, then the response handler is not invoked.
Parameters
statusInherited status
responseHandlerIf non-null, then this is the address of an object which is notified of the completion of the exit sequence. The GitTaskResponseHandler::CompleteOk method will be invoked on successfull completion of exit whilst GitTaskResponseHandler::CompleteWithError will be invoked if exit operation fails.
freeResponseIf set true, then the response handler is deleted just after the ok or error completion handler is invoked.
virtual DcppHandlerRet GitTask::GetInitialisedPar ( StatusType *  status)
protectedvirtual

Send the parameter get message which fetchs the INITIALISED parameter.

This method fetchs the parameter named INITIALISED from the task.

The default version sends a MGET message to the task to fetch the value of the INITIALISED parameter. parameters. It then returns DcppReschedule. On completion, it sets the values appropiately and invokes HandleInitParGetComp() to continue the operation. Inheritors which send the message themselves should also do this.

This call is only invoked the first time an attempt is made to initialise this task, any only if the task was not loaded.

Note
The default implementation does not consider it an error if the INITIALISED parameter is not available and does not report such a failure (since many older GIT tasks do not support this parameter).
Returns
DcppReschedule if a message was send, otherwise DcppFinished.
Parameters
statusInherited status
virtual DcppHandlerRet GitTask::GetVersionInfo ( StatusType *  status)
protectedvirtual

Send the parameter get message which fetchs the version details.

This method fetchs the task version details

The default version sends a MGET message to the task to fetch the value of the ENQ_VER_DATE, ENQ_VER_NUM and ENQ_VER_DESCR parameters. It then returns DcppReschedule. On completion, it sets the values appropiately and invokes HandleVerComp() to continue the operation. Inheritors which send the message themselves should also do this.

Note
The default implementation does not consider it an error if the version information is not available, through it does report the failure using ErsOut(), before invoking HandleVerComp().
Returns
DcppReschedule if a message was send, otherwise DcppFinished.
Parameters
statusInherited status
static DcppHandlerRet GitTask::HandleInitError ( DcppVoidPnt  ClientData,
StatusType *  status 
)
staticprotected

To be invoked when the INITIAISE/RESET action fails.

This function is a DcppTask callback which is invoked when the INITIALISE/RESET action completes with an error.

Note
Inheritors which wish to override this function should invoke the GitTask version from the overriding function to ensure the object state is set correctly and the error call back invoked.
Parameters
ClientDataPoints to the GitTask object.
statusInherited status.
virtual DcppHandlerRet GitTask::HandleInitParGetComp ( bool  initialised,
StatusType *  status 
)
protectedvirtual

Continue on after fetching the INITIALISED parameter value.

This function is used to continue after the value of the INITIALISED parameter is fetched. It is not normally overriden, but instead invoked by inheriting classes when they have completed the get operation. The returned value is returned to the caller.

Parameters
initalisedIndicates the task was already initialised.
statusInherited status
static DcppHandlerRet GitTask::HandleInitSuccess ( DcppVoidPnt  ClientData,
StatusType *  status 
)
staticprotected

To be invoked when the INITIAISE/RESET action completes ok.

This function is a DcppTask callback which is invoked when the INITIALISE/RESET action completes successfully.

Note
Inheritors which wish to override this function should invoke the GitTask version from the overriding function to ensure the object state is set correctly and the completion callback is invoked.
Parameters
ClientDataPoints to the GitTask object.
statusInherited status.
static DcppHandlerRet GitTask::HandleSimError ( DcppVoidPnt  ClientData,
StatusType *  status 
)
staticprotected

To be invoked when the SIMULATE_LEVEL action fails.

This function is a DcppTask callback which is invoked when the SIMULATE_LEVEL action completes with an error.

Note
Inheritors which wish to override this function should invoke the GitTask version from the overriding function to ensure the state is set correctly.
Parameters
ClientDataPoints to the GitTask object.
statusInherited status.
static DcppHandlerRet GitTask::HandleSimSuccess ( DcppVoidPnt  ClientData,
StatusType *  status 
)
staticprotected

To be invoked when the SIMULATE_LEVEL action completes ok.

This function is a DcppTask callback which is invoked when the SIMULATE_LEVEL action completes successfully.

Note
Inheritors which wish to override this function should invoke the GitTask version from the overriding function to send the INITIALISE action.
Parameters
ClientDataPoints to the GitTask object.
statusInherited status.
virtual DcppHandlerRet GitTask::HandleVerComp ( StatusType *  status)
protectedvirtual

Continue on after fetch version information.

This function is used to continue after the version details message is invoked. It is not normally overriden, but instead invoked by inheriting classes when they have completed the version get operation. The returned value is returned to the caller.

Parameters
statusInherited status
virtual DcppHandlerRet GitTask::Initialise ( StatusType *  status,
GitTaskResponseHandler responseHandler = 0,
bool  freeResponse = false 
)
virtual

Perform the complete initialisation sequence for a GIT task.

Initiate the sequence of operations required to Initialise/Reset a DRAMA task obeying the GIT spec. The sequence is as follows

  • DRAMA networking may be started if supported by a sub-class
  • The task is loaded if it is already running.
  • The path to the task is obtained.
  • The simulation level is set.
  • The task version numbers etc. are fetched.
  • The INITIALISE or RESET action is sent to the task.

This function returns DcppReschedule if it sent a message. In that case, replies 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.

Note
This operation may return DcppFinished with status ok. This will occur if as a result of sub-classing or as a result of the reset mode being Recover, no messages are sent.
If status is set bad on the call (as against during processing of responses, then the response handler is not invoked.
Parameters
statusInherited status
responseHandlerIf non-null, then this is the address of an object which is notified of the completion of the initialisation sequence. The GitTaskResponseHandler::CompleteOk method will be invoked on successfull completion of initialisation whilst GitTaskResponseHandler::CompleteWithError will be invoked if initialisation fails.
freeResponseIf set true, then the response handler is deleted just after the ok or error completion handler is invoked.
virtual int GitTask::IsActive ( ) const
inlinevirtual

Returns true if the task is active (on active list)

virtual DcppHandlerRet GitTask::NoNetOnRemote ( StatusType *  status)
inlineprotectedvirtual

Invoked when the get path operation finds that there is no network on the remote node.

Invoked if during a get path operation, it is discovered the DRAMA networking is not running on the remote node. By default, this does nothing and the get path operation will fail. But if an inheritor has some way of starting the remote DRAMA networking (say using the DRAMA Unix Start Server) then it should initiate that operation at this point and return DcppReschedule. It should then invoke either GitTask::RemoteNetStarted or GitTask::RemoteNetStartErr when it had ether started the networking or it has failed.

Parameters
statusInherited status

References DcppFinished.

virtual DcppHandlerRet GitTask::Poll ( StatusType *  status,
GitTaskResponseHandler responseHandler = 0,
bool  freeResponse = false 
)
virtual

Send POLL to the GIT task.

The POLL action is sent to the task.

This function returns DcppReschedule if it sent a message. In that case, replies 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.

Note
This operation may return DcppFinished with status ok. This will occur if as a result of sub-classing no messages are sent.
If status is set bad on the call (as against during processing of responses, then the response handler is not invoked.
Parameters
statusInherited status
responseHandlerIf non-null, then this is the address of an object which is notified of the completion of the poll action. The GitTaskResponseHandler::CompleteOk method will be invoked on successfull completion of polling whilst GitTaskResponseHandler::CompleteWithError will be invoked if polling fails. GitTaskResponseHandler::Triggered will be invoked each time a trigger message is received.
freeResponseIf set true, then the response handler is deleted just after the ok or error completion handler is invoked.
virtual bool GitTask::RecoveryNeeded ( )
protectedvirtual

Returns true if recovery is needed.

This function is invoked if GitTask is resetting the task and the reset mode is recover. In this case, this function should return true if a reset operation should be sent (argument to the RESET will be (RECOVER). Otherwise it should return false, and no RESET command will be sent to the task.

The default version of this function returns false all the time, such that we do not RESET tasks which we are already talking to, if the reset mode is RECOVER. An inheritor should consider the current state of the task.

virtual DcppHandlerRet GitTask::RemoteNetStarted ( StatusType *  status)
protectedvirtual

To be invoked when a REMOTE DRAMA network has started.

If an inheritor is trying to start a REMOTE DRAMA network, after overriding GitTask::NoNetOnRemote it must invoke this method to tell GitTask that the remote DRAMA network has been started and GitTask can now try again to load the task

Parameters
statusInherited status.
virtual DcppHandlerRet GitTask::RemoteNetStartErr ( StatusType *  status)
protectedvirtual

To be invoked when a REMOTE DRAMA network start has failed.

If an inheritor is trying to start a REMOTE DRAMA network after overriding GitTask::NoNetOnRemote, and that operation has failed, it must invoke this method to tell GitTask of the failure. The failure status should be available in DitsGetEntStatus()

Parameters
statusInherited status.
virtual void GitTask::Report ( StatusType *  status)
virtual

Dump details using MsgOut.

This call causes details of this object to be output using MsgOut(). (This adds the GIT task version details to the details normally output by the DcppTask::Report - hiding that function.)

virtual DcppHandlerRet GitTask::SendInitialise ( StatusType *  status)
protectedvirtual

Actually send the initialise.

Actually sends the INITIALISE/RESET action to the task.

If the task is being reset, then the default vesion sends the RESET action with an appropiate argument. Otherwise, it sends the INITIALISE action. A task is RESET if it was already running (it did not have to be loaded). If a inheritor sends the message itself, then it should invoke GitTask::HandleInitSuccess / GitTask::HandleInitError when the operation completes, with the object address as the client data item. This will ensure the chain continues. If an inheritor is not sending a message it can just return DcppFinished.

Parameters
statusInherited status
virtual DcppHandlerRet GitTask::SendSimulate ( StatusType *  status)
protectedvirtual

Obey the SIMULATE_LEVEL action to the task.

This method sends the SIMULATE_LEVEL action to the task.

The default version fetches the simulation string and timebase and sends these as parameters of a SIMULATE_LEVEL action. If a inheritor sends the message itself, then it should invoke GitTask::HandlerSimSuccess / GitTask::HandleSimError when the operation completes, with the object address as the client data item. This will ensure the chain continues. If an inheritor is not sending a message it can just return DcppFinished immediately.

Parameters
statusInherited status
virtual void GitTask::SetDied ( )
inlineprotectedvirtual

Indicate the task has died.

virtual void GitTask::SetExiting ( StatusType *  status)
inlineprotectedvirtual

Indicate the task is exiting.

Invoked when an exit has been invoked.

Parameters
statusInherited status
virtual void GitTask::SetFailed ( )
inlineprotectedvirtual

Indicate an operation has failed.

virtual void GitTask::SetIdle ( StatusType *  status)
inlineprotectedvirtual

Indicate the task is idle.

Invoke when Initialise/Reset has completed.

Parameters
statusInherited status
virtual void GitTask::SetInfo ( const Arg info,
StatusType *  status 
)
protectedvirtual

Set the version information for the sub-tasks.

Invoked when the task details from the ENQ_VER_NUM, ENQ_VER_DATE and ENQ_TASK_DESCR parameters has been fetch. The argument contains the relevant values, which are by default put into the verNum, verData and taskDescr variables.

Parameters
infoAn Arg (SDS) structure containing all the details.
statusInherited status
virtual void GitTask::SetInitial ( StatusType *  status)
inlineprotectedvirtual

Set task to its Initial state.

Invoked when GitTask does not know if has the a valid path to the task or if a GetPath operation has failed.

Parameters
statusInherited status

Referenced by GitTask().

virtual void GitTask::SetInitialising ( StatusType *  status)
inlineprotectedvirtual

Indicate we are Initialising the task.

Invoked when we start initialising a loaded task.

Parameters
statusInherited status
virtual void GitTask::SetPathWait ( StatusType *  status)
inlineprotectedvirtual

Indicate we are waiting for a path to the task.

Invoked while we are waiting for the path to the task.

Parameters
statusInherited status
virtual void GitTask::SetResetMode ( GitResetType mode,
StatusType *  status 
)
inlinevirtual

Set the reset mode.

This Should be done prior to calling GitTask::Initialise

Parameters
modeThe required reset mode.
statusInherited status
virtual void GitTask::SetResetting ( StatusType *  status)
inlineprotectedvirtual

Indicate we are Restting the task.

Invoked when we start the reset procedure.

Parameters
statusInherited status
virtual void GitTask::SetSimulation ( const std::string &  value,
const float  TimeBase,
const std::string &  string,
StatusType *  status 
)
virtual

Set simulation and timebase.

Set the simulation level and timebase values to be used when the SIMULATE_LEVEL action is sent to the task.

Parameters
valueThe simulation level, as accpeted by the target task, and normally as appropiate for the GIT spec, Normally one of NONE or FULL.
TimeBaseThe simulation time base. The meaning of this depends on the target target but it often means that any simulation runs this times faster then normal. Many GIT tasks ignore this value.
stringAn extra string which is stored in the simulationArg protected variable. It may or may not be used as an extra argument to the simulation level action, depending on how a sub-class is implemented. The default implementation does not use this value.
statusInherited status.

Member Data Documentation

bool GitTask::amExiting
protected

Set true when the EXIT message is sent.

bool GitTask::failed
protected

Task has failed in some way and should be reset on Initiailse()

bool GitTask::firstTime
protected

Set true for first init attempt.

bool GitTask::havePath
protected

Set true when we have the path.

bool GitTask::pollCancelling
protected

Polling is being cancelled.

int GitTask::pollDont
protected

If > PollRetry, don't poll.

const int GitTask::PollRetry = 5
staticprotected

How many times to try poll.

GitResetType GitTask::resetMode
protected

Mode of reset.

bool GitTask::resetting
protected

Set true if we are resetting.

std::string GitTask::simulationArg
protected

Extra simulation level argument.

std::string GitTask::simulationLevel
protected

Simulate level.

std::string GitTask::taskDescr
protected

From ENQ_DEV_DESCR parameter.

float GitTask::timeBase
protected

Timebase for simulation.

std::string GitTask::verDate
protected

From ENQ_VER_DATE parameter.

std::string GitTask::verNum
protected

From ENQ_VER_NUM parameter.


The documentation for this class was generated from the following file:

Click here for the DRAMA home page and here for the AAO home page.

For more information, contact tjf@aao.gov.au 

Generated on Mon Feb 22 2016 13:58:31 for AAO DRAMA C++ Interfaces by doxygen 1.8.10