Template Class GenericFunctionDiagnosticTask

Inheritance Relationships

Base Type

Class Documentation

template<class T>
class GenericFunctionDiagnosticTask : public diagnostic_updater::DiagnosticTask

a DiagnosticTask based on a std::function.

The GenericFunctionDiagnosticTask calls the function when it updates. The function updates the DiagnosticStatusWrapper and collects data.

This is useful for gathering information about a device or driver, like temperature, calibration, etc.

Public Functions

inline GenericFunctionDiagnosticTask(const std::string &name, std::function<void(T&)> fn)

Constructs a GenericFunctionDiagnosticTask based on the given name and function.

Parameters:
  • name – Name of the function.

  • fn – Function to be called when DiagnosticTask::run is called.

inline virtual void run(DiagnosticStatusWrapper &stat)

Fills out this Task’s DiagnosticStatusWrapper.