24 #ifndef __CORE_EXCEPTION_H_ 25 #define __CORE_EXCEPTION_H_ 39 Exception(
const char *format, ...)
throw();
40 Exception(
int errnoval,
const char *format, ...)
throw();
45 void prepend(
const char *format, ...)
throw();
46 void append(
const char *format, ...)
throw();
47 void append_va(
const char *format, va_list va)
throw();
58 virtual const char*
what()
const throw();
84 bool operator== (
const iterator & i)
const;
85 bool operator!= (
const iterator & i)
const;
87 const char * operator* ()
const;
114 const char *__type_id;
message_list_t * messages_end
Pointer that points to the very last message.
Mutex * messages_mutex
Mutex to protect operations on messages list.
int get_errno()
Get errno.
void print_backtrace() const
Prints a backtrace.
Fawkes library namespace.
Exception()
Constructor for subclasses.
virtual const char * what() const
Get primary string.
int _errno
Error number, should be used if the error was caused by a method that supplies errno.
void prepend_nolock_va(const char *format, va_list va)
Prepend messages without lock by formatted string.
Message iterator for exceptions.
virtual ~Exception()
Destructor.
iterator end()
Get end iterator for messages.
Base class for exceptions in Fawkes.
void append_nolock_va(const char *format, va_list va)
Append messages without lock by formatted string.
void append_nolock(const char *format,...)
Append messages without lock.
message_list_t * messages
List of messages.
const char * type_id() const
Get type ID.
void prepend(const char *format,...)
Prepend messages to the message list.
message_list_t * messages_iterator
Iterator to iterate over messages.
iterator begin()
Get iterator for messages.
virtual const char * what_no_backtrace() const
Get primary string (does not implicitly print the back trace).
void append_va(const char *format, va_list va)
Append messages to the message list.
Internal exception message list.
void print_trace()
Prints trace to stderr.
void set_type_id(const char *id)
Set exception type ID.
message_list_t * next
pointer to next element, NULL if last element
void copy_messages(const Exception &exc)
Copy messages from given exception.
Exception & operator=(const Exception &exc)
Assign an Exception.
Mutex mutual exclusion lock.
void append_nolock_nocopy(char *msg)
Append message without copying.
char * generate_backtrace() const
Generate backtrace string.
void append(const char *format,...)
Append messages to the message list.
char * msg
pointer to message, may not be NULL, will be freed in dtor