Canorus 0.0
Public Types | Public Member Functions | Protected Attributes | List of all members
RtError Class Reference

Exception handling class for RtAudio & RtMidi. More...

#include <RtError.h>

Public Types

enum  Type {
  WARNING , DEBUG_WARNING , UNSPECIFIED , NO_DEVICES_FOUND ,
  INVALID_DEVICE , INVALID_STREAM , MEMORY_ERROR , INVALID_PARAMETER ,
  DRIVER_ERROR , SYSTEM_ERROR , THREAD_ERROR
}
 Defined RtError types. More...
 

Public Member Functions

 RtError (const std::string &message, Type type=RtError::UNSPECIFIED)
 The constructor. More...
 
virtual ~RtError (void)
 The destructor. More...
 
virtual void printMessage (void)
 Prints thrown error message to stderr. More...
 
virtual const TypegetType (void)
 Returns the thrown error message type. More...
 
virtual const std::string & getMessage (void)
 Returns the thrown error message string. More...
 
virtual const char * getMessageString (void)
 Returns the thrown error message as a C string. More...
 

Protected Attributes

std::string message_
 
Type type_
 

Detailed Description

Exception handling class for RtAudio & RtMidi.

The RtError class is quite simple but it does allow errors to be "caught" by RtError::Type. See the RtAudio and RtMidi documentation to know which methods can throw an RtError.

Member Enumeration Documentation

◆ Type

Defined RtError types.

Enumerator
WARNING 

A non-critical error.

DEBUG_WARNING 

A non-critical error which might be useful for debugging.

UNSPECIFIED 

The default, unspecified error type.

NO_DEVICES_FOUND 

No devices found on system.

INVALID_DEVICE 

An invalid device ID was specified.

INVALID_STREAM 

An invalid stream ID was specified.

MEMORY_ERROR 

An error occured during memory allocation.

INVALID_PARAMETER 

An invalid parameter was specified to a function.

DRIVER_ERROR 

A system driver error occured.

SYSTEM_ERROR 

A system error occured.

THREAD_ERROR 

A thread error occured.

Constructor & Destructor Documentation

◆ RtError()

RtError::RtError ( const std::string &  message,
Type  type = RtError::UNSPECIFIED 
)
inline

The constructor.

◆ ~RtError()

virtual RtError::~RtError ( void  )
inlinevirtual

The destructor.

Member Function Documentation

◆ getMessage()

virtual const std::string & RtError::getMessage ( void  )
inlinevirtual

Returns the thrown error message string.

References message_.

◆ getMessageString()

virtual const char * RtError::getMessageString ( void  )
inlinevirtual

Returns the thrown error message as a C string.

References message_.

◆ getType()

virtual const Type & RtError::getType ( void  )
inlinevirtual

Returns the thrown error message type.

References type_.

◆ printMessage()

virtual void RtError::printMessage ( void  )
inlinevirtual

Member Data Documentation

◆ message_

std::string RtError::message_
protected

◆ type_

Type RtError::type_
protected

Referenced by getType().


The documentation for this class was generated from the following file: