AAO DRAMA/DRAMA2 C++ Interface
Public Member Functions | Protected Attributes | List of all members
drama::git::Task Class Reference

Detailed Description

Create a DRAMA task which obeys the GIT specification.

Provides default implementations of the INITIALISE, CTRLC, DUMP_LOG, EXIT, LOG_LEVEL, POLL, POLL_PARAMETER, RESET, SIMULATE_LEVEL, STATUS and UPDATE_NBD actions.

Implements the LOG_LEVEL, SIMULATE_LEVEL, TIME_BASE, ENQ_DEV_TYPE, ENQ_DEV_DESCR, ENQ_VER_NUM, ENQ_VER_DATE, ENQ_DEV_NUMITEM, INITIALISED and POLL_PARAMETER parameters.

Note - some of the above are well out of date, having been originally required for the AAO VAX/VMS ADAM systems, but their existence is maintained for compatibility reasons.

The default INTIALISE and RESET actions will open the logger and set the INITIALISED parameter to true.

The default SIMULATE_LEVEL parameter will accept the standard GIT Simulation levels and set the SIMULATE_LEVEL and TIMEBASE parameters.

The default LOG_LEVEL action is actually provided by drama::logging::Logger.

The default POLL action is currently very limited. To be expanded.

Other actions are null actions that return immediately.

See also
Example gittasktest.cpp
Author
Tony Farrell, AAO
Revision
1.45
Date
22-Feb-2016 14:09:57+11
Id
ACMM:Drama2/drama/gittask.hh,v 1.45 22-Feb-2016 14:09:57+11 tjf

#include "gittask.hh"

Inheritance diagram for drama::git::Task:
drama::Task

Public Member Functions

 Task (const std::string &taskName, const std::string &logSysName, const std::string &verNum, const std::string &verDate, const std::string &description, const std::string &taskType="IDT", const std::string &simVarName="", int simLevels=GIT_M_SIM_ALLLEVELS)
 Create a DRAMA task which implements the AAO GIT Specification. More...
 
virtual ~Task ()
 Destructor. More...
 
std::string GetLogSysName () const
 Return the logging system name provided to the constructor. More...
 
GitSimulationType GetSimulationLevel () const
 Returns the simulation level. More...
 
std::string GetSimulationStr ()
 Returns the simulation level as a string. More...
 
double GetSimulationTimeBase ()
 Returns the simulation timebase. More...
 
bool IsSimulating () const
 Returns true if the task is simulating. More...
 
- Public Member Functions inherited from drama::Task
 Task (const std::string &name, int buffer=DefBufSize, int flags=0, int selfBytes=DefSelfBufSize)
 Create a new DRAMA task of the specified name. More...
 
virtual void _MessageUser (const std::string &text) const
 Use DRAMA to send a message to the user. More...
 
virtual void Add (const std::string &name, MessageHandlerPtr obj)
 Add an action to the task. More...
 
virtual void Add (const std::string &name, MessageHandler *obj)
 Add an action to the task. More...
 
virtual void Add (const std::string &name, MessageReceiveFunction func)
 Add an action to the task. More...
 
void AddOrphanToQueue (const OrphanDetails &orphan)
 Add an orphan to the queue of orphans to be processed before we next look at the DRAMA message queue. More...
 
virtual void AddSpawnable (const std::string &name, SpawnablePtr obj)
 Add a spawnable action to the task. More...
 
virtual void AddSpawnable (const std::string &name, Spawnable *obj)
 Add an action to the task. More...
 
void CancelNotifyOnRunDramaExit (RunDramaExitNotifier *notifier)
 Cancel notification for when the DRAMA RunDrama() exits. More...
 
virtual double GetJoinTimeout () const
 Get the thread join timeout. More...
 
std::thread::id GetTaskThreadId () const
 Return the thread ID of the thread running RunDrama() More...
 
mutexTypeLock ()
 Reference the DRAMA Task lock. More...
 
logging::LoggerLogger ()
 Reference to DRAMA 2 Logger. More...
 
void NotifyOnRunDramaExit (RunDramaExitNotifier *notifier)
 Arrange notification for when the DRAMA RunDrama() exits. More...
 
virtual void RunDrama ()
 Run the DRAMA message loop in the current thread. More...
 
void Signal (const std::string &name, sds::Id *arg=nullptr, void *data=nullptr)
 Trigger the rescheduling of an action, specifing the name of the action. More...
 
void Signal (long int index, sds::Id *arg=nullptr, void *data=nullptr)
 Trigger the rescheduling of an action, specifying the index of the action. More...
 
std::string TaskName () const
 Return task name. More...
 
std::weak_ptr< TaskTaskPtr ()
 Returns a weak pointer to the task. More...
 
template<typename T >
std::shared_ptr< T > TaskPtrAs ()
 Returns a shared pointer to the task, dynamically case to the template type. More...
 

Protected Attributes

Parameter< std::string > _EnqDevDescr
 Object for accessing the ENQ_DEV_DESCR parameter. More...
 
Parameter< INT32 > _EnqDevNumItem
 Object for accessing the ENQ_DEV_NUM_ITEM parameter. More...
 
Parameter< std::string > _EnqDevType
 Object for accessing the ENQ_DEV_TYPE parameter. More...
 
Parameter< std::string > _EnqVerDate
 Object for accessing the ENQ_VER_DATE parameter. More...
 
Parameter< std::string > _EnqVerNum
 Object for accessing the ENQ_VER_NUM parameter. More...
 
Parameter< INT32 > _Initialised
 Object for accessing the INITIALISED parameter. More...
 
Parameter< float > _PollPar
 Object for accessing the POLL_PARAMETER parameter. More...
 
Parameter< std::string > _SimulateLevel
 Object for accessing the SIMULATE_LEVEL parameter. More...
 
Parameter< float > _TimeBase
 Object for accessing the TIME_BASE parameter. More...
 

Additional Inherited Members

- Public Types inherited from drama::Task
typedef std::lock_guard< mutexTypeguardType
 Defines the type of a lock guard using our mutex type. More...
 
typedef std::recursive_timed_mutex mutexType
 Defines the type of our mutex. More...
 
typedef std::unique_lock< mutexTypeuniqueLockType
 Defines the type of a unique_lock type using our mutex type. More...
 
- Static Public Attributes inherited from drama::Task
static const int DefBufSize =20000
 Default global buffer size. More...
 
static const int DefSelfBufSize =2000
 Default self buffer size. More...
 
- Protected Member Functions inherited from drama::Task
virtual void OrphanHandler (const OrphanDetails &details)
 Orphan transaction handler. More...
 

Constructor & Destructor Documentation

drama::git::Task::Task ( const std::string &  taskName,
const std::string &  logSysName,
const std::string &  verNum,
const std::string &  verDate,
const std::string &  description,
const std::string &  taskType = "IDT",
const std::string &  simVarName = "",
int  simLevels = GIT_M_SIM_ALLLEVELS 
)

Create a DRAMA task which implements the AAO GIT Specification.

Parameters
taskNameThe name for the task.
logSysNameLogging system name - used to access environment variables used in setting up logging. See drama::logging::Logger.
verNumThe task version number as a string. For AAO tasks, this is normally dervied from the ACMM Version number, e.g r1_4 for ACMM Version 1.4. AAO dmakefile's can use standard code to generate this. This value is placed in the ENQ_VER_NUM parameter.
verDateThe task build date. The AAO normally used the command "date +%d-%b-%Y" to generate this string and AAO dmakefile's can use standard code to generate this. This value value is placed in the ENQ_VER_DATE parameter.
descriptionA string to be placed in the GIT ENQ_DEV_DESCR parameter.
taskTypeA string to be placed in the GIT ENQ_DEV_TYPE parameter. See the GIT documentation for defined types.
simVarNameIF not empty, then this is the name of a environment variable which is used to determine the simulation level when the simulation not been set by the SIMULATE_LEVEL command or by setting the SIMULATE_LEVEL parameter
simLevelsA bit mask indicate the acceptable simulation levels. The possible values are GIT_M_SIM_BASIC, GIT_M_SIM_COMMANDS, GIT_M_SIM_STATUS. FULL simulation and NONE are always allowed. Set to GIT_M_SIM_ALLLEVELS to accept all values.
virtual drama::git::Task::~Task ( )
virtual

Destructor.

Reimplemented from drama::Task.

Member Function Documentation

std::string drama::git::Task::GetLogSysName ( ) const
inline

Return the logging system name provided to the constructor.

GitSimulationType drama::git::Task::GetSimulationLevel ( ) const

Returns the simulation level.

Returns
The simulation level.
std::string drama::git::Task::GetSimulationStr ( )

Returns the simulation level as a string.

Returns
The value of the SIMULATE_LEVEL parameter.
double drama::git::Task::GetSimulationTimeBase ( )

Returns the simulation timebase.

Returns
The simulation timebase.
bool drama::git::Task::IsSimulating ( ) const

Returns true if the task is simulating.

Returns
true if the task has been set to simulation, at any level.

Member Data Documentation

Parameter<std::string> drama::git::Task::_EnqDevDescr
protected

Object for accessing the ENQ_DEV_DESCR parameter.

Parameter<INT32> drama::git::Task::_EnqDevNumItem
protected

Object for accessing the ENQ_DEV_NUM_ITEM parameter.

Parameter<std::string> drama::git::Task::_EnqDevType
protected

Object for accessing the ENQ_DEV_TYPE parameter.

Parameter<std::string> drama::git::Task::_EnqVerDate
protected

Object for accessing the ENQ_VER_DATE parameter.

Parameter<std::string> drama::git::Task::_EnqVerNum
protected

Object for accessing the ENQ_VER_NUM parameter.

Parameter<INT32> drama::git::Task::_Initialised
protected

Object for accessing the INITIALISED parameter.

Parameter<float> drama::git::Task::_PollPar
protected

Object for accessing the POLL_PARAMETER parameter.

Parameter<std::string> drama::git::Task::_SimulateLevel
protected

Object for accessing the SIMULATE_LEVEL parameter.

Parameter<float> drama::git::Task::_TimeBase
protected

Object for accessing the TIME_BASE 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 15:57:53 for AAO DRAMA/DRAMA2 C++ Interface by doxygen 1.8.10