Template Class GenericFunctionDiagnosticTask
Defined in File diagnostic_updater.hpp
Inheritance Relationships
Base Type
public diagnostic_updater::DiagnosticTask
(Class DiagnosticTask)
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.
-
inline GenericFunctionDiagnosticTask(const std::string &name, std::function<void(T&)> fn)