This class is the base class for all exceptions thrown in the Server library. More...
#include <ilserver/except.h>
Public Member Functions | |
IlsException (char *message=0, IlsBoolean destroyMessage=IlsFalse) | |
This constructor creates an instance of IlsException . More... | |
IlsException (const char *message) | |
This constructor creates an instance of IlsException . The message parameter will not be deleted or copied. More... | |
IlsException (const IlsException &rhs) | |
This copy constructor copies an instance of a message. More... | |
virtual | ~IlsException () |
This virtual destructor will delete the message it contains if the exception was created with the destroyMessage parameter set to IlsTrue . | |
const char * | getMessage () const |
This member function returns the message, if any, contained in the exception. More... | |
IlsBoolean | operator== (const IlsException &rhs) const |
This copy operator copies the exception rhs . More... | |
void | setMessage (const char *message) |
This member function changes the message in an exception. More... | |
This class is the base class for all exceptions thrown in the Server library.
Library: server
and mvcomp
All exceptions that are thrown derive from this class (without adding any new methods) so that it is possible to catch a particular exception using the standard C++ mechanism.
IlsException::IlsException | ( | char * | message = 0 , |
IlsBoolean | destroyMessage = IlsFalse |
||
) |
This constructor creates an instance of IlsException
.
If a message is passed in as the first parameter, it can be used via the getMessage member function in the catch statement to print out a message. If the parameter destroyMessage
is set to IlsTrue
, the message will be deleted (via delete []
) when the exception is deleted.
IlsException::IlsException | ( | const char * | message | ) |
This constructor creates an instance of IlsException
. The message parameter will not be deleted or copied.
The message can be used via the getMessage()
member function in the catch statement to print out a message.
IlsException::IlsException | ( | const IlsException & | rhs | ) |
This copy constructor copies an instance of a message.
If the message in rhs
is marked to be destroyed on deletion of rhs
, the message is copied into the new instance.
const char* IlsException::getMessage | ( | ) | const |
This member function returns the message, if any, contained in the exception.
This can be used to print an error message, potentially containing extra information, when the exception is caught. An example of this is shown below:
IlsBoolean IlsException::operator== | ( | const IlsException & | rhs | ) | const |
This copy operator copies the exception rhs
.
If the message in rhs
is marked to be destroyed on deletion of rhs
, then the message is copied into the new instance.
void IlsException::setMessage | ( | const char * | message | ) |
This member function changes the message in an exception.
If the old message is marked as deletable, then it is deleted and the new message is copied. The message is always copied when this member function is called.