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. | |
void | add (DiagnosticTask &task) |
Add a DiagnosticTask to the DiagnosticTaskVector. | |
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. | |
bool | removeByName (const std::string name) |
Remove a task based on its name. | |
Protected Member Functions | |
void | addInternal (DiagnosticTaskInternal &task) |
const std::vector < DiagnosticTaskInternal > & | getTasks () |
Returns the vector of tasks. | |
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 203 of file diagnostic_updater.h.
void diagnostic_updater::DiagnosticTaskVector::add | ( | const std::string & | name, |
TaskFunction | f | ||
) | [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 256 of file diagnostic_updater.h.
void diagnostic_updater::DiagnosticTaskVector::add | ( | DiagnosticTask & | task | ) | [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 270 of file diagnostic_updater.h.
void diagnostic_updater::DiagnosticTaskVector::add | ( | const std::string | name, |
T * | c, | ||
void(T::*)(diagnostic_updater::DiagnosticStatusWrapper &) | f | ||
) | [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 290 of file diagnostic_updater.h.
virtual void diagnostic_updater::DiagnosticTaskVector::addedTaskCallback | ( | DiagnosticTaskInternal & | ) | [inline, private, virtual] |
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 331 of file diagnostic_updater.h.
void diagnostic_updater::DiagnosticTaskVector::addInternal | ( | DiagnosticTaskInternal & | task | ) | [inline, protected] |
Common code for all add methods.
Definition at line 339 of file diagnostic_updater.h.
const std::vector<DiagnosticTaskInternal>& diagnostic_updater::DiagnosticTaskVector::getTasks | ( | ) | [inline, protected] |
Returns the vector of tasks.
Definition at line 238 of file diagnostic_updater.h.
bool diagnostic_updater::DiagnosticTaskVector::removeByName | ( | const std::string | name | ) | [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 308 of file diagnostic_updater.h.
boost::mutex diagnostic_updater::DiagnosticTaskVector::lock_ [protected] |
Definition at line 233 of file diagnostic_updater.h.
std::vector<DiagnosticTaskInternal> diagnostic_updater::DiagnosticTaskVector::tasks_ [private] |
Definition at line 333 of file diagnostic_updater.h.