MityDSP Documentation Index
Static Public Member Functions | Static Public Attributes | Static Protected Attributes
MityDSP::tcDspError Class Reference

The tcDspError class handles formatting and reporting errors in a consistent manner. More...

#include <core/DspError.h>

List of all members.

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.

Detailed Description

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.

See also:
tcDspError Page

Member Function Documentation

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.

Parameters:
[in]apFileA 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]anLineAn 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]aeLevelThe error severity level:
  • error - An unexpected condition. Continuation of the application cannot reliably occur.
  • warning - An unexpected condition, but the application can continue safely.
  • status - A significant event, but not an abnormal condition.
  • debug - Provides debug information.
[in]apFormatA 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.

Parameters:
[in]aeLevelThe error severity level:
  • error - An unexpected condition. Continuation of the application cannot reliably occur.
  • warning - An unexpected condition, but the application can continue safely.
  • status - A significant event, but not an abnormal condition.
  • debug - Provides debug information.
[in]apFormatA printf-style format statement, including constant character text.
[in]...Varargs list matching the format specifier.

Member Data Documentation

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

Semaphore used to serialize access across multiple threads.

unsigned int tcDspError::mnTicksPerSec = (1000 * CLK_countspms()) / CLK_getprd()
staticprotected

Conversion from low resolution clock ticks to seconds.


  
Generated on Mon Apr 22 2013 11:33:03 for MityDSP Core by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.