You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
4.7KB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>The RtAudio Tutorial</TITLE>
  4. <LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
  5. </HEAD>
  6. <BODY BGCOLOR="#FFFFFF">
  7. <CENTER>
  8. <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>
  9. <HR>
  10. <!-- Generated by Doxygen 1.3.4 -->
  11. <h1>RtError.h</h1><div class="fragment"><pre>00001 <span class="comment">/************************************************************************/</span>
  12. 00010 <span class="comment">/************************************************************************/</span>
  13. 00011
  14. 00012 <span class="preprocessor">#ifndef RTERROR_H</span>
  15. 00013 <span class="preprocessor"></span><span class="preprocessor">#define RTERROR_H</span>
  16. 00014 <span class="preprocessor"></span>
  17. 00015 <span class="preprocessor">#include &lt;iostream&gt;</span>
  18. 00016 <span class="preprocessor">#include &lt;string&gt;</span>
  19. 00017
  20. <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>
  21. 00019 {
  22. 00020 <span class="keyword">public</span>:
  23. <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> {
  24. 00023 <a class="code" href="classRtError.html#w11w0">WARNING</a>,
  25. 00024 <a class="code" href="classRtError.html#w11w1">DEBUG_WARNING</a>,
  26. 00025 <a class="code" href="classRtError.html#w11w2">UNSPECIFIED</a>,
  27. 00026 <a class="code" href="classRtError.html#w11w3">NO_DEVICES_FOUND</a>,
  28. 00027 <a class="code" href="classRtError.html#w11w4">INVALID_DEVICE</a>,
  29. 00028 <a class="code" href="classRtError.html#w11w5">INVALID_STREAM</a>,
  30. 00029 <a class="code" href="classRtError.html#w11w6">MEMORY_ERROR</a>,
  31. 00030 <a class="code" href="classRtError.html#w11w7">INVALID_PARAMETER</a>,
  32. 00031 <a class="code" href="classRtError.html#w11w8">DRIVER_ERROR</a>,
  33. 00032 <a class="code" href="classRtError.html#w11w9">SYSTEM_ERROR</a>,
  34. 00033 <a class="code" href="classRtError.html#w11w10">THREAD_ERROR</a>
  35. 00034 };
  36. 00035
  37. 00036 <span class="keyword">protected</span>:
  38. 00037 std::string message_;
  39. 00038 <a class="code" href="classRtError.html#w11">Type</a> type_;
  40. 00039
  41. 00040 <span class="keyword">public</span>:
  42. <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, Type type = RtError::UNSPECIFIED) : message_(message), type_(type){}
  43. 00043
  44. <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>) {};
  45. 00046
  46. <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>; }
  47. 00049
  48. <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_; }
  49. 00052
  50. <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_; }
  51. 00055
  52. <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(); }
  53. 00058 };
  54. 00059
  55. 00060 <span class="preprocessor">#endif</span>
  56. </pre></div><HR>
  57. <table><tr><td><img src="../images/mcgill.gif" width=165></td>
  58. <td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
  59. Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
  60. </table>
  61. </BODY>
  62. </HTML>