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

Detailed Description

A class implementing Monitor which copies the value of a monitored parameter into one of the same name or a derived name in the current task.

If the name of the parameter in this task is NOT the same as the name of the parameter being monitored, the user should sub-class this class and override the Transform() method to transform the name as required.

Inherits the Monitor class constructors.

Author
Tony Farrell, AAO
Revision
1.45
Date
22-Feb-2016 14:09:57+11
Examples:
monitor1.cpp.

#include "threadmonitor.hh"

Inheritance diagram for drama::thread::MonitorToParam:
drama::thread::Monitor

Public Member Functions

virtual ~MonitorToParam ()
 Destructor. More...
 
virtual std::string Transform (const std::string &in)
 Transform method, default implementation. More...
 
- Public Member Functions inherited from drama::thread::Monitor
 Monitor (std::weak_ptr< Task > theTask, std::initializer_list< std::string > pars)
 Create a Monitor object. More...
 
 Monitor (const Monitor &source)=delete
 Copy constructor - deleted. More...
 
virtual ~Monitor ()
 Destructor. More...
 
void Cancel ()
 Cancel the monitor. More...
 
int GetMonitorId () const
 Return the monitor ID. More...
 
bool IsCancelling () const
 Indicate if the monitor is being canceled. More...
 
bool IsRunning () const
 Indicate if the monitor is running. More...
 
Monitoroperator= (const Monitor &rhs)=delete
 Assignment operator - deleted. More...
 
template<typename EventProcType = MonitorMessageHandler>
void Run (Path *thePath, thread::TMessHandler *action)
 Run a monitor operation - handler by type. More...
 
void Run (Path *thePath, thread::TMessHandler *action, MonitorMessageHandler *evtProcessor)
 Run a monitor operation - handler by address. More...
 

Protected Member Functions

virtual void ParameterChanged (const sds::IdPtr &arg) override final
 Method invoked when a parameter is changed. More...
 
- Protected Member Functions inherited from drama::thread::Monitor
virtual std::shared_ptr< TaskGetTask () const
 Get a reference to the task we are part of. More...
 

Constructor & Destructor Documentation

virtual drama::thread::MonitorToParam::~MonitorToParam ( )
virtual

Destructor.

Member Function Documentation

virtual void drama::thread::MonitorToParam::ParameterChanged ( const sds::IdPtr arg)
finaloverrideprotectedvirtual

Method invoked when a parameter is changed.

This method is invoked each time a parameter changes. This is the MonitorToParam class implementation of the abstract method in the Monitor class.

This method is not normally invoked by user code and this implement cannot be not overridden by sub-classes. If you want to override this, it is suggested you implement an alternative sub-class of Monitor.

Parameters
argA pointer to the SDS structure with the new parameter value.

Implements drama::thread::Monitor.

virtual std::string drama::thread::MonitorToParam::Transform ( const std::string &  in)
virtual

Transform method, default implementation.

This uses the name of the parameter being monitored to generate the name of the parameter in this task where its value is to be placed.

In this implementation, the parameter in this task has the same name as the parameter being monitored.

Parameters
inThe name of the parameter being monitored
Returns
The name of the parameter in this task.
Examples:
monitor1.cpp.

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