The tcDspError class handles formatting and reporting errors in a consistent manner. More...
#include <core/DspError.h>
Static Public Member Functions | |
static void | report (const char *apFile, int anLine, teErrorValues aeLevel, const char *apFormat,...) |
This routine is used to create an error message. | |
static void | report (teErrorValues aeLevel, const char *apFormat,...) |
This routine is used to create an error message. | |
Static Public Attributes | |
static int | mnNumErrors = 0 |
Number of messages created with a severity set to error. | |
static int | mnNumWarnings = 0 |
Number of messages created with a severity set to warning. | |
static int | mnNumStatus = 0 |
Number of messages created with a severity set to status. | |
static int | mnNumDebug = 0 |
Number of messages created with a severity set to debug. | |
static teErrorValues | meSendToStdout = status |
Severity threshold for message creation (default: status). | |
static tfErrorCallback | mfCallback = NULL |
Callback used to process completed messages (default: NULL). | |
static tfLogCallback | mfLogCallback = NULL |
Callback used to log occurances of any error (default: NULL). | |
static teTimeFormats | meTimeFormat = eeHHMMSS |
Format for printed timestamps. | |
static teOutputFormats | meOutputFormat = eeFormatA |
Format for output report. | |
Static Protected Attributes | |
static SEM_Handle | mhPrintfSemaphore = SEM_create (1, NULL) |
Semaphore used to serialize access across multiple threads. | |
static unsigned int | mnTicksPerSec = (1000 * CLK_countspms()) / CLK_getprd() |
Conversion from low resolution clock ticks to seconds. |
The tcDspError class handles formatting and reporting errors in a consistent manner.
The class is static, so no members may be created. Messages are created whenever the provided severity is greater than tcDspError::send_to_stdout (which has a default of status). If a callback is provided, messages are passed to the callback, otherwise, a printf is used to display them on the standard output.
void tcDspError::report | ( | const char * | apFile, | |
int | anLine, | |||
teErrorValues | aeLevel, | |||
const char * | apFormat, | |||
... | ||||
) | [static] |
This routine is used to create an error message.
The message is created if the provided severity is greater than or equal to the current tcDspError::send_to_stdout setting. The resulting message is sent to the callback specified by tcDspError::callback, or is simply printf'd if no callback is registered.
[in] | apFile | A character string representing the file in which the error is produced (generally __FILE__). If NULL, the file name and line number is omitted from the debug string when eeFormatA is selected. |
[in] | anLine | An integer representing the line number within the calling file (generally __LINE__). If 0, the filename and line number is omitted from the debug string when eeFormatA is selected. |
[in] | aeLevel | The error severity level:
|
[in] | apFormat | A printf-style format statement, including constant character text. |
[in] | ... | Varargs list matching the format specifier. |
void tcDspError::report | ( | teErrorValues | aeLevel, | |
const char * | apFormat, | |||
... | ||||
) | [static] |
This routine is used to create an error message.
The message is created if the provided severity is greater than or equal to the current tcDspError::send_to_stdout setting. The resulting message is sent to the callback specified by tcDspError::callback, or is simply printf'd if no callback is registered.
Use of this function is equivalent to calling tcDspError::report [ABOVE] with NULL and 0 for the filename and line number.
[in] | aeLevel | The error severity level:
|
[in] | apFormat | A printf-style format statement, including constant character text. |
[in] | ... | Varargs list matching the format specifier. |
int tcDspError::mnNumErrors = 0 [static] |
Number of messages created with a severity set to error.
int tcDspError::mnNumWarnings = 0 [static] |
Number of messages created with a severity set to warning.
int tcDspError::mnNumStatus = 0 [static] |
Number of messages created with a severity set to status.
int tcDspError::mnNumDebug = 0 [static] |
Number of messages created with a severity set to debug.
teErrorValues tcDspError::meSendToStdout = status [static] |
Severity threshold for message creation (default: status).
tfErrorCallback tcDspError::mfCallback = NULL [static] |
Callback used to process completed messages (default: NULL).
tfLogCallback tcDspError::mfLogCallback = NULL [static] |
Callback used to log occurances of any error (default: NULL).
teTimeFormats tcDspError::meTimeFormat = eeHHMMSS [static] |
Format for printed timestamps.
teOutputFormats tcDspError::meOutputFormat = eeFormatA [static] |
Format for output report.
SEM_Handle tcDspError::mhPrintfSemaphore = SEM_create (1, NULL) [static, protected] |
Semaphore used to serialize access across multiple threads.
unsigned int tcDspError::mnTicksPerSec = (1000 * CLK_countspms()) / CLK_getprd() [static, protected] |
Conversion from low resolution clock ticks to seconds.