ML Reference
ml::TreeNodeException Class Reference

The class TreeNodeException is the base class for all exceptions thrown by the class TreeNode and all derived classes. More...

#include <mlTreeNode.h>

List of all members.

Public Member Functions

 TreeNodeException (int errorCode=0, const char *msg=0)
 Creates a new exception object with code errorCode and an optional error message.
virtual ~TreeNodeException ()
 Destructor.
int getCode () const
 Returns the error code.
virtual const char * getMessage () const
 Returns the error string.

Protected Attributes

int _errorCode
 The error code of the exception.
const char * _errorMsg
 The optional user defined message.

Detailed Description

The class TreeNodeException is the base class for all exceptions thrown by the class TreeNode and all derived classes.

This class is not abstract, so you can directly generate TreeNodeExceptions when implementing the TreeNode interface. If the exception you want to throw is not listed yet, you may either add it here (but only if it is an exception that could be useful to all possible TreeNode implementations) or derive from this class and add implementation specific exceptions. If you need an example on how to do this, this has be done for the XMLTreeNode exceptions.

Definition at line 101 of file mlTreeNode.h.


Constructor & Destructor Documentation

ml::TreeNodeException::TreeNodeException ( int  errorCode = 0,
const char *  msg = 0 
) [inline]

Creates a new exception object with code errorCode and an optional error message.

If the error code is known in this class, the corresponding standard error message is returned, including the error code itself. If an additional message is given, it is appended to the standard string.

Definition at line 112 of file mlTreeNode.h.

virtual ml::TreeNodeException::~TreeNodeException ( ) [inline, virtual]

Destructor.

Definition at line 115 of file mlTreeNode.h.


Member Function Documentation

int ml::TreeNodeException::getCode ( ) const [inline]

Returns the error code.

Definition at line 118 of file mlTreeNode.h.

virtual const char* ml::TreeNodeException::getMessage ( ) const [virtual]

Returns the error string.

If the error code is known in this class, the corresponding standard error message is returned, including the error code itself. If an additional message was specified, it is appended to the standard string. The returned string must be deleted by caller with delete[].


Member Data Documentation

The error code of the exception.

Definition at line 131 of file mlTreeNode.h.

const char* ml::TreeNodeException::_errorMsg [protected]

The optional user defined message.

Definition at line 134 of file mlTreeNode.h.


The documentation for this class was generated from the following file: