*
* 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:
* 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;
/**
{
// 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;
}
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: \
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: \
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: \
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: \
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: \
# include <execinfo.h>
#endif
-//TODO[WB]: rename functions in Exception to match out usual_spelling_convention
ExceptionBase::ExceptionBase ()
-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;
-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
<< "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;
#endif
}
-void ExceptionBase::PrintInfo (std::ostream &out) const
+
+
+void ExceptionBase::print_info (std::ostream &out) const
{
out << "(none)" << std::endl;
}
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;
{
// 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
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;