#ifndef _EXCEPTION_BASE_H_
#define _EXCEPTION_BASE_H_


#include "../tobject.h"

#include <exception>
#include <string>

using namespace std;

/**
 * \brief Base class for exceptions
 *
 * Handles exception stacking.
 * 
 * \date 01-21-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class ExceptionBase:public exception,public TObject
{
	ExceptionBase* parentException;
public:
	static const char* type;
	const char* getType() const;

	/**
	 * \brief ctor
	 * \param parentException exception that lead to this exception
	 */
	ExceptionBase(ExceptionBase* parentException=0):parentException(parentException)
	{
	}

	~ExceptionBase() throw()
	{
	}
	
	/**
	 * \brief Return exception description.
	 *
	 * \return exception description
	 */
	virtual const string& getMessage() const=0;
	
	
	/**
	 * \brief Return exception description and stack of exceptions.
	 * \return stack of exceptions
	 */
	string& stackTrace() const;
};

#endif/*_EXCEPTION_BASE_H_*/

