MityDSP Documentation Index

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] 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:

  • 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] 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.

Parameters:
[in] aeLevel The 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] apFormat A 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.

Severity threshold for message creation (default: status).

Callback used to process completed messages (default: NULL).

Callback used to log occurances of any error (default: NULL).

Format for printed timestamps.

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.


  
Generated on Fri Sep 23 16:33:49 2011 for MityDSP Core by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.