Fawkes API
Fawkes Development Version
|
24 #ifndef _CORE_EXCEPTION_H_
25 #define _CORE_EXCEPTION_H_
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.
Mutex mutual exclusion lock.
message_list_t * messages_end
Pointer that points to the very last message.
Exception()
Constructor for subclasses.
message_list_t * next
pointer to next element, NULL if last element
message_list_t * messages
List of 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.
void append(const char *format,...)
Append messages to the message list.
const char * operator*() const
Get current message.
int get_errno()
Get errno.
virtual ~Exception()
Destructor.
Fawkes library namespace.
Exception & operator=(const Exception &exc)
Assign an Exception.
Internal exception message list.
char * msg
pointer to message, may not be NULL, will be freed in dtor
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
Iterator to iterate over messages.
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.
Mutex * messages_mutex
Mutex to protect operations on messages list.
Message iterator for exceptions.
int _errno
Error number, should be used if the error was caused by a method that supplies errno.
void append_nolock_va(const char *format, va_list va)
Append messages without lock by formatted string.
Base class for exceptions in Fawkes.