Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
diagnostic_updater::DiagnosticTaskVector Class Reference

Internal use only. More...

#include <diagnostic_updater.h>

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

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< DiagnosticTaskInternaltasks_
 

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 204 of file diagnostic_updater.h.

Member Function Documentation

◆ add() [1/3]

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 257 of file diagnostic_updater.h.

◆ add() [2/3]

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

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 271 of file diagnostic_updater.h.

◆ add() [3/3]

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 291 of file diagnostic_updater.h.

◆ addedTaskCallback()

virtual void diagnostic_updater::DiagnosticTaskVector::addedTaskCallback ( DiagnosticTaskInternal )
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.

◆ addInternal()

void diagnostic_updater::DiagnosticTaskVector::addInternal ( DiagnosticTaskInternal task)
inlineprotected

Common code for all add methods.

Definition at line 340 of file diagnostic_updater.h.

◆ getTasks()

const std::vector<DiagnosticTaskInternal>& diagnostic_updater::DiagnosticTaskVector::getTasks ( )
inlineprotected

Returns the vector of tasks.

Definition at line 239 of file diagnostic_updater.h.

◆ removeByName()

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 309 of file diagnostic_updater.h.

Member Data Documentation

◆ lock_

boost::mutex diagnostic_updater::DiagnosticTaskVector::lock_
protected

Definition at line 234 of file diagnostic_updater.h.

◆ tasks_

std::vector<DiagnosticTaskInternal> diagnostic_updater::DiagnosticTaskVector::tasks_
private

Definition at line 334 of file diagnostic_updater.h.


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


diagnostic_updater
Author(s): Kevin Watts, Brice Rebsamen , Jeremy Leibs, Blaise Gassend
autogenerated on Fri Oct 9 2020 03:35:21