AAO DRAMA/DRAMA2 C++ Interface
gitpathtest.cpp
/* G I T P A T H T E S T
* Module name:
gitpathtest.cpp
* Function:
DRAMA 2 GIT Path test.
* Description:
Test drama::git::Path interface.
* Language:
C++
* Copyright (c) Australian Astronomical Observatory, 2014.
Not to be used for commercial purposes without permission.
No warranty of any form unless subject to a specific agreement.
* Support: Tony Farrell, AAO
* "@(#) $Id: ACMM:Drama2/examples/gitpathtest.cpp,v 1.45+ 22-Feb-2016 14:09:53+11 tjf $"
*/
static const char *rcsId="@(#) $Id: ACMM:Drama2/examples/gitpathtest.cpp,v 1.45+ 22-Feb-2016 14:09:53+11 tjf $";
static void *use_rcsId = (0 ? (void *)(&use_rcsId) : (void *) &rcsId);
#include "drama.hh"
#include "drama/gitpath.hh"
class GitPathTest;
class InitAction : public drama::thread::TAction {
public:
InitAction(GitPathTest *theTask);
~InitAction() {}
private:
void ActionThread(const drama::sds::Id & /*obeyArg*/) override;
};
class ExitAction : public drama::thread::TAction {
public:
ExitAction(GitPathTest *theTask);
~ExitAction() {}
private:
void ActionThread(const drama::sds::Id & /*obeyArg*/) override;
};
class PollAction : public drama::thread::TAction {
public:
PollAction(GitPathTest *theTask);
~PollAction() {}
private:
void ActionThread(const drama::sds::Id & /*obeyArg*/) override;
};
class PollKickAction : public drama::thread::TAction {
public:
PollKickAction(GitPathTest *theTask);
~PollKickAction() {}
private:
void ActionThread(const drama::sds::Id & /*obeyArg*/) override;
};
class ReportAction : public drama::thread::TAction {
public:
ReportAction(GitPathTest *theTask);
~ReportAction() {}
private:
void ActionThread(const drama::sds::Id & /*obeyArg*/) override;
};
class GitPathTest : public drama::Task {
private:
InitAction InitActionObj;
ExitAction ExitActionObj;
PollAction PollActionObj;
PollKickAction PollKickActionObj;
ReportAction ReportActionObj;
public:
drama::git::Path & SubTask() {
return subTask;
}
GitPathTest() : drama::Task("GITPATHTEST"),
InitActionObj(this),
ExitActionObj(this),
PollActionObj(this),
PollKickActionObj(this),
ReportActionObj(this),
subTask(TaskPtr(),"GITTASKTEST", "", "./gittasktest") {
Add("INITIALISE",
Add("EXIT",
Add("POLL",
Add("POLLKICK",
drama::MessageHandlerPtr(&PollKickActionObj, drama::nodel()));
Add("REPORT",
drama::MessageHandlerPtr(&ReportActionObj, drama::nodel()));
}
~GitPathTest() {
}
};
int main()
{
drama::CreateRunDramaTask<GitPathTest>();
return 0;
}
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* InitAction class implementation.
*/
void InitAction::ActionThread(const drama::sds::Id & /*obeyArg*/)
{
auto myTask(GetTask()->TaskPtrAs<GitPathTest>());
myTask->SubTask().SetSimulation("FULL");
myTask->SubTask().Initialise(this);
}
InitAction::InitAction(GitPathTest *theTask) :
drama::thread::TAction(theTask->TaskPtr())
{
}
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* ExitAction class implementation.
*/
void ExitAction::ActionThread(const drama::sds::Id & /*obeyArg*/)
{
auto myTask(GetTask()->TaskPtrAs<GitPathTest>());
SetExitOnCompletion(); // Task will exit when action completes.
myTask->SubTask().Exit(this);
}
ExitAction::ExitAction(GitPathTest *theTask) :
drama::thread::TAction(theTask->TaskPtr())
{
}
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* PollAction class implementation.
*/
void PollAction::ActionThread(const drama::sds::Id & /*obeyArg*/)
{
auto myTask(GetTask()->TaskPtrAs<GitPathTest>());
myTask->SubTask().Poll(this);
}
PollAction::PollAction(GitPathTest *theTask) :
drama::thread::TAction(theTask->TaskPtr())
{
}
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* PollKickAction class implementation.
*/
void PollKickAction::ActionThread(const drama::sds::Id & /*obeyArg*/)
{
auto myTask(GetTask()->TaskPtrAs<GitPathTest>());
myTask->SubTask().PollCancel(this);
}
PollKickAction::PollKickAction(GitPathTest *theTask) :
drama::thread::TAction(theTask->TaskPtr())
{
}
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* ReportAction class implementation.
*/
void ReportAction::ActionThread(const drama::sds::Id & /*obeyArg*/)
{
auto myTask(GetTask()->TaskPtrAs<GitPathTest>());
myTask->SubTask().Report(this);
}
ReportAction::ReportAction(GitPathTest *theTask) :
drama::thread::TAction(theTask->TaskPtr())
{
}

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 15:57:52 for AAO DRAMA/DRAMA2 C++ Interface by doxygen 1.8.10