Permalink
Browse files

renamed cppa::exception to cppa::cppa_exception to avoid namespace cl…

…ash when using both namespaces std and cppa
  • Loading branch information...
1 parent 14db822 commit 6118ec7a773eb890d442342ea9de73a7fdf7c977 @Neverlord Neverlord committed Aug 21, 2012
Showing with 16 additions and 18 deletions.
  1. +6 −6 cppa/exception.hpp
  2. +10 −12 src/exception.cpp
View
@@ -41,11 +41,11 @@ namespace cppa {
/**
* @brief Base class for libcppa exceptions.
*/
-class exception : public std::exception {
+class cppa_exception : public std::exception {
public:
- ~exception() throw();
+ ~cppa_exception() throw();
/**
* @brief Returns the error message.
@@ -59,13 +59,13 @@ class exception : public std::exception {
* @brief Creates an exception with the error string @p what_str.
* @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.
* @param what_str Error message as string.
*/
- exception(const std::string& what_str);
+ cppa_exception(const std::string& what_str);
private:
@@ -76,7 +76,7 @@ class exception : public std::exception {
/**
* @brief Thrown if an actor finished execution.
*/
-class actor_exited : public exception {
+class actor_exited : public cppa_exception {
public:
@@ -99,7 +99,7 @@ class actor_exited : public exception {
* @brief Thrown to indicate that either an actor publishing failed or
* @p libcppa was unable to connect to a remote host.
*/
-class network_error : public exception {
+class network_error : public cppa_exception {
public:
View
@@ -63,29 +63,27 @@ std::string be_what(int err_code) {
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();
}
-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;
}
-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)
- : exception(std::move(str)) {
-}
+: cppa_exception(std::move(str)) { }
bind_failure::bind_failure(int err_code) : network_error(be_what(err_code)) {
m_errno = err_code;

0 comments on commit 6118ec7

Please sign in to comment.