Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

AxPipe::CError Class Reference

Base class to all segments, handles backwards error propagation etc. More...

#include <CError.h>

Inheritance diagram for AxPipe::CError:

Inheritance graph
Collaboration diagram for AxPipe::CError:

Collaboration graph
List of all members.

Public Member Functions

 CError ()
 Just initialize the member variables.

 ~CError ()
 Delete the error message, if there is one.

void SetError (int iError, const _TCHAR *szError, const _TCHAR *szParam=NULL)
 Signal an error from derived classes.

_TCHAR * GetErrorMsg ()
 Retrieve an error message, if any.

int GetErrorCode ()
 Retrieve the error code, if any.

Protected Member Functions

void Init (CError *pPrev)
 Used internally to initialize the pointer to previous. Don't call.

Private Member Functions

void InError (int iError, _TCHAR *szError)
 Pass the string backwards to the source, where we store it.

Private Attributes

 Point back to previous in pipe. NULL if Source.

_TCHAR * m_szError
 Allocated message, only valid in Source. NULL otherwise.

int m_iError
 Error code, only valid in Source. Success otherwise.

Detailed Description

Base class to all segments, handles backwards error propagation etc.

The most commonly used members in derived classes are SetError() to report an error and GetErrorCode() and GetErrorMsg() to check for errors after plugging the pipe, and getting the error description if needed.

Definition at line 45 of file CError.h.

Member Function Documentation

int AxPipe::CError::GetErrorCode  ) 

Retrieve the error code, if any.

Retrieve an error code, or AxPipe::ERROR_CODE_SUCCESS if no error. This may be called using any object in a pipe, it will backtrace to the source and report the error code there.

Definition at line 95 of file CError.cpp.

References m_iError, and m_pPrev.

Referenced by AxPipe::CSource::Drain(), and AxPipe::CJoin::OutPlug().

_TCHAR * AxPipe::CError::GetErrorMsg  ) 

Retrieve an error message, if any.

Call using any object in a pipe, it will backtrace to the source and report the error code there.

The text of an error message, or NULL if none. Treat this as a static (it's not).

Definition at line 84 of file CError.cpp.

References _TCHAR, m_pPrev, and m_szError.

Referenced by AxPipe::CJoin::OutPlug().

void AxPipe::CError::SetError int  iError,
const _TCHAR *  szError,
const _TCHAR *  szParam = NULL

Signal an error from derived classes.

iError The error code, see AxPipe::ERROR_CODE
szError An error message, you may use AxPipe::ERROR_MSG_INTERNAL and AxPipe::ERROR_MSG_GENERIC as well as any string.
szParam If the error message contains a printf s, this string is inserted there in the message.

Definition at line 71 of file CError.cpp.

References _TCHAR, and InError().

Referenced by AxPipe::CSplit::AppendSink(), AxPipe::CSink::AppendSink(), AxPipe::CSink::DoSegWork(), AxPipe::CSource::Drain(), AxPipe::CCoContext::Go(), AxPipe::Stock::CPipeSHA1::Out(), AxPipe::Stock::CPipeInflate::Out(), AxPipe::CJoin::CTSinkJoin::Out(), AxPipe::CFilter::Out(), AxPipe::CSinkMemFile::Out(), AxPipe::Stock::CPipeSHA1::OutClose(), AxPipe::CSinkMemFile::OutClose(), AxPipe::CSinkMemFile::OutGetSeg(), AxPipe::Stock::CPipeSHA1::OutOpen(), AxPipe::Stock::CPipeInflate::OutOpen(), AxPipe::CSinkMemFile::OutOpen(), AxPipe::CJoin::OutPlug(), AxPipe::CFilterByte::Read(), and AxPipe::CFilterBlock::ReadBlock().

The documentation for this class was generated from the following files:
Generated on Mon Feb 2 13:19:21 2004 for AxPipe by doxygen 1.3.5