Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
diagnostic_updater::DiagnosticTaskVector Class Reference

Internal use only. More...

#include <diagnostic_updater.h>

Inheritance diagram for diagnostic_updater::DiagnosticTaskVector:
Inheritance graph
[legend]

List of all members.

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_

Detailed Description

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.


Member Function Documentation

void diagnostic_updater::DiagnosticTaskVector::add ( const std::string &  name,
TaskFunction  f 
) [inline]

Add a DiagnosticTask embodied by a name and function to the DiagnosticTaskVector.

Parameters:
nameName to autofill in the DiagnosticStatusWrapper for this task.
fFunction 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.

Add a DiagnosticTask to the DiagnosticTaskVector.

Parameters:
taskThe 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.

template<class T >
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.

Parameters:
nameName to autofill in the DiagnosticStatusWrapper for this task.
cClass instance the method is being called on.
fMethod 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.

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.

Common code for all add methods.

Definition at line 339 of file diagnostic_updater.h.

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)

Parameters:
nameName of the task to remove.
Returns:
Returns true if a task matched and was removed.

Definition at line 308 of file diagnostic_updater.h.


Member Data Documentation

Definition at line 233 of file diagnostic_updater.h.

Definition at line 333 of file diagnostic_updater.h.


The documentation for this class was generated from the following file:


diagnostic_updater
Author(s): Jeremy Leibs, Blaise Gassend, Brice Rebsamen
autogenerated on Fri Jan 3 2014 11:18:57