IDiagnostic
IDiagnostic
#include <icy/diagnosticmanager.h>Inherits:
Stateful< DiagnosticState >Subclassed by:AsyncDiagnostic
Abstract interface for diagnostic information providers.
Public Attributes
| Return | Name | Description |
|---|---|---|
std::string | name | The name of the diagnostic. |
std::string | description | The diagnostic description. |
std::vector< std::string > | summary | The diagnostic summary, maybe including troubleshooting information on failure. |
ThreadSignal< void(const std::string &)> | SummaryUpdated | Signals when a new text item is added to the summary. |
name
std::string nameThe name of the diagnostic.
description
std::string descriptionThe diagnostic description.
summary
std::vector< std::string > summaryThe diagnostic summary, maybe including troubleshooting information on failure.
SummaryUpdated
ThreadSignal< void(const std::string &)> SummaryUpdatedSignals when a new text item is added to the summary.
Public Methods
| Return | Name | Description |
|---|---|---|
IDiagnostic | ||
void | check virtual | Resets state to None and invokes run() to perform the diagnostic check. |
void | reset virtual | Clears the summary and resets state to None. |
bool | complete virtual const | Returns true if the diagnostic has reached a terminal state (Passed or Failed). |
bool | passed virtual const | Returns true if the diagnostic state is Passed. |
bool | failed virtual const | Returns 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() constReturns true if the diagnostic has reached a terminal state (Passed or Failed).
Returns
true if complete.
passed
virtual const
virtual bool passed() constReturns true if the diagnostic state is Passed.
Returns
true if passed.
failed
virtual const
virtual bool failed() constReturns true if the diagnostic state is Failed.
Returns
true if failed.
Protected Methods
| Return | Name | Description |
|---|---|---|
void | run | Override to implement diagnostic logic. |
bool | pass virtual | Transitions the state to Passed. |
bool | fail virtual | Transitions the state to Failed. |
void | addSummary virtual | Appends 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
textSummary line to append.
