C++ bindings for cgul_exception
More...
#include <cgul_exception_cxx.h>
Public Member Functions | |
cgul_exception_cxx (const char *format,...) | |
cgul_exception_cxx (const char *format, va_list args) | |
cgul_exception_cxx (cgul_exception_t rhs) | |
cgul_exception_cxx (const cgul_exception_cxx &rhs) | |
virtual | ~cgul_exception_cxx () |
cgul_exception_cxx & | operator= (const cgul_exception_cxx &rhs) |
const char * | get_message () const |
virtual cgul_exception_t | get_obj () const |
virtual cgul_exception_t | take_obj () |
virtual void | set_obj (cgul_exception_t rhs) |
This class provides the C++ bindings for C cgul_exception
objects. The main purpose of this class is to convert the C-style function calls into C++-style function calls and to provide a C++ object that is suitable for being used like any other C++ exception.
This class does not inherit from std::exception
. While that would be nice, this is just a major source of portability problems because the header and namespace for "exception" is almost never the same for older but still commonly-used C++ compilers.
|
inline |
Construct a new cgul_exception_cxx
object using a printf()-style format string.
[in] | format | printf()-style format string |
[in] | ... | variable number of arguments that satisfy the format string |
References cgul_exception__new_from_va_list().
|
inline |
Construct a new cgul_exception_cxx
object using the vprintf()-style variable argument list args
.
[in] | format | printf()-style format string |
args | variable number of arguments that satisfy format |
References cgul_exception__new_from_va_list().
|
inline |
Construct a new cgul_exception_cxx
object by wrapping and taking ownership of an existing cgul_exception
.
[in] | rhs | right-hand side |
|
inline |
Copy constructor.
[in] | rhs | right-hand side |
|
inlinevirtual |
Destructor.
References cgul_exception__delete().
|
inline |
This method assigns the exception in rhs
to this object and then return this object.
[in] | rhs | right-hand side |
References cgul_exception__delete(), cgul_exception__new(), and get_message().
|
inline |
Get the message associated with the exception.
References cgul_exception__get_message().
Referenced by operator=().
|
inlinevirtual |
Get the underlying cgul_exception
object.
|
inlinevirtual |
Take the underlying cgul_exception
object. This means the underlying object will not be deleted when the wrapper goes out of scope. Also, because you have taken the underlying object, no other methods should be called on this wrapper's instance. Lastly, after taking the underlying object, it is the caller's responsibility to delete the underlying object by calling cgul_exception__delete()
.
|
inlinevirtual |
Set the new underlying object to rhs
. This causes the old underlying object to be deleted which invalidates any outstanding pointers to or iterators for the old underlying object.
This instance takes ownership of rhs
which means rhs
will be automatically deleted when the C++ wrapper is deleted. To prevent automatic deletion of rhs
, call take_obj()
when the C++ wrapper is no longer needed.
[in] | rhs | right-hand side |
References cgul_exception__delete().