AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
Public Member Functions | Protected Member Functions | List of all members
drama::thread::Monitor Class Referenceabstract

Detailed Description

An abstract class which implements a DRAMA Parameter monitor in a thread.

The user can use an object implementing this class in an Action or UFace thread to monitor parameters in another task.

The constructor takes an initialiser list of the parameters to be monitored.

The user must implement the "ParameterChanged()" method to handle parameter changes.

The user must invoke the Run())method to run the monitor.

Monitors can be canceled if needed via the Cancel() method.

See also
Example monitor1.cpp
Example monitor2.cpp
Author
Tony Farrell, AAO $Revision$ $Date$

#include "threadmonitor.hh"

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

Public Member Functions

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

Protected Member Functions

virtual std::shared_ptr< TaskGetTask () const
 Get a reference to the task we are part of.
 
virtual void ParameterChanged (const sds::IdPtr &arg)=0
 Abstract method invoked when a parameter is changed.
 

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