]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Rename functions in ExceptionBase to conform to our usual coding standards.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 30 Jun 2005 16:07:23 +0000 (16:07 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 30 Jun 2005 16:07:23 +0000 (16:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@10999 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/exceptions.h
deal.II/base/source/exceptions.cc

index 2d5811f47f81ca163e5ee67195e62606d7ea6a57..31b1e31262b615ff64a82e080dcaf3179203eff0 100644 (file)
  *
  *  In <tt>__IssueError</tt> the given data
  *  is transferred into the <tt>exc</tt> object by calling the
- *  SetFields() function; after that, the general error info
+ *  set_fields() function; after that, the general error info
  *  is printed onto <tt>std::cerr</tt> using the PrintError() function of
  *  <tt>exc</tt> and finally the exception specific data is printed
  *  using the user defined function PrintError() (which is
  *    if (!(cond))
  *      {
  *        ExcSomething e(additional information);
- *        e.SetFields (__FILE__, __LINE__, __PRETTY_FUNCTION__,
- *                     "condition as a string",
- *                     "name of condition as a string");
+ *        e.set_fields (__FILE__, __LINE__, __PRETTY_FUNCTION__,
+ *                      "condition as a string",
+ *                      "name of condition as a string");
  *        throw e;
  *      };
  *  @endcode
  *    public:
  *      name (const type1 a1, const type2 a2) :
  *                     arg1 (a1), arg2(a2) {};
- *      virtual void PrintInfo (std::ostream &out) const {
+ *      virtual void print_info (std::ostream &out) const {
  *        out outsequence << std::endl;
  *      };
  *    private:
@@ -353,30 +353,30 @@ class ExceptionBase : public std::exception
                                      *  condition and the name of the exception as
                                      *  a char pointer.
                                      */
-    void SetFields (const char *f,
-                   const int   l,
-                   const char *func,
-                   const char *c,
-                   const char *e);
+    void set_fields (const char *f,
+                    const int   l,
+                    const char *func,
+                    const char *c,
+                    const char *e);
     
                                     /**
                                      *  Print out the general part of the error
                                      *  information.
                                      */
-    void PrintExcData (std::ostream &out) const;
+    void print_exc_data (std::ostream &out) const;
 
                                     /**
                                      *  Print out the stacktrace (if available)
                                       *  at the time the exception is created
                                      */
-    void PrintStackTrace (std::ostream &out) const;
+    void print_stack_trace (std::ostream &out) const;
 
                                     /**
                                      *  Print more specific information about the
                                      *  exception which occured. Overload this
                                      *  function in your own exception classes.
                                      */
-    virtual void PrintInfo (std::ostream &out) const;
+    virtual void print_info (std::ostream &out) const;
 
 
                                     /**
@@ -505,7 +505,7 @@ namespace deal_II_exceptions
     {
                                       // Fill the fields of the
                                       // exception object
-      e.SetFields (file, line, function, cond, exc_name);
+      e.set_fields (file, line, function, cond, exc_name);
       throw e;
     }
     
@@ -646,7 +646,7 @@ class Exception1 : public ExceptionBase {                             \
   public:                                                             \
       Exception1 (const type1 a1) : arg1 (a1) {};                     \
       virtual ~Exception1 () throw () {};                             \
-      virtual void PrintInfo (std::ostream &out) const {              \
+      virtual void print_info (std::ostream &out) const {              \
         out outsequence << std::endl;                                 \
       };                                                              \
   private:                                                            \
@@ -665,7 +665,7 @@ class Exception2 : public ExceptionBase {                             \
       Exception2 (const type1 a1, const type2 a2) :          \
              arg1 (a1), arg2(a2) {};                                 \
       virtual ~Exception2 () throw () {};                             \
-      virtual void PrintInfo (std::ostream &out) const {              \
+      virtual void print_info (std::ostream &out) const {              \
         out outsequence << std::endl;                                 \
       };                                                              \
   private:                                                            \
@@ -685,7 +685,7 @@ class Exception3 : public ExceptionBase {                             \
       Exception3 (const type1 a1, const type2 a2, const type3 a3) : \
              arg1 (a1), arg2(a2), arg3(a3) {};                       \
       virtual ~Exception3 () throw () {};                             \
-      virtual void PrintInfo (std::ostream &out) const {              \
+      virtual void print_info (std::ostream &out) const {              \
         out outsequence << std::endl;                                 \
       };                                                              \
   private:                                                            \
@@ -707,7 +707,7 @@ class Exception4 : public ExceptionBase {                             \
            const type3 a3, const type4 a4) :                \
              arg1 (a1), arg2(a2), arg3(a3), arg4(a4) {};             \
       virtual ~Exception4 () throw () {};                             \
-      virtual void PrintInfo (std::ostream &out) const {              \
+      virtual void print_info (std::ostream &out) const {              \
         out outsequence << std::endl;                                 \
       };                                                              \
   private:                                                            \
@@ -730,7 +730,7 @@ class Exception5 : public ExceptionBase {                             \
            const type4 a4, const type5 a5) :                \
              arg1 (a1), arg2(a2), arg3(a3), arg4(a4), arg5(a5) {};   \
       virtual ~Exception5 () throw () {};                             \
-      virtual void PrintInfo (std::ostream &out) const {              \
+      virtual void print_info (std::ostream &out) const {              \
         out outsequence << std::endl;                                 \
       };                                                              \
   private:                                                            \
index 2681dae65287aec52f8cb6be90e292599b99b893..0d8540c2cee44156d0ac83bfccb2d1dc9ac31acc 100644 (file)
@@ -27,7 +27,6 @@
 #  include <execinfo.h>
 #endif
 
-//TODO[WB]: rename functions in Exception to match out usual_spelling_convention
 
 
 ExceptionBase::ExceptionBase ()
@@ -50,11 +49,11 @@ ExceptionBase::~ExceptionBase () throw ()
 
 
 
-void ExceptionBase::SetFields (const char* f,
-                              const int l,
-                              const char *func,
-                              const char *c,
-                              const char *e)
+void ExceptionBase::set_fields (const char* f,
+                               const int l,
+                               const char *func,
+                               const char *c,
+                               const char *e)
 {
   file = f;
   line = l;
@@ -65,7 +64,7 @@ void ExceptionBase::SetFields (const char* f,
 
 
 
-void ExceptionBase::PrintExcData (std::ostream &out) const
+void ExceptionBase::print_exc_data (std::ostream &out) const
 {
   out << "An error occurred in line <" << line
       << "> of file <" << file
@@ -78,7 +77,9 @@ void ExceptionBase::PrintExcData (std::ostream &out) const
       << "Additional Information: " << std::endl;
 }
 
-void ExceptionBase::PrintStackTrace (std::ostream &out) const
+
+
+void ExceptionBase::print_stack_trace (std::ostream &out) const
 {
 #ifdef HAVE_GLIBC_STACKTRACE
    out << "Stacktrace:" << std::endl;
@@ -94,7 +95,9 @@ void ExceptionBase::PrintStackTrace (std::ostream &out) const
 #endif
 }
 
-void ExceptionBase::PrintInfo (std::ostream &out) const
+
+
+void ExceptionBase::print_info (std::ostream &out) const
 {
   out << "(none)" << std::endl;
 }
@@ -135,11 +138,11 @@ const char * ExceptionBase::what () const throw ()
       converter << "--------------------------------------------------------"
                 << std::endl;
                                        // put general info into the std::string
-      PrintExcData (converter);
+      print_exc_data (converter);
                                        // put in exception specific data
-      PrintInfo (converter);
+      print_info (converter);
 
-      PrintStackTrace (converter);      // put in stacktrace (if available)
+      print_stack_trace (converter);      // put in stacktrace (if available)
   
       converter << "--------------------------------------------------------"
                 << std::endl;
@@ -207,7 +210,7 @@ namespace deal_II_exceptions
     {
                                       // fill the fields of the
                                       // exception object
-      e.SetFields (file, line, function, cond, exc_name);
+      e.set_fields (file, line, function, cond, exc_name);
       
                                       // if no other exception has
                                       // been displayed before, show
@@ -217,10 +220,10 @@ namespace deal_II_exceptions
          std::cerr << "--------------------------------------------------------"
                    << std::endl;
                                           // print out general data
-         e.PrintExcData (std::cerr);
+         e.print_exc_data (std::cerr);
                                           // print out exception
                                           // specific data
-         e.PrintInfo (std::cerr);
+         e.print_info (std::cerr);
          std::cerr << "--------------------------------------------------------"
                    << std::endl;
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.