projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Remove exposed C++ namespace.
[m6w6/libmemcached]
/
libtest
/
fatal.hpp
diff --git
a/libtest/fatal.hpp
b/libtest/fatal.hpp
index bc288afeb767cf72498ee86348364dc830c5039f..c679f9b0844d87961d23728619621ef3bce4d857 100644
(file)
--- a/
libtest/fatal.hpp
+++ b/
libtest/fatal.hpp
@@
-38,24
+38,20
@@
#include <stdexcept>
#include <stdexcept>
-#ifndef __PRETTY_FUNCTION__
-#define __PRETTY_FUNCTION__ __func__
-#endif
-
-#define LIBYATL_DEFAULT_PARAM __FILE__, __LINE__, __PRETTY_FUNCTION__
-
namespace libtest {
namespace libtest {
-class
fatal :
std::runtime_error
+class
disconnected : public
std::runtime_error
{
public:
{
public:
-
fatal(const char *file, int line, const char *func, const char *forma
t, ...);
+
disconnected(const char *file, int line, const char *func, const std::string&, const in_port_t por
t, ...);
const char* what() const throw()
{
return _error_message;
}
const char* what() const throw()
{
return _error_message;
}
+ disconnected(const disconnected&);
+
// The following are just for unittesting the exception class
static bool is_disabled();
static void disable();
// The following are just for unittesting the exception class
static bool is_disabled();
static void disable();
@@
-63,35
+59,28
@@
public:
static uint32_t disabled_counter();
static void increment_disabled_counter();
static uint32_t disabled_counter();
static void increment_disabled_counter();
-private:
- char _error_message[BUFSIZ];
-};
-
-class disconnected : std::runtime_error
-{
-public:
- disconnected(const char *file, int line, const char *func, const char *instance, const in_port_t port, const char *format, ...);
+ int line() const
+ {
+ return _line;
+ }
- const char*
what() const throw()
+ const char*
file() const
{
{
- return _
error_messag
e;
+ return _
fil
e;
}
}
- // The following are just for unittesting the exception class
- static bool is_disabled();
- static void disable();
- static void enable();
- static uint32_t disabled_counter();
- static void increment_disabled_counter();
+ const char* func() const
+ {
+ return _func;
+ }
private:
char _error_message[BUFSIZ];
in_port_t _port;
private:
char _error_message[BUFSIZ];
in_port_t _port;
- char _instance[1024];
+ char _instance[BUFSIZ];
+ int _line;
+ const char* _file;
+ const char* _func;
};
};
-
} // namespace libtest
} // namespace libtest
-
-#define fatal_message(__mesg) throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "%s", __mesg)
-#define fatal_assert(__assert) if((__assert)) {} else { throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "%s", #__assert); }