|
KiCad PCB EDA Suite
|
A thread-safe REPORTER wrapper that serializes forwarding to an underlying reporter. More...
#include <reporter.h>
Public Types | |
| enum | LOCATION { LOC_HEAD = 0 , LOC_BODY , LOC_TAIL } |
| Location where the message is to be reported. More... | |
Public Member Functions | |
| SYNC_REPORTER (REPORTER &aReporter) | |
| REPORTER & | Report (const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override |
| Report a string with a given severity. | |
| REPORTER & | ReportTail (const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override |
| Places the report at the end of the list, for objects that support report ordering. | |
| REPORTER & | ReportHead (const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override |
| Places the report at the beginning of the list for objects that support ordering. | |
| bool | HasMessage () const override |
| Returns true if any messages were reported. | |
| bool | HasMessageOfSeverity (int aSeverityMask) const override |
| Returns true if the reporter has one or more messages matching the specified severity mask. | |
| EDA_UNITS | GetUnits () const override |
| void | Clear () override |
| REPORTER & | Report (const char *aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) |
| REPORTER & | operator<< (const wxString &aText) |
Private Attributes | |
| REPORTER & | m_reporter |
| std::mutex | m_mutex |
| int | m_reportedSeverityMask |
A thread-safe REPORTER wrapper that serializes forwarding to an underlying reporter.
Use it when several worker threads may report concurrently through one reporter that is not itself thread-safe. The wrapped reporter must outlive this object. This only guards against data races on the wrapped reporter's state, it does not marshal calls onto a UI thread, so the wrapped reporter must be safe to touch from a background thread.
Definition at line 170 of file reporter.h.
|
inherited |
Location where the message is to be reported.
LOC_HEAD messages are printed before all others (typically intro messages) LOC_BODY messages are printed in the middle LOC_TAIL messages are printed after all others (typically status messages)
| Enumerator | |
|---|---|
| LOC_HEAD | |
| LOC_BODY | |
| LOC_TAIL | |
Definition at line 87 of file reporter.h.
|
inline |
Definition at line 173 of file reporter.h.
References m_reporter, and REPORTER::REPORTER().
|
overridevirtual |
Reimplemented from REPORTER.
Definition at line 128 of file reporter.cpp.
References m_mutex, and m_reporter.
Referenced by BOOST_AUTO_TEST_CASE().
|
overridevirtual |
Reimplemented from REPORTER.
Definition at line 152 of file reporter.cpp.
References m_mutex, and m_reporter.
|
overridevirtual |
Returns true if any messages were reported.
Reimplemented from REPORTER.
Definition at line 136 of file reporter.cpp.
References m_mutex, and m_reporter.
Referenced by BOOST_AUTO_TEST_CASE().
|
overridevirtual |
Returns true if the reporter has one or more messages matching the specified severity mask.
Reimplemented from REPORTER.
Definition at line 144 of file reporter.cpp.
References m_mutex, and m_reporter.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Definition at line 128 of file reporter.h.
References Report(), and REPORTER().
|
inherited |
Definition at line 73 of file reporter.cpp.
References From_UTF8(), Report(), and REPORTER().
|
overridevirtual |
Report a string with a given severity.
| aText | is the string to report. |
| aSeverity | is an indicator ( RPT_UNDEFINED, RPT_INFO, RPT_WARNING, RPT_ERROR, RPT_ACTION ) used to filter and format messages |
Reimplemented from REPORTER.
Definition at line 101 of file reporter.cpp.
References m_mutex, m_reporter, and REPORTER::REPORTER().
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
overridevirtual |
Places the report at the beginning of the list for objects that support ordering.
Reimplemented from REPORTER.
Definition at line 119 of file reporter.cpp.
References m_mutex, m_reporter, and REPORTER::REPORTER().
Referenced by BOOST_AUTO_TEST_CASE().
|
overridevirtual |
Places the report at the end of the list, for objects that support report ordering.
Reimplemented from REPORTER.
Definition at line 110 of file reporter.cpp.
References m_mutex, m_reporter, and REPORTER::REPORTER().
Referenced by BOOST_AUTO_TEST_CASE().
|
mutableprivate |
Definition at line 193 of file reporter.h.
Referenced by Clear(), GetUnits(), HasMessage(), HasMessageOfSeverity(), Report(), ReportHead(), and ReportTail().
|
privateinherited |
Definition at line 158 of file reporter.h.
Referenced by Clear(), HasMessage(), HasMessageOfSeverity(), Report(), and REPORTER().
|
private |
Definition at line 192 of file reporter.h.
Referenced by Clear(), GetUnits(), HasMessage(), HasMessageOfSeverity(), Report(), ReportHead(), ReportTail(), and SYNC_REPORTER().