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

Detailed Description

A class implementing Monitor which invokes particular methods for parameters of given base types.

Methods are provided for each of basic SDS type - signed integers, unsigned integers, real and string.

Any other parameter type (including structured items and array types (other then strings) result in ComplexParamChanged() being invoked.

For each of these, the provided implementation will throw an exception. The user should sub-class this class and implement their own methods for each parameter type they are expecting.

If a sub-class implements the string value method, but not methods for integers, unsigned integers or real numbers, then the number will be converted to a string and passed to the string method.

Inherits the Monitor class constructors.

Author
Tony Farrell, AAO $Revision$ $Date$
Examples
monitor2.cpp.

#include "threadmonitor.hh"

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

Public Member Functions

virtual ~MonitorByType ()
 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.
 
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 ParamChanged (const std::string &name, const sds::IdPtr &value)
 Method invoked when the value of complex parameter has been changed.
 
virtual void ParamChanged (const std::string &name, const std::string &value)
 Method invoked when the value of a string type parameter has been changed.
 
virtual void ParamChanged (const std::string &name, double value)
 Method invoked when the value of a real type parameter has been changed.
 
virtual void ParamChanged (const std::string &name, long value)
 Method invoked when the value of a signed integer type parameter has been changed.
 
virtual void ParamChanged (const std::string &name, unsigned long value)
 Method invoked when the value of an unsigned integer type parameter has been changed.
 
virtual void ParameterChanged (const sds::IdPtr &arg) override final
 Method invoked when a parameter is changed.
 

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