IDiagnostic
IDiagnostic
#include <icy/diagnosticmanager.h>class IDiagnosticDefined in src/base/include/icy/diagnosticmanager.h:64
Inherits:
Stateful< DiagnosticState >Subclassed by:AsyncDiagnostic
Abstract interface for diagnostic information providers.
List of all members
| Name | Kind | Owner |
|---|---|---|
name | variable | Declared here |
description | variable | Declared here |
summary | variable | Declared here |
SummaryUpdated | variable | Declared here |
IDiagnostic | function | Declared here |
~IDiagnostic | function | Declared here |
check | function | Declared here |
reset | function | Declared here |
complete | function | Declared here |
passed | function | Declared here |
failed | function | Declared here |
run | function | Declared here |
pass | function | Declared here |
fail | function | Declared here |
addSummary | function | Declared here |
StateChange | variable | Inherited from Stateful |
Stateful | function | Inherited from Stateful |
~Stateful | function | Inherited from Stateful |
stateEquals | function | Inherited from Stateful |
stateBetween | function | Inherited from Stateful |
state | function | Inherited from Stateful |
state | function | Inherited from Stateful |
_state | variable | Inherited from Stateful |
beforeStateChange | function | Inherited from Stateful |
onStateChange | function | Inherited from Stateful |
setState | function | Inherited from Stateful |
setState | function | Inherited from Stateful |
Inherited from Stateful
| Kind | Name | Description |
|---|---|---|
variable | StateChange | Signals when the state changes. |
function | Stateful inline | |
function | ~Stateful virtual inline | |
function | stateEquals virtual const inline | Returns true if the current state ID equals the given ID. |
function | stateBetween virtual const inline | Returns true if the current state ID is in the inclusive range [lid, rid]. |
function | state virtual inline | Returns a mutable reference to the current state. |
function | state virtual const inline | Returns a copy of the current state. |
variable | _state | |
function | beforeStateChange virtual inline | Override to handle pre state change logic. Return false to prevent state change. |
function | onStateChange virtual inline | Override to handle post state change logic. |
function | setState virtual inline | Sets the state and sends the state signal if the state change was successful. |
function | setState virtual inline | Sets the state and sends the state signal if the state change was successful. |
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 nameDefined in src/base/include/icy/diagnosticmanager.h:70
The name of the diagnostic.
description
std::string descriptionDefined in src/base/include/icy/diagnosticmanager.h:71
The diagnostic description.
summary
std::vector< std::string > summaryDefined in src/base/include/icy/diagnosticmanager.h:72
The diagnostic summary, maybe including troubleshooting information on failure.
SummaryUpdated
ThreadSignal< void(const std::string &)> SummaryUpdatedDefined in src/base/include/icy/diagnosticmanager.h:95
Signals 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()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() constDefined 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() constDefined 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() constDefined in src/base/include/icy/diagnosticmanager.h:91
Returns true if the diagnostic state is Failed.
Returns
true if failed.
Protected Methods
| Return | Name | Description |
|---|---|---|
void | run virtual | 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
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
textSummary line to append.
