added TCPPacket implemented by Dennis.
[senf.git] / Utils / Exception.hh
index cc23ae3..c6f3257 100644 (file)
@@ -140,9 +140,10 @@ namespace senf {
     class ExceptionMixin
     {
     public:
-        std::string const & message() const;
+        std::string message() const; ///< get exception description
+        std::string backtrace() const; ///< Return backtrace (if available)
 
-        void append(std::string text); ///< Extend exception description
+        void append(std::string text);  ///< Extend exception description
                                         /**< Adds \a text to the description text. */
 
     protected:
@@ -153,11 +154,12 @@ namespace senf {
                                              describing the exception for most derived
                                              exceptions. */
 
+        std::string what_;
     private:
 #ifdef SENF_DEBUG
         void addBacktrace();
+        std::string::size_type excLen_;
 #endif
-        std::string message_;
     };
 
     /** \brief Extensible exception base-class
@@ -177,6 +179,9 @@ namespace senf {
         virtual ~Exception() throw();
 
         virtual char const * what() const throw();
+                                        ///< get exception description and backtrace if available
+                                        /**< get description of the exception (message()) and backtrace
+                                             information if SENF is compiled with \c SENF_DEBUG */ 
 
     protected:
         explicit Exception(std::string const & description = "");
@@ -299,7 +304,6 @@ namespace senf {
         void init(std::string const & descr, int code _SENF_EXC_DEBUG_ARGS_ND);
         
         int code_;
-        std::string what_;
     };
 
 #   ifdef SENF_DEBUG