ros2_canopen  master
C++ ROS CANopen Library
Public Member Functions | List of all members
ros2_canopen::DiagnosticsCollector Class Reference

A class to collect diagnostic information. More...

#include <diagnostic_collector.hpp>

Public Member Functions

 DiagnosticsCollector ()
 
unsigned char getLevel () const
 Get the Level Returns the current level (OK, WARN, ERROR or STALE) of the diagnostic. More...
 
std::string getMessage () const
 Get the Message object Returns the current message of the diagnostic. More...
 
std::string getValue (const std::string &key) const
 Get the Value object Returns the current different device state values of the diagnostic. More...
 
void summary (unsigned char lvl, const std::string &message)
 Store current device summary. More...
 
void summaryf (unsigned char lvl, const char *format,...)
 Store current device summary. More...
 
void add (const std::string &key, const std::string &value)
 Add a device state value. More...
 
void addf (const std::string &key, const char *format,...)
 Add a device state value. More...
 
void updateAll (unsigned char lvl, const std::string &message, const std::string &key, const std::string &value)
 Update all diagnostic information. More...
 

Detailed Description

A class to collect diagnostic information.

Constructor & Destructor Documentation

◆ DiagnosticsCollector()

ros2_canopen::DiagnosticsCollector::DiagnosticsCollector ( )
inline

Member Function Documentation

◆ getLevel()

unsigned char ros2_canopen::DiagnosticsCollector::getLevel ( ) const
inline

Get the Level Returns the current level (OK, WARN, ERROR or STALE) of the diagnostic.

Returns
unsigned char

◆ getMessage()

std::string ros2_canopen::DiagnosticsCollector::getMessage ( ) const
inline

Get the Message object Returns the current message of the diagnostic.

Returns
std::string

◆ getValue()

std::string ros2_canopen::DiagnosticsCollector::getValue ( const std::string &  key) const
inline

Get the Value object Returns the current different device state values of the diagnostic.

Parameters
keySearch device state by key. Eg. "DEVICE", "NMT", "EMCY", "cia402_state", "cia402_mode" etc.
Returns
std::string

◆ summary()

void ros2_canopen::DiagnosticsCollector::summary ( unsigned char  lvl,
const std::string &  message 
)
inline

Store current device summary.

Parameters
lvlOperation level (OK, WARN, ERROR or STALE)
messageDevice summary message

◆ summaryf()

void ros2_canopen::DiagnosticsCollector::summaryf ( unsigned char  lvl,
const char *  format,
  ... 
)
inline

Store current device summary.

Parameters
lvlOperation level (OK, WARN, ERROR or STALE)
formatDevice summary message format
...

◆ add()

void ros2_canopen::DiagnosticsCollector::add ( const std::string &  key,
const std::string &  value 
)
inline

Add a device state value.

Parameters
keyDevice state key. Eg. "DEVICE", "NMT", "EMCY", "cia402_state", "cia402_mode" etc.
valueCurrent device state value

◆ addf()

void ros2_canopen::DiagnosticsCollector::addf ( const std::string &  key,
const char *  format,
  ... 
)
inline

Add a device state value.

Parameters
keyDevice state key. Eg. "DEVICE", "NMT", "EMCY", "cia402_state", "cia402_mode" etc.
formatCurrent device state value format
...

◆ updateAll()

void ros2_canopen::DiagnosticsCollector::updateAll ( unsigned char  lvl,
const std::string &  message,
const std::string &  key,
const std::string &  value 
)
inline

Update all diagnostic information.

Parameters
lvlOperation level (OK, WARN, ERROR or STALE)
messageDevice summary message
keyDevice state key. Eg. "DEVICE", "NMT", "EMCY", "cia402_state", "cia402_mode" etc.
valueCurrent device state value

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