SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches

Base class for the hierarchy of exceptions in the Essential Tools Module. More...

#include <rw/rwerr.h>

Inheritance diagram for RWxmsg:
RWExternalErr RWInternalErr RWMimeError RWTHRxmsg RWTraceClientAlreadyAdded RWTraceClientAlreadyConnected RWTraceClientNotConnected RWTraceInvalidClient RWTraceInvalidPointer RWUException RWxalloc

Public Member Functions

 RWxmsg (const char *msg)
 
 RWxmsg (const RWxmsg &msg)
 
 RWxmsg (RWxmsg &&msg)
 
RWxmsgoperator= (const RWxmsg &)
 
RWxmsgoperator= (RWxmsg &&msg)
 
virtual void raise () const
 
void swap (RWxmsg &rhs)
 
virtual const char * why () const
 

Protected Member Functions

 RWxmsg (const char *msg, bool doCopy)
 

Related Symbols

(Note that these are not member symbols.)

#define RWTHROW(a)
 

Detailed Description

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.

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.

Synopsis
#include <rw/rwerr.h>
RWxmsg x("exception message");
Base class for the hierarchy of exceptions in the Essential Tools Module.
Definition rwerr.h:57
Persistence
None

Constructor & Destructor Documentation

◆ RWxmsg() [1/4]

RWxmsg::RWxmsg ( const char * msg)

Creates an exception that returns msg when its why() method is called.

◆ RWxmsg() [2/4]

RWxmsg::RWxmsg ( const RWxmsg & msg)

Copy constructor.

◆ RWxmsg() [3/4]

RWxmsg::RWxmsg ( RWxmsg && msg)

Move constructor. The constructed instance takes ownership of the data owned by msg.

Condition:
This method is available only on platforms with rvalue reference support.

◆ RWxmsg() [4/4]

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.

Member Function Documentation

◆ operator=() [1/2]

RWxmsg & RWxmsg::operator= ( const RWxmsg & )

Assignment operator.

◆ operator=() [2/2]

RWxmsg & RWxmsg::operator= ( RWxmsg && msg)

Move assignment. Self takes ownership of the data owned by msg.

Condition:
This method is available only on platforms with rvalue reference support.

◆ raise()

◆ swap()

void RWxmsg::swap ( RWxmsg & rhs)

Swaps the data owned by self with the data owned by rhs.

◆ why()

virtual const char * RWxmsg::why ( ) const
virtual

Returns the message string contained in self.

Friends And Related Symbol Documentation

◆ RWTHROW

#define RWTHROW ( a)
related

RWTHROW() throws the exception a.

Deprecated
As of SourcePro 2022.1, this function has been deprecated because SourcePro no longer calls the set error handler, and calling this function has no effect.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.