Release 4.0.8 tarball
[rtaudio.git] / doc / html / RtError_8h_source.html
1 <HTML>
2 <HEAD>
3 <TITLE>The RtAudio Home Page</TITLE>
4 <LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
5 <LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico">
6 </HEAD>
7 <BODY BGCOLOR="#FFFFFF">
8 <CENTER>
9 <a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
10 <HR>
11 <!-- Generated by Doxygen 1.6.2 -->
12 <h1>RtError.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/************************************************************************/</span>
13 <a name="l00010"></a>00010 <span class="comment">/************************************************************************/</span>
14 <a name="l00011"></a>00011 
15 <a name="l00012"></a>00012 <span class="preprocessor">#ifndef RTERROR_H</span>
16 <a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define RTERROR_H</span>
17 <a name="l00014"></a>00014 <span class="preprocessor"></span>
18 <a name="l00015"></a>00015 <span class="preprocessor">#include &lt;exception&gt;</span>
19 <a name="l00016"></a>00016 <span class="preprocessor">#include &lt;iostream&gt;</span>
20 <a name="l00017"></a>00017 <span class="preprocessor">#include &lt;string&gt;</span>
21 <a name="l00018"></a>00018 
22 <a name="l00019"></a><a class="code" href="classRtError.html">00019</a> <span class="keyword">class </span><a class="code" href="classRtError.html" title="Exception handling class for RtAudio &amp;amp; RtMidi.">RtError</a> : <span class="keyword">public</span> std::exception
23 <a name="l00020"></a>00020 {
24 <a name="l00021"></a>00021  <span class="keyword">public</span>:
25 <a name="l00023"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac">00023</a>   <span class="keyword">enum</span> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> {
26 <a name="l00024"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca3a1603c24a56cbdaf5f8ae4ddcb86398">00024</a>     <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca3a1603c24a56cbdaf5f8ae4ddcb86398">WARNING</a>,           
27 <a name="l00025"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca20e5a369394d19b704ace17002007eba">00025</a>     <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca20e5a369394d19b704ace17002007eba">DEBUG_WARNING</a>,     
28 <a name="l00026"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca444efd3ccf774b2ba9f9bde70ec71cd6">00026</a>     <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca444efd3ccf774b2ba9f9bde70ec71cd6">UNSPECIFIED</a>,       
29 <a name="l00027"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaf267eb2d710f33d649ba840eeab6ff82">00027</a>     <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaf267eb2d710f33d649ba840eeab6ff82">NO_DEVICES_FOUND</a>,  
30 <a name="l00028"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acad6064062066fffdba258237a7c2159b1">00028</a>     <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acad6064062066fffdba258237a7c2159b1">INVALID_DEVICE</a>,    
31 <a name="l00029"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acab4f813e5a36905c89d4081a59497432e">00029</a>     <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acab4f813e5a36905c89d4081a59497432e">MEMORY_ERROR</a>,      
32 <a name="l00030"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaa3eabf0f71120beaba94148a1b78fed6">00030</a>     <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaa3eabf0f71120beaba94148a1b78fed6">INVALID_PARAMETER</a>, 
33 <a name="l00031"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8e65f51a3fbdc1a4a1552b3260df36bc">00031</a>     <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8e65f51a3fbdc1a4a1552b3260df36bc">INVALID_USE</a>,       
34 <a name="l00032"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca995e97ecf6beeedaba525022a63aec6b">00032</a>     <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca995e97ecf6beeedaba525022a63aec6b">DRIVER_ERROR</a>,      
35 <a name="l00033"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8947d0a2e2a84ecf3646271844e06a6b">00033</a>     <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8947d0a2e2a84ecf3646271844e06a6b">SYSTEM_ERROR</a>,      
36 <a name="l00034"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaeb6282f991e2d93ab294a4272fc3f6c6">00034</a>     <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaeb6282f991e2d93ab294a4272fc3f6c6">THREAD_ERROR</a>       
37 <a name="l00035"></a>00035   };
38 <a name="l00036"></a>00036 
39 <a name="l00038"></a><a class="code" href="classRtError.html#aa479a305ccbe56be0fd9137b9b405a37">00038</a>   <a class="code" href="classRtError.html#aa479a305ccbe56be0fd9137b9b405a37" title="The constructor.">RtError</a>( <span class="keyword">const</span> std::string&amp; message, <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> type = <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca444efd3ccf774b2ba9f9bde70ec71cd6">RtError::UNSPECIFIED</a> ) throw() : message_(message), type_(type) {}
40 <a name="l00039"></a>00039  
41 <a name="l00041"></a><a class="code" href="classRtError.html#a6793e03386e7e69ffafb65a296dfa48c">00041</a>   <span class="keyword">virtual</span> <a class="code" href="classRtError.html#a6793e03386e7e69ffafb65a296dfa48c" title="The destructor.">~RtError</a>( <span class="keywordtype">void</span> ) throw() {}
42 <a name="l00042"></a>00042 
43 <a name="l00044"></a><a class="code" href="classRtError.html#a251dcdac396c998c91706dd2dd3b8bfc">00044</a>   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtError.html#a251dcdac396c998c91706dd2dd3b8bfc" title="Prints thrown error message to stderr.">printMessage</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { std::cerr &lt;&lt; <span class="charliteral">&#39;\n&#39;</span> &lt;&lt; message_ &lt;&lt; <span class="stringliteral">&quot;\n\n&quot;</span>; }
44 <a name="l00045"></a>00045 
45 <a name="l00047"></a><a class="code" href="classRtError.html#a3e316dc9b9b41fe2f64cabf34beb4fe7">00047</a>   <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a>&amp; <a class="code" href="classRtError.html#a3e316dc9b9b41fe2f64cabf34beb4fe7" title="Returns the thrown error message type.">getType</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> type_; }
46 <a name="l00048"></a>00048 
47 <a name="l00050"></a><a class="code" href="classRtError.html#afd067ba6b46edd37f989cad02cd70b50">00050</a>   <span class="keyword">virtual</span> <span class="keyword">const</span> std::string&amp; <a class="code" href="classRtError.html#afd067ba6b46edd37f989cad02cd70b50" title="Returns the thrown error message string.">getMessage</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> message_; }
48 <a name="l00051"></a>00051 
49 <a name="l00053"></a><a class="code" href="classRtError.html#aeb843b7a7785d66061c61ebfc29e7e9d">00053</a>   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classRtError.html#aeb843b7a7785d66061c61ebfc29e7e9d" title="Returns the thrown error message as a c-style string.">what</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> message_.c_str(); }
50 <a name="l00054"></a>00054 
51 <a name="l00055"></a>00055  <span class="keyword">protected</span>:
52 <a name="l00056"></a>00056   std::string message_;
53 <a name="l00057"></a>00057   <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> type_;
54 <a name="l00058"></a>00058 };
55 <a name="l00059"></a>00059 
56 <a name="l00060"></a>00060 <span class="preprocessor">#endif</span>
57 </pre></div></div>
58 <HR>
59
60 <table><tr><td><img src="../images/mcgill.gif" width=165></td>
61   <td>&copy;2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr>
62 </table>
63
64 </BODY>
65 </HTML>