Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

portaudio::PaException Class Reference

#include <Exception.hxx>

Inheritance diagram for portaudio::PaException:

Inheritance graph
[legend]
Collaboration diagram for portaudio::PaException:

Collaboration graph
[legend]
List of all members.

Detailed Description

Wrapper for PortAudio error codes to C++ exceptions.

It wraps up PortAudio's error handling mechanism using C++ exceptions and is derived from std::exception for easy exception handling and to ease integration with other code.

To know what exceptions each function may throw, look up the errors that can occure in the PortAudio documentation for the equivalent functions.

Some functions are likely to throw an exception (such as Stream::open(), etc) and these should always be called in try{} catch{} blocks and the thrown exceptions should be handled properly (ie. the application shouldn't just abort, but merely display a warning dialog to the user or something). However nearly all functions in PortAudioCpp are capable of throwing exceptions. When a function like Stream::isStopped() throws an exception, it's such an exceptional state that it's not likely that it can be recovered. PaExceptions such as these can ``safely'' be left to be handled by some outer catch-all-like mechanism for unrecoverable errors.


Public Member Functions

 PaException (PaError error)
const char * what () const throw ()
PaError paError () const
const char * paErrorText () const
bool isHostApiError () const
long lastHostApiError () const
const char * lastHostApiErrorText () const
bool operator== (const PaException &rhs) const
bool operator!= (const PaException &rhs) const

Private Attributes

PaError error_


Constructor & Destructor Documentation

portaudio::PaException::PaException PaError  error  )  [explicit]
 

Wraps a PortAudio error into a PortAudioCpp PaException.


Member Function Documentation

const char * portaudio::PaException::what  )  const throw () [virtual]
 

Alias for paErrorText(), to have std::exception compliance.

Implements portaudio::Exception.

PaError portaudio::PaException::paError  )  const
 

Returns the PortAudio error code (PaError).

const char * portaudio::PaException::paErrorText  )  const
 

Returns the error as a (zero-terminated) text string.

bool portaudio::PaException::isHostApiError  )  const
 

Returns true is the error is a HostApi error.

long portaudio::PaException::lastHostApiError  )  const
 

Returns the last HostApi error (which is the current one if isHostApiError() returns true) as an error code.

const char * portaudio::PaException::lastHostApiErrorText  )  const
 

Returns the last HostApi error (which is the current one if isHostApiError() returns true) as a (zero-terminated) text string, if it's available.

bool portaudio::PaException::operator== const PaException rhs  )  const
 

bool portaudio::PaException::operator!= const PaException rhs  )  const
 


Member Data Documentation

PaError portaudio::PaException::error_ [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Apr 2 20:22:48 2004 for PortAudioCpp by doxygen 1.3.6