Base module

IDiagnostic

Abstract interface for diagnostic information providers.

IDiagnostic

#include <icy/diagnosticmanager.h>

Inherits: Stateful< DiagnosticState > Subclassed by: AsyncDiagnostic

Abstract interface for diagnostic information providers.

Public Attributes

ReturnNameDescription
std::stringnameThe name of the diagnostic.
std::stringdescriptionThe diagnostic description.
std::vector< std::string >summaryThe diagnostic summary, maybe including troubleshooting information on failure.
ThreadSignal< void(const std::string &)>SummaryUpdatedSignals when a new text item is added to the summary.

name

std::string name

The name of the diagnostic.


description

std::string description

The diagnostic description.


summary

std::vector< std::string > summary

The diagnostic summary, maybe including troubleshooting information on failure.


SummaryUpdated

ThreadSignal< void(const std::string &)> SummaryUpdated

Signals when a new text item is added to the summary.

Public Methods

ReturnNameDescription
IDiagnostic
voidcheck virtualResets state to None and invokes run() to perform the diagnostic check.
voidreset virtualClears the summary and resets state to None.
boolcomplete virtual constReturns true if the diagnostic has reached a terminal state (Passed or Failed).
boolpassed virtual constReturns true if the diagnostic state is Passed.
boolfailed virtual constReturns true if the diagnostic state is Failed.

IDiagnostic

IDiagnostic()

check

virtual

virtual void check()

Resets state to None and invokes run() to perform the diagnostic check.


reset

virtual

virtual void reset()

Clears the summary and resets state to None.


complete

virtual const

virtual bool complete() const

Returns true if the diagnostic has reached a terminal state (Passed or Failed).

Returns

true if complete.


passed

virtual const

virtual bool passed() const

Returns true if the diagnostic state is Passed.

Returns

true if passed.


failed

virtual const

virtual bool failed() const

Returns true if the diagnostic state is Failed.

Returns

true if failed.

Protected Methods

ReturnNameDescription
voidrunOverride to implement diagnostic logic.
boolpass virtualTransitions the state to Passed.
boolfail virtualTransitions the state to Failed.
voidaddSummary virtualAppends text to the summary list and emits SummaryUpdated.

run

void run()

Override to implement diagnostic logic.

The StateChange signal will dispatch diagnostic test results to delegates.


pass

virtual

virtual bool pass()

Transitions the state to Passed.

Returns

true if the state transition succeeded.


fail

virtual

virtual bool fail()

Transitions the state to Failed.

Returns

true if the state transition succeeded.


addSummary

virtual

virtual void addSummary(const std::string & text)

Appends text to the summary list and emits SummaryUpdated.

Parameters

  • text Summary line to append.