TMCException Class Reference
[MCCore]

Inheritance diagram for TMCException:
TMCObject

List of all members.

Public Member Functions

 TMCException (const MCErr error=kNoErr, const char *file=0, const int line=0)
 TMCException (const MCErr error, TMCString *errorString, const char *file=0, const int line=0)
 TMCException (const TMCException &e)
 ~TMCException (void)
const TMCExceptionoperator= (const TMCException &e)
 operator MCErr (void) const
MCErr GetError (void) const
void SetError (const MCErr err)
const TMCStringGetErrorString () const
virtual const char * what () const

Public Attributes

MCErr fError
const char * fFile
int fLine
TMCStringfErrorString

Detailed Description

TMCException is the class used to deal with C++ and system exceptions. You should NEVER call throw without creating a TMCException. There are several useful macros that throw exceptions: ThrowIfNil(), ThrowIfNoMem(), or ThrowIfError(). Or you can use: throw TMCException(...);

For more information please refer to the "Failure Handling" chapter in the overview of the SDK


Constructor & Destructor Documentation

TMCException::TMCException ( const MCErr  error = kNoErr,
const char *  file = 0,
const int  line = 0 
)

constructor: the standard errors can be found in MCStatusCode.h you can create your own errors: it is best to use MAKE_MCCOMErr with ExtensionModule for that purpose.

Note:
when using kNoErr, there wont be a warning message!
TMCException::TMCException ( const MCErr  error,
TMCString errorString,
const char *  file = 0,
const int  line = 0 
)

error and error string constructor The exception will OWN the given string

TMCException::TMCException ( const TMCException e  ) 

We do not want to allocate a new string in the new exception =>copies the e.fErrorString pointer into this.fErrorString and sets e.fErrorString to null.

TMCException::~TMCException ( void   ) 

Member Function Documentation

MCErr TMCException::GetError ( void   )  const [inline]
const TMCString* TMCException::GetErrorString (  )  const [inline]
TMCException::operator MCErr ( void   )  const [inline]
const TMCException& TMCException::operator= ( const TMCException e  ) 
void TMCException::SetError ( const MCErr  err  )  [inline]
virtual const char* TMCException::what (  )  const [inline, virtual]

Member Data Documentation

const char* TMCException::fFile

The documentation for this class was generated from the following file:
Generated on Mon Apr 26 22:48:02 2010 for Carrara SDK Doc by  doxygen 1.6.3