Date: Wednesday, January 25, 2006 @ 18:16:00
  Author: marc
    Path: /cvsroot/carob/carob

Modified: include/CarobException.hpp (1.32 -> 1.33) src/CarobException.cpp
          (1.16 -> 1.17)

Redefined BackTrace default ctor to always get the current backtrace.
(BackTrace now extends std::vector<std::string> instead of being just a typedef)


----------------------------+
 include/CarobException.hpp |   10 +++++++---
 src/CarobException.cpp     |    4 +++-
 2 files changed, 10 insertions(+), 4 deletions(-)


Index: carob/include/CarobException.hpp
diff -u carob/include/CarobException.hpp:1.32 
carob/include/CarobException.hpp:1.33
--- carob/include/CarobException.hpp:1.32       Fri Jan 13 16:40:53 2006
+++ carob/include/CarobException.hpp    Wed Jan 25 18:16:00 2006
@@ -30,11 +30,15 @@
 namespace CarobNS {
 
 class StackTraceElement;
-class CarobException;
 class DriverSocket;
 
-// TODO: convert this to wstring (for uniformity reasons)
-typedef std::vector<std::string> BackTrace;
+  // redefine the default ctor to get the current backtrace
+class BackTrace : public std::vector<std::string>
+{
+public:
+  BackTrace();
+  BackTrace(size_type n) : std::vector<std::string>(n) { } ;
+};
 
 
 typedef std::vector<StackTraceElement> StackTrace;
Index: carob/src/CarobException.cpp
diff -u carob/src/CarobException.cpp:1.16 carob/src/CarobException.cpp:1.17
--- carob/src/CarobException.cpp:1.16   Fri Jan 13 16:40:53 2006
+++ carob/src/CarobException.cpp        Wed Jan 25 18:16:00 2006
@@ -37,7 +37,7 @@
 /** constructs the BackTrace of the current place */
 static BackTrace currentBackTrace()
 {
-  BackTrace bt;
+  BackTrace bt(0);
 
 #ifdef GLIB_BACKTRACE
   void * stack_pointers[100];
@@ -51,6 +51,8 @@
   return bt;
 }
 
+BackTrace::BackTrace() : std::vector<std::string>(currentBackTrace())
+{ };
 
 CarobException::~CarobException()
 {

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to