mirror of
https://github.com/lgfischer/dcel.git
synced 2026-11-16 00:07:05 -03:00
The first commit
This commit is contained in:
commit
907922fdee
45 files changed
+7594
No files matched your search
@@ -0,0 +1,58 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright Leonardo Fischer 2011 - http://coderender.blogspot.com
|
||||
//
|
||||
// Distributed under the licence available in the accompanying file
|
||||
// LICENCE.txt. Please read it before use this code.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef Exception_h
|
||||
#define Exception_h
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
namespace cpp
|
||||
{
|
||||
class Exception: public std::exception
|
||||
{
|
||||
public:
|
||||
Exception(const char* m)
|
||||
:msg(m)
|
||||
{};
|
||||
|
||||
Exception(const std::string& msg)
|
||||
: msg(msg)
|
||||
{};
|
||||
|
||||
Exception(const std::exception& e)
|
||||
: msg(e.what())
|
||||
{
|
||||
}
|
||||
|
||||
~Exception() throw()
|
||||
{}
|
||||
|
||||
Exception& operator=(const std::exception& e) throw()
|
||||
{
|
||||
this->msg = e.what();
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual const char* what() const throw()
|
||||
{
|
||||
return msg.c_str();
|
||||
}
|
||||
|
||||
virtual const std::string& message() const
|
||||
{
|
||||
return this->msg;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string msg;
|
||||
};
|
||||
};
|
||||
|
||||
#endif//Exception_h
|
||||
Reference in new issue
Block a user