Internal use only. More...
#include <diagnostic_updater.h>
Classes | |
class | DiagnosticTaskInternal |
Class used to represent a diagnostic task internally in DiagnosticTaskVector. More... | |
Public Member Functions | |
void | add (const std::string &name, TaskFunction f) |
Add a DiagnosticTask embodied by a name and function to the DiagnosticTaskVector. More... | |
void | add (DiagnosticTask &task) |
Add a DiagnosticTask to the DiagnosticTaskVector. More... | |
template<class T > | |
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. More... | |
bool | removeByName (const std::string name) |
Remove a task based on its name. More... | |
Protected Member Functions | |
void | addInternal (DiagnosticTaskInternal &task) |
const std::vector< DiagnosticTaskInternal > & | getTasks () |
Returns the vector of tasks. More... | |
Protected Attributes | |
boost::mutex | lock_ |
Private Member Functions | |
virtual void | addedTaskCallback (DiagnosticTaskInternal &) |
Private Attributes | |
std::vector< DiagnosticTaskInternal > | tasks_ |
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.
Definition at line 204 of file diagnostic_updater.h.
|
inline |
Add a DiagnosticTask embodied by a name and function to the DiagnosticTaskVector.
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. |
Definition at line 257 of file diagnostic_updater.h.
|
inline |
Add a DiagnosticTask to the DiagnosticTaskVector.
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. |
Definition at line 271 of file diagnostic_updater.h.
|
inline |
Add a DiagnosticTask embodied by a name and method to the DiagnosticTaskVector.
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. |
Definition at line 291 of file diagnostic_updater.h.
|
inlineprivatevirtual |
Allows an action to be taken when a task is added. The Updater class uses this to immediately publish a diagnostic that says that the node is loading.
Reimplemented in diagnostic_updater::Updater.
Definition at line 332 of file diagnostic_updater.h.
|
inlineprotected |
Common code for all add methods.
Definition at line 340 of file diagnostic_updater.h.
|
inlineprotected |
Returns the vector of tasks.
Definition at line 239 of file diagnostic_updater.h.
|
inline |
Remove a task based on its name.
Removes the first task that matches the specified name. (New in version 1.1.2)
name | Name of the task to remove. |
Definition at line 309 of file diagnostic_updater.h.
|
protected |
Definition at line 234 of file diagnostic_updater.h.
|
private |
Definition at line 334 of file diagnostic_updater.h.