Class DiagnosticTaskVector
Defined in File diagnostic_updater.hpp
Nested Relationships
Nested Types
Inheritance Relationships
Derived Type
public diagnostic_updater::Updater
(Class Updater)
Class Documentation
-
class DiagnosticTaskVector
Internal use only.
Base class for diagnostic_updater::Updater and self_test::Dispatcher. The class manages a collection of diagnostic updaters. It contains the common functionality used for producing diagnostic updates and for self-tests.
Subclassed by diagnostic_updater::Updater
Public Functions
-
inline virtual ~DiagnosticTaskVector()
-
inline void add(const std::string &name, TaskFunction f)
Add a DiagnosticTask embodied by a name and function to the DiagnosticTaskVector.
- Parameters:
name – Name to autofill in the DiagnosticStatusWrapper for this task.
f – Function to call to fill out the DiagnosticStatusWrapper. This function need not remain valid after the last time the tasks are called, and in particular it need not be valid at the time the DiagnosticTaskVector is destructed.
-
inline void add(DiagnosticTask &task)
Add a DiagnosticTask to the DiagnosticTaskVector.
- Parameters:
task – The DiagnosticTask to be added. It must remain live at least until the last time its diagnostic method is called. It need not be valid at the time the DiagnosticTaskVector is destructed.
-
template<class T>
inline void add(const std::string name, T *c, void (T::* f)(diagnostic_updater::DiagnosticStatusWrapper&)) Add a DiagnosticTask embodied by a name and method to the DiagnosticTaskVector.
- Parameters:
name – Name to autofill in the DiagnosticStatusWrapper for this task.
c – Class instance the method is being called on.
f – Method to call to fill out the DiagnosticStatusWrapper. This method need not remain valid after the last time the tasks are called, and in particular it need not be valid at the time the DiagnosticTaskVector is destructed.
-
inline bool removeByName(const std::string name)
Remove a task based on its name.
Removes the first task that matches the specified name. (New in version 1.1.2)
- Parameters:
name – Name of the task to remove.
- Returns:
Returns true if a task matched and was removed.
Protected Functions
-
inline const std::vector<DiagnosticTaskInternal> &getTasks()
Returns the vector of tasks.
-
inline void addInternal(DiagnosticTaskInternal &task)
Common code for all add methods.
Protected Attributes
-
std::mutex lock_
-
class DiagnosticTaskInternal
Class used to represent a diagnostic task internally in DiagnosticTaskVector.
Public Functions
-
inline DiagnosticTaskInternal(const std::string name, TaskFunction f)
-
inline void run(diagnostic_updater::DiagnosticStatusWrapper &stat) const
-
inline const std::string &getName() const
-
inline DiagnosticTaskInternal(const std::string name, TaskFunction f)
-
inline virtual ~DiagnosticTaskVector()