From: wolf Date: Thu, 30 Jun 2005 16:07:23 +0000 (+0000) Subject: Rename functions in ExceptionBase to conform to our usual coding standards. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c35549922b4ab08ff64bd0cdcd31a683e78c5c74;p=dealii-svn.git Rename functions in ExceptionBase to conform to our usual coding standards. git-svn-id: https://svn.dealii.org/trunk@10999 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/exceptions.h b/deal.II/base/include/base/exceptions.h index 2d5811f47f..31b1e31262 100644 --- a/deal.II/base/include/base/exceptions.h +++ b/deal.II/base/include/base/exceptions.h @@ -148,7 +148,7 @@ * * In __IssueError the given data * is transferred into the exc object by calling the - * SetFields() function; after that, the general error info + * set_fields() function; after that, the general error info * is printed onto std::cerr using the PrintError() function of * exc and finally the exception specific data is printed * using the user defined function PrintError() (which is @@ -237,9 +237,9 @@ * 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 @@ -282,7 +282,7 @@ * 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: \ diff --git a/deal.II/base/source/exceptions.cc b/deal.II/base/source/exceptions.cc index 2681dae652..0d8540c2ce 100644 --- a/deal.II/base/source/exceptions.cc +++ b/deal.II/base/source/exceptions.cc @@ -27,7 +27,6 @@ # include #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;