73#include "DitsMsgOut.h"
98 enum resetEnum { Soft=0, Full, Hard, Recover, Invalid };
101 static const char *
const lookupTable[];
104 const char *
const * Lookup() {
108 void SetValue(
const unsigned int i) {
112 value = (resetEnum)i;
115 operator int()
const {
116 return ((
int)(value));
137 const char *
const Name,
142 GitEnum::Get(Id, Name, Position, status,
"SOFT", Flags);
152 void Get(
const SdsId &Id,
153 const char *
const Name,
158 GitEnum::Get(Id, Name, Position, status,
"SOFT", Flags);
183 bool IsSoft()
const {
return (value == Soft); };
186 bool IsFull()
const {
return (value == Full); };
189 bool IsHard()
const {
return (value == Hard); };
199 operator const char*()
const {
200 return lookupTable[value];
258 StatusType *status) {
259 if (*status == STATUS__OK)
260 *status = DitsGetEntStatus();
301 deleteHandler(
false), handler(0), task(t) {}
482 virtual void DeActivate() {
688 if (*status != STATUS__OK)
return;
698 if (*status != STATUS__OK)
return;
707 if (*status != STATUS__OK)
return;
716 if (*status != STATUS__OK)
return;
726 if (*status != STATUS__OK)
return;
735 if (*status != STATUS__OK)
return;
887 const std::string &node =
"",
888 const std::string &file =
"");
907 initialiseResponse(this),
921 StatusType ignore = STATUS__OK;
946 const float TimeBase,
947 const std::string &
string,
959 StatusType *status) {
960 if (*status == STATUS__OK)
1007 bool freeResponse =
false);
1048 bool freeResponse =
false);
1085 bool freeResponse =
false);
1099 return (nextActive != 0);
1137 static GitTask *
const ListEnd;
1203 static GitTask *
const ListEnd;
1256 head = ptr = GitTaskActiveList::theList()->head; };
1264 p = (ptr != GitTaskActiveList::ListEnd)? ptr : 0;
1265 ptr = (ptr != GitTaskActiveList::ListEnd) ? ptr->nextActive : GitTaskActiveList::ListEnd;
1292 head = ptr = GitTaskKnownList::theList()->head; };
1301 p = (ptr != GitTaskKnownList::ListEnd)? ptr : 0;
1302 ptr = (ptr != GitTaskKnownList::ListEnd) ? ptr->nextKnown : GitTaskKnownList::ListEnd;
A C++ Interface to the SDS Arg library.
Definition arg.h:263
A Class which provides access to DRAMA's message sending facilities.
Definition dcpptask.h:132
void Get(const SdsId &Id, const char *const Name, const int Position, StatusType *status, const char *Default=0, const int Flags=Git::Upper|Git::Abbrev)
Get the value of the object from an SDS struture.
Definition Git.h:419
A class which reads Enumerated values from a SDS argument structures.
Definition Git.h:378
GitResetType()
Construct a reset type object, defaulting to a Soft reset.
Definition gittask.h:148
bool IsHard() const
Return true if the reset type is Hard.
Definition gittask.h:189
GitResetType(const SdsId &Id, const char *const Name, int Position, StatusType *status, const int Flags=Git::Upper|Git::Abbrev|Git::KeepErr)
Construct a GitReset type from an action argument.
Definition gittask.h:136
bool IsSoft() const
Return true if the reset type if Soft.
Definition gittask.h:183
bool IsRecover() const
Return true if the reset type is Hard.
Definition gittask.h:192
bool IsInvalid() const
Return true if there is no valid reset type.
Definition gittask.h:195
void SetHard()
Set the reset type to Hard.
Definition gittask.h:173
bool IsFull() const
Return true if the rest type if Full.
Definition gittask.h:186
void SetSoft()
Set the reset type to Soft.
Definition gittask.h:168
void SetRecover()
Set the reset type to Recover.
Definition gittask.h:163
void SetFull()
Set the reset type to Full.
Definition gittask.h:178
A class used to represent the type of RESET operation.
Definition gittask.h:95
void reset()
Reset the iterator to point to the head of the list again.
Definition gittask.h:1270
GitTask * operator()()
Return the next element on the list.
Definition gittask.h:1262
GitTaskActiveListIterator()
Construct a new iterator for the active task list.
Definition gittask.h:1255
An Iterator for the list of active tasks.
Definition gittask.h:1247
static void ReInit()
Reinitialise the list.
static void Insert(GitTask *t)
Put a task onto the active list.
Manage the list of active tasks.
Definition gittask.h:1132
GitTaskKnownListIterator()
Construct a new iterator for the known task list.
Definition gittask.h:1291
void reset()
Reset the iterator to point to the head of the list again.
Definition gittask.h:1307
GitTask * operator()()
Return the next element on the list.
Definition gittask.h:1299
An Iterator for the list of known tasks.
Definition gittask.h:1283
static void Insert(GitTask *t)
Put a task onto the known list.
A list of the currently known GIT tasks.
Definition gittask.h:1198
virtual DcppHandlerRet CompleteWithError(GitTask *, StatusType *status)
Method invoked on error completion.
Definition gittask.h:257
virtual DcppHandlerRet Triggered(GitTask *, StatusType *status)
Method invoked on reception of a trigger message.
Definition gittask.h:278
GitTaskResponseHandler()
Constructor.
Definition gittask.h:219
virtual DcppHandlerRet CompleteOk(GitTask *, StatusType *status)
Method invoked on successfull completion.
Definition gittask.h:235
virtual ~GitTaskResponseHandler()
Destructor.
Definition gittask.h:286
Base object used to handle reponses to the GitTask messages.
Definition gittask.h:215
virtual void SetIdle(StatusType *status)
Indicate the task is idle.
Definition gittask.h:725
virtual void SetDied()
Indicate the task has died.
Definition gittask.h:745
static DcppHandlerRet HandleSimSuccess(DcppVoidPnt ClientData, StatusType *status)
To be invoked when the SIMULATE_LEVEL action completes ok.
bool resetting
Set true if we are resetting.
Definition gittask.h:521
GitResetType resetMode
Mode of reset
Definition gittask.h:511
std::string simulationArg
Extra simulation level argument.
Definition gittask.h:513
virtual int IsActive() const
Returns true if the task is active (on active list)
Definition gittask.h:1098
std::string verDate
From ENQ_VER_DATE parameter.
Definition gittask.h:524
static DcppHandlerRet HandleInitSuccess(DcppVoidPnt ClientData, StatusType *status)
To be invoked when the INITIAISE/RESET action completes ok.
bool pollCancelling
Polling is being cancelled.
Definition gittask.h:510
virtual void Report(StatusType *status)
Dump details using MsgOut.
virtual DcppHandlerRet Initialise(StatusType *status, GitTaskResponseHandler *responseHandler=0, bool freeResponse=false)
Perform the complete initialisation sequence for a GIT task.
virtual void SetResetMode(GitResetType &mode, StatusType *status)
Set the reset mode.
Definition gittask.h:958
static DcppHandlerRet HandleSimError(DcppVoidPnt ClientData, StatusType *status)
To be invoked when the SIMULATE_LEVEL action fails.
std::string simulationLevel
Simulate level
Definition gittask.h:512
static DcppHandlerRet HandleInitError(DcppVoidPnt ClientData, StatusType *status)
To be invoked when the INITIAISE/RESET action fails.
virtual void SetFailed()
Indicate an operation has failed.
Definition gittask.h:740
SelfPathType
Use to ensure the constructor knows it is constructing a self path.
Definition gittask.h:870
virtual void SetResetting(StatusType *status)
Indicate we are Restting the task.
Definition gittask.h:715
std::string verNum
From ENQ_VER_NUM parameter.
Definition gittask.h:525
bool havePath
Set true when we have the path.
Definition gittask.h:516
virtual void SetExiting(StatusType *status)
Indicate the task is exiting.
Definition gittask.h:734
GitTask(SelfPathType)
Path to self constructor.
Definition gittask.h:903
GitTask(const std::string &name, const std::string &node="", const std::string &file="")
Construct a GitTask object.
virtual DcppHandlerRet RemoteNetStartErr(StatusType *status)
To be invoked when a REMOTE DRAMA network start has failed.
virtual ~GitTask()
Destructor.
Definition gittask.h:1104
virtual DcppHandlerRet HandleVerComp(StatusType *status)
Continue on after fetch version information.
virtual void SetPathWait(StatusType *status)
Indicate we are waiting for a path to the task.
Definition gittask.h:697
virtual DcppHandlerRet GetVersionInfo(StatusType *status)
Send the parameter get message which fetchs the version details.
virtual bool RecoveryNeeded()
Returns true if recovery is needed.
virtual DcppHandlerRet NoNetOnRemote(StatusType *status)
Invoked when the get path operation finds that there is no network on the remote node.
Definition gittask.h:660
virtual DcppHandlerRet HandleInitParGetComp(bool initialised, StatusType *status)
Continue on after fetching the INITIALISED parameter value.
virtual DcppHandlerRet RemoteNetStarted(StatusType *status)
To be invoked when a REMOTE DRAMA network has started.
std::string taskDescr
From ENQ_DEV_DESCR parameter.
Definition gittask.h:526
virtual void SetInfo(const Arg &info, StatusType *status)
Set the version information for the sub-tasks.
virtual DcppHandlerRet Exit(StatusType *status, GitTaskResponseHandler *responseHandler=0, bool freeResponse=false)
Cause a GIT task to exit.
bool amExiting
Set true when the EXIT message is sent.
Definition gittask.h:519
virtual DcppHandlerRet SendInitialise(StatusType *status)
Actually send the initialise
bool failed
Task has failed in some way and should be reset on Initiailse()
Definition gittask.h:517
static const int PollRetry
How many times to try poll.
Definition gittask.h:502
virtual void SetInitialising(StatusType *status)
Indicate we are Initialising the task.
Definition gittask.h:706
bool firstTime
Set true for first init attempt.
Definition gittask.h:522
virtual void SetInitial(StatusType *status)
Set task to its Initial state.
Definition gittask.h:687
virtual void SetSimulation(const std::string &value, const float TimeBase, const std::string &string, StatusType *status)
Set simulation and timebase
virtual DcppHandlerRet SendSimulate(StatusType *status)
Obey the SIMULATE_LEVEL action to the task.
virtual DcppHandlerRet Poll(StatusType *status, GitTaskResponseHandler *responseHandler=0, bool freeResponse=false)
Send POLL to the GIT task
float timeBase
Timebase for simulation
Definition gittask.h:514
int pollDont
If > PollRetry, don't poll.
Definition gittask.h:509
virtual DcppHandlerRet GetInitialisedPar(StatusType *status)
Send the parameter get message which fetchs the INITIALISED parameter.
A class built on DcppTask which control AAO GIT Tasks.
Definition gittask.h:398
@ Abbrev
Allow abbreviations
Definition Git.h:352
@ KeepErr
Keep error status on return
Definition Git.h:351
@ Upper
Convert strings to upper case.
Definition Git.h:349
A C++ Interface to the handling SDS structures.
Definition sds.h:761
void * DcppVoidPnt
A pointer to void
Definition dcpp.h:59
DcppHandlerRet
Type returns by various routines to indicate what is to happen next.
Definition dcpp.h:75
@ DcppFinished
Have finished, action can complete
Definition dcpp.h:77