summaryrefslogtreecommitdiff
path: root/doc/html/RtError_8h-source.html
blob: 3211c9aa4c2b86729e7370261b776f91613d2a4b (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
63
64
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</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;iostream&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00017"></a>00017 
<a name="l00018"></a><a class="code" href="classRtError.html">00018</a> <span class="keyword">class </span><a class="code" href="classRtError.html">RtError</a>
<a name="l00019"></a>00019 {
<a name="l00020"></a>00020 <span class="keyword">public</span>:
<a name="l00022"></a><a class="code" href="classRtError.html#w11">00022</a>   <span class="keyword">enum</span> <a class="code" href="classRtError.html#w11">Type</a> {
<a name="l00023"></a>00023     <a class="code" href="classRtError.html#w11w0">WARNING</a>,           
<a name="l00024"></a>00024     <a class="code" href="classRtError.html#w11w1">DEBUG_WARNING</a>,     
<a name="l00025"></a>00025     <a class="code" href="classRtError.html#w11w2">UNSPECIFIED</a>,       
<a name="l00026"></a>00026     <a class="code" href="classRtError.html#w11w3">NO_DEVICES_FOUND</a>,  
<a name="l00027"></a>00027     <a class="code" href="classRtError.html#w11w4">INVALID_DEVICE</a>,    
<a name="l00028"></a>00028     <a class="code" href="classRtError.html#w11w5">INVALID_STREAM</a>,    
<a name="l00029"></a>00029     <a class="code" href="classRtError.html#w11w6">MEMORY_ERROR</a>,      
<a name="l00030"></a>00030     <a class="code" href="classRtError.html#w11w7">INVALID_PARAMETER</a>, 
<a name="l00031"></a>00031     <a class="code" href="classRtError.html#w11w8">DRIVER_ERROR</a>,      
<a name="l00032"></a>00032     <a class="code" href="classRtError.html#w11w9">SYSTEM_ERROR</a>,      
<a name="l00033"></a><a class="code" href="classRtError.html#w11w10">00033</a>     <a class="code" href="classRtError.html#w11w10">THREAD_ERROR</a>       
<a name="l00034"></a>00034   };
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="keyword">protected</span>:
<a name="l00037"></a>00037   std::string message_;
<a name="l00038"></a>00038   <a class="code" href="classRtError.html#w11">Type</a> type_;
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <span class="keyword">public</span>:
<a name="l00042"></a><a class="code" href="classRtError.html#a0">00042</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#w11">Type</a> type = <a class="code" href="classRtError.html#w11w2">RtError::UNSPECIFIED</a>) : message_(message), type_(type) {}
<a name="l00043"></a>00043 
<a name="l00045"></a><a class="code" href="classRtError.html#a1">00045</a>   <span class="keyword">virtual</span> <a class="code" href="classRtError.html#a1">~RtError</a>(<span class="keywordtype">void</span>) {};
<a name="l00046"></a>00046 
<a name="l00048"></a><a class="code" href="classRtError.html#a2">00048</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>) { std::cerr &lt;&lt; <span class="charliteral">'\n'</span> &lt;&lt; message_ &lt;&lt; <span class="stringliteral">"\n\n"</span>; }
<a name="l00049"></a>00049 
<a name="l00051"></a><a class="code" href="classRtError.html#a3">00051</a>   <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classRtError.html#w11">Type</a>&amp; <a class="code" href="classRtError.html#a3">getType</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> type_; }
<a name="l00052"></a>00052 
<a name="l00054"></a><a class="code" href="classRtError.html#a4">00054</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>) { <span class="keywordflow">return</span> message_; }
<a name="l00055"></a>00055 
<a name="l00057"></a><a class="code" href="classRtError.html#a5">00057</a>   <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classRtError.html#a5">getMessageString</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> message_.c_str(); }
<a name="l00058"></a>00058 };
<a name="l00059"></a>00059 
<a name="l00060"></a>00060 <span class="preprocessor">#endif</span>
</pre></div><HR>

<table><tr><td><img src="../images/mcgill.gif" width=165></td>
  <td>&copy;2001-2005 Gary P. Scavone, McGill University. All Rights Reserved.<br>
  Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>

</BODY>
</HTML>