summaryrefslogtreecommitdiff
path: root/doc/html/RtError_8h-source.html
blob: 7d28615a493780e68a6a0632733cb63bf45272a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<HTML>
<HEAD>
<TITLE>The RtAudio Home Page</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<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>
<HR>
<!-- Generated by Doxygen 1.4.4 -->
<h1>RtError.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/************************************************************************/</span>
<a name="l00010"></a>00010 <span class="comment">/************************************************************************/</span>
<a name="l00011"></a>00011 
<a name="l00012"></a>00012 <span class="preprocessor">#ifndef RTERROR_H</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define RTERROR_H</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;exception&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00018"></a>00018 
<a name="l00019"></a><a class="code" href="classRtError.html">00019</a> <span class="keyword">class </span><a class="code" href="classRtError.html">RtError</a> : <span class="keyword">public</span> std::exception
<a name="l00020"></a>00020 {
<a name="l00021"></a>00021  <span class="keyword">public</span>:
<a name="l00023"></a><a class="code" href="classRtError.html#w9">00023</a>   <span class="keyword">enum</span> <a class="code" href="classRtError.html#w9">Type</a> {
<a name="l00024"></a>00024     <a class="code" href="classRtError.html#w9w0">UNSPECIFIED</a>,       
<a name="l00025"></a>00025     <a class="code" href="classRtError.html#w9w1">NO_DEVICES_FOUND</a>,  
<a name="l00026"></a>00026     <a class="code" href="classRtError.html#w9w2">INVALID_DEVICE</a>,    
<a name="l00027"></a>00027     <a class="code" href="classRtError.html#w9w3">MEMORY_ERROR</a>,      
<a name="l00028"></a>00028     <a class="code" href="classRtError.html#w9w4">INVALID_PARAMETER</a>, 
<a name="l00029"></a>00029     <a class="code" href="classRtError.html#w9w5">INVALID_USE</a>,       
<a name="l00030"></a>00030     <a class="code" href="classRtError.html#w9w6">DRIVER_ERROR</a>,      
<a name="l00031"></a>00031     <a class="code" href="classRtError.html#w9w7">SYSTEM_ERROR</a>,      
<a name="l00032"></a><a class="code" href="classRtError.html#w9w8">00032</a>     <a class="code" href="classRtError.html#w9w8">THREAD_ERROR</a>       
<a name="l00033"></a>00033   };
<a name="l00034"></a>00034 
<a name="l00036"></a><a class="code" href="classRtError.html#a0">00036</a>   <a class="code" href="classRtError.html#a0">RtError</a>( <span class="keyword">const</span> std::string&amp; message, <a class="code" href="classRtError.html#w9">Type</a> type = <a class="code" href="classRtError.html#w9w0">RtError::UNSPECIFIED</a> ) throw() : message_(message), type_(type) {}
<a name="l00037"></a>00037  
<a name="l00039"></a><a class="code" href="classRtError.html#a1">00039</a>   <span class="keyword">virtual</span> <a class="code" href="classRtError.html#a1">~RtError</a>( <span class="keywordtype">void</span> ) throw() {}
<a name="l00040"></a>00040 
<a name="l00042"></a><a class="code" href="classRtError.html#a2">00042</a>   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtError.html#a2">printMessage</a>( <span class="keywordtype">void</span> ) throw() { std::cerr &lt;&lt; <span class="charliteral">'\n'</span> &lt;&lt; message_ &lt;&lt; <span class="stringliteral">"\n\n"</span>; }
<a name="l00043"></a>00043 
<a name="l00045"></a><a class="code" href="classRtError.html#a3">00045</a>   <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classRtError.html#w9">Type</a>&amp; <a class="code" href="classRtError.html#a3">getType</a>(<span class="keywordtype">void</span>) throw() { <span class="keywordflow">return</span> type_; }
<a name="l00046"></a>00046 
<a name="l00048"></a><a class="code" href="classRtError.html#a4">00048</a>   <span class="keyword">virtual</span> <span class="keyword">const</span> std::string&amp; <a class="code" href="classRtError.html#a4">getMessage</a>(<span class="keywordtype">void</span>) throw() { <span class="keywordflow">return</span> message_; }
<a name="l00049"></a>00049 
<a name="l00051"></a><a class="code" href="classRtError.html#a5">00051</a>   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classRtError.html#a5">what</a>( <span class="keywordtype">void</span> ) const throw() { <span class="keywordflow">return</span> message_.c_str(); }
<a name="l00052"></a>00052 
<a name="l00053"></a>00053  <span class="keyword">protected</span>:
<a name="l00054"></a>00054   std::string message_;
<a name="l00055"></a>00055   <a class="code" href="classRtError.html#w9">Type</a> type_;
<a name="l00056"></a>00056 };
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 <span class="preprocessor">#endif</span>
</pre></div><HR>

<table><tr><td><img src="../images/mcgill.gif" width=165></td>
  <td>&copy;2001-2007 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>
</table>

</BODY>
</HTML>