Files
core/Common/cfcpp/RBTree/rbtreeexception.h
2022-10-25 19:04:07 +03:00

36 lines
716 B
C++

#pragma once
#include <exception>
#include <string>
namespace RedBlackTree
{
class RBTreeException : virtual public std::exception
{
public:
RBTreeException() {}
RBTreeException(std::wstring message) : errorMessage(message) {}
RBTreeException(std::wstring message, std::exception& ex) :
std::exception(ex),
errorMessage(message)
{}
virtual ~RBTreeException() throw () {}
virtual const wchar_t* what_w() const throw () {
return errorMessage.c_str();
}
protected:
std::wstring errorMessage;
};
class RBTreeDuplicatedItemException : public RBTreeException
{
public:
RBTreeDuplicatedItemException(std::wstring msg)
: RBTreeException(msg)
{}
};
}