rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWTTHRCompatibleException< Exception > Class Template Reference
[Thread-compatible Exceptions]

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

List of all members.

Public Member Functions

 RWTTHRCompatibleException (const Exception &exception)
 RWTTHRCompatibleException (const RWTTHRCompatibleException< Exception > &second)
 ~RWTTHRCompatibleException (void)
 operator Exception (void) const
RWTTHRCompatibleException
< Exception > & 
operator= (const RWTTHRCompatibleException< Exception > &second)
virtual RWTHRxmsgclone (void) const
virtual void raise (void) const

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 {};
 throw RWTTHRCompatibleException<MyException>(MyException());

Constructor & Destructor Documentation

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

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

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.

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

Destructor.


Member Function Documentation

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

Makes a copy of this so it can be stored.

Reimplemented from RWTHRxmsg.

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

Cast operator. Returns internal Exception instance.

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

Copies the internal exception within second to self.

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

Throws the exception stored in this.

Reimplemented from RWTHRxmsg.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© 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.