MeVisLab Toolbox 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>

Inheritance diagram for ml::TreeNodeException:
ml::XMLTreeNodeException

Public Member Functions

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

Protected Attributes

int _errorCode
 The error code of the exception. More...
 

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 110 of file mlTreeNode.h.

Constructor & Destructor Documentation

◆ TreeNodeException()

ml::TreeNodeException::TreeNodeException ( int  errorCode = 0,
const char *  msg = nullptr 
)

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.

◆ ~TreeNodeException()

virtual ml::TreeNodeException::~TreeNodeException ( )
inlinevirtual

Destructor.

Definition at line 124 of file mlTreeNode.h.

Member Function Documentation

◆ getCode()

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

Returns the error code.

Definition at line 127 of file mlTreeNode.h.

◆ getMessage()

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 pointer is guaranteed to be valid at least until the exception object from which it is obtained is destroyed

Reimplemented in ml::XMLTreeNodeException.

Member Data Documentation

◆ _errorCode

int ml::TreeNodeException::_errorCode
protected

The error code of the exception.

Definition at line 141 of file mlTreeNode.h.


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