SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Base class for the hierarchy of exceptions in the Essential Tools Module. More...
#include <rw/rwerr.h>
Public Member Functions | |
RWxmsg (const char *msg) | |
RWxmsg (const RWxmsg &msg) | |
virtual const char * | why () const |
virtual void | raise () const |
RWxmsg & | operator= (const RWxmsg &) |
RWxmsg (RWxmsg &&msg) | |
RWxmsg & | operator= (RWxmsg &&msg) |
void | swap (RWxmsg &rhs) |
Protected Member Functions | |
RWxmsg (const char *msg, bool doCopy) | |
Related Functions | |
(Note that these are not member functions.) | |
RWTHROW(a) |
This class is the base class for the hierarchy of exceptions in the Essential Tools Module. (See the section on error reporting and handling in the Essential Tools Module User's Guide.) Although the entire class is documented here, your code usually should not create or directly throw RWxmsg objects. Instead, you should expect to write code that may catch an RWxmsg or one of its derived classes.
Essential Tools Module classes that need to report exceptional circumstances call RWTHROW(). RWTHROW() throws the RWxmsg if exceptions are enabled. Otherwise, RWTHROW() calls an appropriate current Essential Tools Module error handler function (see the section on error reporting and handling in the Essential Tools Module User's Guide).
RWxmsg provides a basic interface for exceptions, from which an exception string is always available. This exception string is obtained through the why() method, and is represented as a const char*
, single-byte character sequence.
#include <rw/rwerr.h> RWxmsg x("exception message");
None
RWxmsg::RWxmsg | ( | const char * | msg | ) |
Creates an exception that returns msg when its why() method is called.
RWxmsg::RWxmsg | ( | const RWxmsg & | msg | ) |
Copy constructor.
RWxmsg::RWxmsg | ( | RWxmsg && | msg | ) |
Move constructor. The constructed instance takes ownership of the data owned by msg.
RWxmsg::RWxmsg | ( | const char * | msg, | |
bool | doCopy | |||
) | [protected] |
Creates an exception that returns msg when its why() method is called. If doCopy is true
, copies msg into a new buffer on the heap, otherwise simply keeps a pointer to the given location of msg.
Move assignment. Self takes ownership of the data owned by msg.
virtual void RWxmsg::raise | ( | ) | const [virtual] |
Calls RWTHROW(), passing self as a parameter.
Reimplemented in RWTHRClosedException, RWCancellation, RWTHRBoundsError, RWTHRExternalError, RWTHRIllegalAccess, RWTHRIllegalUsage, RWTHRInternalError, RWTHRInvalidPointer, RWTHROperationAborted, RWTHROperationCanceled, RWTHROperationNotAvailable, RWTHROperationNotImplemented, RWTHROperationNotSupported, RWTHROperationTerminated, RWTHRPermissionError, RWTHRResourceLimit, RWTHRThreadActive, RWTHRThreadNotActive, RWTHRxmsg, and RWTTHRCompatibleException< Exception >.
void RWxmsg::swap | ( | RWxmsg & | rhs | ) |
Swaps the data owned by self with the data owned by rhs.
virtual const char* RWxmsg::why | ( | ) | const [virtual] |
Returns the message string contained in self.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.