Home
Base module

IDiagnostic

Abstract interface for diagnostic information providers.

IDiagnostic

#include <icy/diagnosticmanager.h>
class IDiagnostic

Defined in src/base/include/icy/diagnosticmanager.h:64

Inherits: Stateful< DiagnosticState > Subclassed by: AsyncDiagnostic

Abstract interface for diagnostic information providers.

List of all members

NameKindOwner
namevariableDeclared here
descriptionvariableDeclared here
summaryvariableDeclared here
SummaryUpdatedvariableDeclared here
IDiagnosticfunctionDeclared here
~IDiagnosticfunctionDeclared here
checkfunctionDeclared here
resetfunctionDeclared here
completefunctionDeclared here
passedfunctionDeclared here
failedfunctionDeclared here
runfunctionDeclared here
passfunctionDeclared here
failfunctionDeclared here
addSummaryfunctionDeclared here
StateChangevariableInherited from Stateful
StatefulfunctionInherited from Stateful
~StatefulfunctionInherited from Stateful
stateEqualsfunctionInherited from Stateful
stateBetweenfunctionInherited from Stateful
statefunctionInherited from Stateful
statefunctionInherited from Stateful
_statevariableInherited from Stateful
beforeStateChangefunctionInherited from Stateful
onStateChangefunctionInherited from Stateful
setStatefunctionInherited from Stateful
setStatefunctionInherited from Stateful

Inherited from Stateful

KindNameDescription
variableStateChangeSignals when the state changes.
functionStateful inline
function~Stateful virtual inline
functionstateEquals virtual const inlineReturns true if the current state ID equals the given ID.
functionstateBetween virtual const inlineReturns true if the current state ID is in the inclusive range [lid, rid].
functionstate virtual inlineReturns a mutable reference to the current state.
functionstate virtual const inlineReturns a copy of the current state.
variable_state
functionbeforeStateChange virtual inlineOverride to handle pre state change logic. Return false to prevent state change.
functiononStateChange virtual inlineOverride to handle post state change logic.
functionsetState virtual inlineSets the state and sends the state signal if the state change was successful.
functionsetState virtual inlineSets the state and sends the state signal if the state change was successful.

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

Defined in src/base/include/icy/diagnosticmanager.h:70

The name of the diagnostic.


description

std::string description

Defined in src/base/include/icy/diagnosticmanager.h:71

The diagnostic description.


summary

std::vector< std::string > summary

Defined in src/base/include/icy/diagnosticmanager.h:72

The diagnostic summary, maybe including troubleshooting information on failure.


SummaryUpdated

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

Defined in src/base/include/icy/diagnosticmanager.h:95

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()

Defined in src/base/include/icy/diagnosticmanager.h:67


check

virtual

virtual void check()

Defined in src/base/include/icy/diagnosticmanager.h:76

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

Reimplemented by

reset

virtual

virtual void reset()

Defined in src/base/include/icy/diagnosticmanager.h:79

Clears the summary and resets state to None.


complete

virtual const

virtual bool complete() const

Defined in src/base/include/icy/diagnosticmanager.h:83

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

Returns

true if complete.


passed

virtual const

virtual bool passed() const

Defined in src/base/include/icy/diagnosticmanager.h:87

Returns true if the diagnostic state is Passed.

Returns

true if passed.


failed

virtual const

virtual bool failed() const

Defined in src/base/include/icy/diagnosticmanager.h:91

Returns true if the diagnostic state is Failed.

Returns

true if failed.

Protected Methods

ReturnNameDescription
voidrun virtualOverride 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

virtual

virtual void run()

Defined in src/base/include/icy/diagnosticmanager.h:102

Override to implement diagnostic logic.

The StateChange signal will dispatch diagnostic test results to delegates.

Reimplemented by

pass

virtual

virtual bool pass()

Defined in src/base/include/icy/diagnosticmanager.h:106

Transitions the state to Passed.

Returns

true if the state transition succeeded.


fail

virtual

virtual bool fail()

Defined in src/base/include/icy/diagnosticmanager.h:110

Transitions the state to Failed.

Returns

true if the state transition succeeded.


addSummary

virtual

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

Defined in src/base/include/icy/diagnosticmanager.h:114

Appends text to the summary list and emits SummaryUpdated.

Parameters

  • text Summary line to append.