Commit 6118ec7a authored by Dominik Charousset's avatar Dominik Charousset

renamed cppa::exception to cppa::cppa_exception to avoid namespace clash when...

renamed cppa::exception to cppa::cppa_exception to avoid namespace clash when using both namespaces std and cppa
parent 14db822a
...@@ -41,11 +41,11 @@ namespace cppa { ...@@ -41,11 +41,11 @@ namespace cppa {
/** /**
* @brief Base class for libcppa exceptions. * @brief Base class for libcppa exceptions.
*/ */
class exception : public std::exception { class cppa_exception : public std::exception {
public: public:
~exception() throw(); ~cppa_exception() throw();
/** /**
* @brief Returns the error message. * @brief Returns the error message.
...@@ -59,13 +59,13 @@ class exception : public std::exception { ...@@ -59,13 +59,13 @@ class exception : public std::exception {
* @brief Creates an exception with the error string @p what_str. * @brief Creates an exception with the error string @p what_str.
* @param what_str Error message as rvalue string. * @param what_str Error message as rvalue string.
*/ */
exception(std::string&& what_str); cppa_exception(std::string&& what_str);
/** /**
* @brief Creates an exception with the error string @p what_str. * @brief Creates an exception with the error string @p what_str.
* @param what_str Error message as string. * @param what_str Error message as string.
*/ */
exception(const std::string& what_str); cppa_exception(const std::string& what_str);
private: private:
...@@ -76,7 +76,7 @@ class exception : public std::exception { ...@@ -76,7 +76,7 @@ class exception : public std::exception {
/** /**
* @brief Thrown if an actor finished execution. * @brief Thrown if an actor finished execution.
*/ */
class actor_exited : public exception { class actor_exited : public cppa_exception {
public: public:
...@@ -99,7 +99,7 @@ class actor_exited : public exception { ...@@ -99,7 +99,7 @@ class actor_exited : public exception {
* @brief Thrown to indicate that either an actor publishing failed or * @brief Thrown to indicate that either an actor publishing failed or
* @p libcppa was unable to connect to a remote host. * @p libcppa was unable to connect to a remote host.
*/ */
class network_error : public exception { class network_error : public cppa_exception {
public: public:
......
...@@ -63,29 +63,27 @@ std::string be_what(int err_code) { ...@@ -63,29 +63,27 @@ std::string be_what(int err_code) {
namespace cppa { namespace cppa {
exception::exception(const std::string &what_str) : m_what(what_str) { cppa_exception::cppa_exception(const std::string& what_str)
} : m_what(what_str) { }
exception::exception(std::string&& what_str) : m_what(std::move(what_str)) { cppa_exception::cppa_exception(std::string&& what_str)
} : m_what(std::move(what_str)) { }
exception::~exception() throw() { cppa_exception::~cppa_exception() throw() { }
}
const char* exception::what() const throw() { const char* cppa_exception::what() const throw() {
return m_what.c_str(); return m_what.c_str();
} }
actor_exited::actor_exited(std::uint32_t reason) : exception(ae_what(reason)) { actor_exited::actor_exited(std::uint32_t reason)
: cppa_exception(ae_what(reason)) {
m_reason = reason; m_reason = reason;
} }
network_error::network_error(const std::string& str) : exception(str) { network_error::network_error(const std::string& str) : cppa_exception(str) { }
}
network_error::network_error(std::string&& str) network_error::network_error(std::string&& str)
: exception(std::move(str)) { : cppa_exception(std::move(str)) { }
}
bind_failure::bind_failure(int err_code) : network_error(be_what(err_code)) { bind_failure::bind_failure(int err_code) : network_error(be_what(err_code)) {
m_errno = err_code; m_errno = err_code;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment