Fawkes API
Fawkes Development Version
|
24 #ifndef _CORE_EXCEPTION_H_
25 #define _CORE_EXCEPTION_H_
35 class Exception :
public std::exception
38 Exception(
const char *format, ...) throw();
39 Exception(
int errnoval, const
char *format, ...) throw();
44 void prepend(const
char *format, ...) throw();
45 void append(const
char *format, ...) throw();
46 void append_va(const
char *format, va_list va) throw();
57 virtual const
char *
what() const throw();
116 const
char *type_id_;
void append_nolock_nocopy(char *msg)
Append message without copying.
void print_backtrace() const
Prints a backtrace.
iterator & operator++()
Prefix ++ operator.
void append_va(const char *format, va_list va)
Append messages to the message list.
iterator end()
Get end iterator for messages.
message_list_t * messages_end
Exception()
Constructor for subclasses.
message_list_t * messages
iterator()
Plain constructor.
void append_nolock(const char *format,...)
Append messages without lock.
const char * type_id() const
Get type ID.
bool operator==(const iterator &i) const
Check equality.
virtual void raise()
This can be used to throw this exception.
void append(const char *format,...)
Append messages to the message list.
const char * operator*() const
Get current message.
int get_errno()
Get errno.
Internal exception message list.
void print_trace()
Prints trace to stderr.
iterator begin()
Get iterator for messages.
void copy_messages(const Exception &exc)
Copy messages from given exception.
virtual const char * what_no_backtrace() const
Get primary string (does not implicitly print the back trace).
message_list_t * messages_iterator
void prepend_nolock_va(const char *format, va_list va)
Prepend messages without lock by formatted string.
virtual const char * what() const
Get primary string.
bool operator!=(const iterator &i) const
Check inequality.
iterator & operator=(const iterator &i)
Assignment operator.
char * generate_backtrace() const
Generate backtrace string.
void prepend(const char *format,...)
Prepend messages to the message list.
void set_type_id(const char *id)
Set exception type ID.
void append_nolock_va(const char *format, va_list va)
Append messages without lock by formatted string.