Class DiagnosticsCollector

Class Documentation

class DiagnosticsCollector

A class to collect diagnostic information.

Public Functions

inline DiagnosticsCollector()
inline unsigned char getLevel() const

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

Returns:

unsigned char

inline std::string getMessage() const

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

Returns:

std::string

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

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

Parameters:

key – Search device state by key. Eg. “DEVICE”, “NMT”, “EMCY”, “cia402_state”, “cia402_mode” etc.

Returns:

std::string

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

Store current device summary.

Parameters:
  • lvl – Operation level (OK, WARN, ERROR or STALE)

  • message – Device summary message

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

Store current device summary.

Parameters:
  • lvl – Operation level (OK, WARN, ERROR or STALE)

  • format – Device summary message format

  • ...

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

Add a device state value.

Parameters:
  • key – Device state key. Eg. “DEVICE”, “NMT”, “EMCY”, “cia402_state”, “cia402_mode” etc.

  • value – Current device state value

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

Add a device state value.

Parameters:
  • key – Device state key. Eg. “DEVICE”, “NMT”, “EMCY”, “cia402_state”, “cia402_mode” etc.

  • format – Current device state value format

  • ...

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

Update all diagnostic information.

Parameters:
  • lvl – Operation level (OK, WARN, ERROR or STALE)

  • message – Device summary message

  • key – Device state key. Eg. “DEVICE”, “NMT”, “EMCY”, “cia402_state”, “cia402_mode” etc.

  • value – Current device state value