SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWTTHRCompatibleException< Exception > Class Template Reference

Template class for creating a thread-compatible exception from an existing exception class. More...

#include <rw/threxcept/RWTTHRCompatibleException.h>

Inheritance diagram for RWTTHRCompatibleException< Exception >:
RWTHRxmsg RWxmsg

Public Member Functions

 RWTTHRCompatibleException (const Exception &exception)
 
 RWTTHRCompatibleException (const RWTTHRCompatibleException< Exception > &second)
 
 ~RWTTHRCompatibleException (void)
 
virtual RWTHRxmsgclone (void) const
 
 operator Exception (void) const
 
RWTTHRCompatibleException< Exception > & operator= (const RWTTHRCompatibleException< Exception > &second)
 
virtual void raise (void) const
 
- Public Member Functions inherited from RWTHRxmsg
 RWTHRxmsg (const RWCString &msg)
 
 RWTHRxmsg (const RWTHRxmsg &second)
 
 RWTHRxmsg (void)
 
virtual ~RWTHRxmsg (void)
 
RWTHRxmsgoperator= (const RWTHRxmsg &second)
 
- Public Member Functions inherited from RWxmsg
 RWxmsg (const char *msg)
 
 RWxmsg (const RWxmsg &msg)
 
 RWxmsg (RWxmsg &&msg)
 
RWxmsgoperator= (const RWxmsg &)
 
RWxmsgoperator= (RWxmsg &&msg)
 
void swap (RWxmsg &rhs)
 
virtual const char * why () const
 

Additional Inherited Members

- Protected Member Functions inherited from RWxmsg
 RWxmsg (const char *msg, bool doCopy)
 

Detailed Description

template<class Exception>
class RWTTHRCompatibleException< Exception >

RWTTHRCompatibleException<Exception> is a template class that can be used to create a thread-compatible exception from an existing exception class. A thread-compatible exception is derived from RWTHRxmsg, and possesses clone() and raise() members that allow for a copy of the exception to be stored so that it may be rethrown in the future. The ability to rethrow exceptions in the future allows exceptions to be passed across thread boundaries.

Synopsis
#include <rw/threxcept/RWTTHRCompatibleException.h>
class MyException {};
RWTTHRCompatibleException(const Exception &exception)

Constructor & Destructor Documentation

◆ RWTTHRCompatibleException() [1/2]

template<class Exception >
RWTTHRCompatibleException< Exception >::RWTTHRCompatibleException ( const Exception & exception)

Constructs a new instance, initializing the internal exception instance to exception.

◆ RWTTHRCompatibleException() [2/2]

template<class Exception >
RWTTHRCompatibleException< Exception >::RWTTHRCompatibleException ( const RWTTHRCompatibleException< Exception > & second)

Copy constructor. Constructs a new instance whose exception value is initialized from the exception within second.

◆ ~RWTTHRCompatibleException()

template<class Exception >
RWTTHRCompatibleException< Exception >::~RWTTHRCompatibleException ( void )

Destructor.

Member Function Documentation

◆ clone()

template<class Exception >
virtual RWTHRxmsg * RWTTHRCompatibleException< Exception >::clone ( void ) const
virtual

Makes a copy of this so it can be stored.

Reimplemented from RWTHRxmsg.

◆ operator Exception()

template<class Exception >
RWTTHRCompatibleException< Exception >::operator Exception ( void ) const

Cast operator. Returns internal Exception instance.

◆ operator=()

template<class Exception >
RWTTHRCompatibleException< Exception > & RWTTHRCompatibleException< Exception >::operator= ( const RWTTHRCompatibleException< Exception > & second)

Copies the internal exception within second to self.

◆ raise()

template<class Exception >
virtual void RWTTHRCompatibleException< Exception >::raise ( void ) const
virtual

Throws the exception stored in this.

Reimplemented from RWTHRxmsg.

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