$search

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

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.
void add (DiagnosticTask &task)
 Add a DiagnosticTask to the DiagnosticTaskVector.
void add (const std::string &name, TaskFunction f)
 Add a DiagnosticTask embodied by a name and function 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

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

void diagnostic_updater::DiagnosticTaskVector::add ( DiagnosticTask task  )  [inline]

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.

Definition at line 270 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.

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.

Definition at line 256 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)

Parameters:
name Name 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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


diagnostic_updater
Author(s): Jeremy Leibs, Blaise Gassend
autogenerated on Wed Jan 30 11:30:36 2013