Sophie

Sophie

distrib > Mandriva > 2010.0 > x86_64 > media > main-release > by-pkgid > f250c16c2b84c9364a2f35a71121aaa2 > files > 300

lib64dirac-devel-1.0.2-2mdv2010.0.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Dirac Video Codec</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<h1 align="center" color="#606080">
Dirac - A Video Codec
</h1>
<p align="center">
Created by the <a href="http://www.bbc.co.uk">British Broadcasting Corporation</a>.
</p>
<hr>
<!-- Generated by Doxygen 1.5.9 -->
<h1>dirac_exception.h</h1><a href="a00183.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* ***** BEGIN LICENSE BLOCK *****</span>
<a name="l00002"></a>00002 <span class="comment">*</span>
<a name="l00003"></a>00003 <span class="comment">* $Id: dirac_exception.h,v 1.6 2008/01/31 11:25:16 tjdwave Exp $ $Name: Dirac_1_0_2 $</span>
<a name="l00004"></a>00004 <span class="comment">*</span>
<a name="l00005"></a>00005 <span class="comment">* Version: MPL 1.1/GPL 2.0/LGPL 2.1</span>
<a name="l00006"></a>00006 <span class="comment">*</span>
<a name="l00007"></a>00007 <span class="comment">* The contents of this file are subject to the Mozilla Public License</span>
<a name="l00008"></a>00008 <span class="comment">* Version 1.1 (the "License"); you may not use this file except in compliance</span>
<a name="l00009"></a>00009 <span class="comment">* with the License. You may obtain a copy of the License at</span>
<a name="l00010"></a>00010 <span class="comment">* http://www.mozilla.org/MPL/</span>
<a name="l00011"></a>00011 <span class="comment">*</span>
<a name="l00012"></a>00012 <span class="comment">* Software distributed under the License is distributed on an "AS IS" basis,</span>
<a name="l00013"></a>00013 <span class="comment">* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for</span>
<a name="l00014"></a>00014 <span class="comment">* the specific language governing rights and limitations under the License.</span>
<a name="l00015"></a>00015 <span class="comment">*</span>
<a name="l00016"></a>00016 <span class="comment">* The Original Code is BBC Research and Development code.</span>
<a name="l00017"></a>00017 <span class="comment">*</span>
<a name="l00018"></a>00018 <span class="comment">* The Initial Developer of the Original Code is the British Broadcasting</span>
<a name="l00019"></a>00019 <span class="comment">* Corporation.</span>
<a name="l00020"></a>00020 <span class="comment">* Portions created by the Initial Developer are Copyright (C) 2004.</span>
<a name="l00021"></a>00021 <span class="comment">* All Rights Reserved.</span>
<a name="l00022"></a>00022 <span class="comment">*</span>
<a name="l00023"></a>00023 <span class="comment">* Contributor(s): Andrew Kennedy (Original Author)</span>
<a name="l00024"></a>00024 <span class="comment">*</span>
<a name="l00025"></a>00025 <span class="comment">* Alternatively, the contents of this file may be used under the terms of</span>
<a name="l00026"></a>00026 <span class="comment">* the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser</span>
<a name="l00027"></a>00027 <span class="comment">* Public License Version 2.1 (the "LGPL"), in which case the provisions of</span>
<a name="l00028"></a>00028 <span class="comment">* the GPL or the LGPL are applicable instead of those above. If you wish to</span>
<a name="l00029"></a>00029 <span class="comment">* allow use of your version of this file only under the terms of the either</span>
<a name="l00030"></a>00030 <span class="comment">* the GPL or LGPL and not to allow others to use your version of this file</span>
<a name="l00031"></a>00031 <span class="comment">* under the MPL, indicate your decision by deleting the provisions above</span>
<a name="l00032"></a>00032 <span class="comment">* and replace them with the notice and other provisions required by the GPL</span>
<a name="l00033"></a>00033 <span class="comment">* or LGPL. If you do not delete the provisions above, a recipient may use</span>
<a name="l00034"></a>00034 <span class="comment">* your version of this file under the terms of any one of the MPL, the GPL</span>
<a name="l00035"></a>00035 <span class="comment">* or the LGPL.</span>
<a name="l00036"></a>00036 <span class="comment">* ***** END LICENSE BLOCK ***** */</span>
<a name="l00037"></a>00037 
<a name="l00041"></a>00041 <span class="preprocessor">#ifndef DiracException_h</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define DiracException_h</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span>
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="comment">// SYSTEM INCLUDES</span>
<a name="l00046"></a>00046 <span class="comment">//</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &lt;string&gt;</span>                           <span class="comment">// has a string</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;iostream&gt;</span>                          <span class="comment">// has an ostringstream</span>
<a name="l00049"></a>00049 
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 <span class="keyword">namespace </span>dirac {
<a name="l00052"></a>00052 
<a name="l00058"></a><a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd">00058</a>     <span class="keyword">enum</span> <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd" title="Enumeration of Dirac-defined error codes.">DiracErrorCode</a> {
<a name="l00059"></a><a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd4b97f65ae09bd95ed1d382af3c7e9afd">00059</a>         <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd4b97f65ae09bd95ed1d382af3c7e9afd">ERR_UNSUPPORTED_STREAM_DATA</a>=0,
<a name="l00060"></a><a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cdbf38203f06a7ae1634a480333b648722">00060</a>         <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cdbf38203f06a7ae1634a480333b648722">ERR_END_OF_STREAM</a>,
<a name="l00061"></a><a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cde186ea87aba50f4dec6735741874ec90">00061</a>         <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cde186ea87aba50f4dec6735741874ec90">ERR_INVALID_VIDEO_FORMAT</a>,
<a name="l00062"></a><a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cdfc4cab98475a9cf6c4241879957ede88">00062</a>         <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cdfc4cab98475a9cf6c4241879957ede88">ERR_INVALID_CHROMA_FORMAT</a>,
<a name="l00063"></a><a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd02991bdd42ad10673d79c50f3f21ea2d">00063</a>         <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd02991bdd42ad10673d79c50f3f21ea2d">ERR_INVALID_PICTURE_RATE</a>,
<a name="l00064"></a><a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd858c06c0bb32a77e632123c4c26a0bdb">00064</a>         <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd858c06c0bb32a77e632123c4c26a0bdb">ERR_INVALID_SIGNAL_RANGE</a>,
<a name="l00065"></a><a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd5e7237ac3b59cf74b39f3fc08e5cf965">00065</a>         <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd5e7237ac3b59cf74b39f3fc08e5cf965">ERR_INVALID_PIXEL_ASPECT_RATIO</a>,
<a name="l00066"></a><a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd69c68c09a279c7cf52316203da1a1656">00066</a>         <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd69c68c09a279c7cf52316203da1a1656">ERR_INVALID_VIDEO_DEPTH</a>,
<a name="l00067"></a><a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd33e43c2b77840f6cccb89644c46db2ed">00067</a>         <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd33e43c2b77840f6cccb89644c46db2ed">ERR_INVALID_MOTION_VECTOR_PRECISION</a>,
<a name="l00068"></a><a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd2178e08c2336c53246702f0d9ae16bc9">00068</a>         <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd2178e08c2336c53246702f0d9ae16bc9">ERR_INVALID_INIT_DATA</a>
<a name="l00069"></a>00069 
<a name="l00070"></a>00070     };
<a name="l00071"></a>00071 
<a name="l00075"></a><a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf8">00075</a>     <span class="keyword">enum</span> <a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf8" title="Error-severity states.">DiracSeverityCode</a> {
<a name="l00076"></a><a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf8a436f58062280abe42d3fe0069ae3be3">00076</a>         <a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf8a436f58062280abe42d3fe0069ae3be3">SEVERITY_NO_ERROR</a>=0,
<a name="l00077"></a><a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf85779de16a3320c91142a6c2c36e8e355">00077</a>         <a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf85779de16a3320c91142a6c2c36e8e355">SEVERITY_WARNING</a>,
<a name="l00078"></a><a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf82e57a00eed0fe008be5789af26e03145">00078</a>         <a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf82e57a00eed0fe008be5789af26e03145">SEVERITY_PICTURE_ERROR</a>,
<a name="l00079"></a><a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf81640e47a5b2374ae9fe283c4d5a79165">00079</a>         <a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf81640e47a5b2374ae9fe283c4d5a79165">SEVERITY_ACCESSUNIT_ERROR</a>,
<a name="l00080"></a><a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf86696a9745878c557baf85d5159429d8e">00080</a>         <a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf86696a9745878c557baf85d5159429d8e">SEVERITY_SEQUENCE_ERROR</a>,
<a name="l00081"></a><a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf82c1963aad626e9c93661ab37a343b16c">00081</a>         <a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf82c1963aad626e9c93661ab37a343b16c">SEVERITY_TERMINATE</a>
<a name="l00082"></a>00082     };
<a name="l00083"></a>00083 
<a name="l00088"></a><a class="code" href="a00051.html">00088</a> <span class="keyword">class </span><a class="code" href="a00051.html" title="DiracException is the class which should be used for all exceptions within Dirac...">DiracException</a>
<a name="l00089"></a>00089 {
<a name="l00090"></a>00090 <span class="keyword">public</span>:
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 
<a name="l00100"></a>00100     <a class="code" href="a00051.html#85947cbe925df6946063e6a827f872b7" title="Construct from error source ID, error code, and message.">DiracException</a>(
<a name="l00101"></a>00101         <span class="keyword">const</span> <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd" title="Enumeration of Dirac-defined error codes.">DiracErrorCode</a>&amp; errorCode,
<a name="l00102"></a>00102         <span class="keyword">const</span> std::string&amp; errorMessage,
<a name="l00103"></a>00103         <span class="keyword">const</span> <a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf8" title="Error-severity states.">DiracSeverityCode</a>&amp; severityCode);
<a name="l00104"></a>00104 
<a name="l00108"></a>00108     <a class="code" href="a00051.html#85947cbe925df6946063e6a827f872b7" title="Construct from error source ID, error code, and message.">DiracException</a>(
<a name="l00109"></a>00109         <span class="keyword">const</span> <a class="code" href="a00051.html" title="DiracException is the class which should be used for all exceptions within Dirac...">DiracException</a>&amp; src);
<a name="l00110"></a>00110 
<a name="l00114"></a>00114     <span class="keyword">virtual</span> <a class="code" href="a00051.html#8c46b78176839b329f3bb3381612d155" title="Destructor.">~DiracException</a>();
<a name="l00115"></a>00115 
<a name="l00116"></a>00116 
<a name="l00117"></a>00117 <span class="comment">// OPERATORS</span>
<a name="l00118"></a>00118 
<a name="l00119"></a>00119 
<a name="l00120"></a>00120 <span class="comment">// ACCESS</span>
<a name="l00121"></a>00121 
<a name="l00127"></a>00127     <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd" title="Enumeration of Dirac-defined error codes.">DiracErrorCode</a> <a class="code" href="a00051.html#8404b8be9159c9f142126c150d4201c0" title="Get the error code of this exception.">GetErrorCode</a>() <span class="keyword">const</span>;
<a name="l00128"></a>00128 
<a name="l00134"></a>00134     <a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf8" title="Error-severity states.">DiracSeverityCode</a> <a class="code" href="a00051.html#14ae8d3978837c38637ffa44731cdc8e" title="Get the severity level of this exception.">GetSeverityCode</a>() <span class="keyword">const</span>;
<a name="l00135"></a>00135 
<a name="l00141"></a>00141     std::string <a class="code" href="a00051.html#a0222a0ce3c084229add63b2f2aae9b3" title="Get the error message of this exception.">GetErrorMessage</a>() <span class="keyword">const</span>;
<a name="l00142"></a>00142 
<a name="l00143"></a>00143 
<a name="l00144"></a>00144 
<a name="l00145"></a>00145 <span class="keyword">private</span>:
<a name="l00146"></a>00146 
<a name="l00147"></a>00147 <span class="comment">// ATTRIBUTES</span>
<a name="l00148"></a>00148 
<a name="l00152"></a><a class="code" href="a00051.html#ca5a543ce9a956785d73fd485d27742f">00152</a>     <a class="code" href="a00234.html#68bfba0249cdd7e438ac8ed588f785cd" title="Enumeration of Dirac-defined error codes.">DiracErrorCode</a> <a class="code" href="a00051.html#ca5a543ce9a956785d73fd485d27742f" title="The error code of this exception.">mErrorCode</a>;
<a name="l00153"></a>00153 
<a name="l00157"></a><a class="code" href="a00051.html#f5bf16eb33d1b8e76883f73971fa242d">00157</a>     <a class="code" href="a00234.html#5b2725f7cc7ff3e6e9dbb33508089bf8" title="Error-severity states.">DiracSeverityCode</a> <a class="code" href="a00051.html#f5bf16eb33d1b8e76883f73971fa242d" title="Severity of exception.">mSeverityCode</a>;
<a name="l00158"></a>00158 
<a name="l00162"></a><a class="code" href="a00051.html#2b3df525ca60baff791889c611a716b8">00162</a>     std::string <a class="code" href="a00051.html#2b3df525ca60baff791889c611a716b8" title="The error message.">mErrorMessage</a>;
<a name="l00163"></a>00163 
<a name="l00164"></a>00164     
<a name="l00165"></a>00165 
<a name="l00166"></a>00166 <span class="comment">// UNIMPLEMENTED METHODS</span>
<a name="l00167"></a>00167     <a class="code" href="a00051.html" title="DiracException is the class which should be used for all exceptions within Dirac...">DiracException</a>&amp; <a class="code" href="a00051.html#fb6ce82a53fdea06582e91d942366810">operator=</a>(<span class="keyword">const</span> <a class="code" href="a00051.html" title="DiracException is the class which should be used for all exceptions within Dirac...">DiracException</a>&amp;);
<a name="l00168"></a>00168 
<a name="l00169"></a>00169 }; <span class="comment">// class DiracException</span>
<a name="l00170"></a>00170 
<a name="l00171"></a>00171 
<a name="l00172"></a>00172 
<a name="l00173"></a>00173 
<a name="l00174"></a>00174 
<a name="l00175"></a>00175 <span class="comment">// GLOBAL OPERATORS</span>
<a name="l00176"></a>00176 <span class="comment">//</span>
<a name="l00177"></a>00177 std::ostream&amp; <a class="code" href="a00234.html#06a3689cd310a188f84b8a21590636fc" title="A function for extracting array data.">operator&lt;&lt;</a>(std::ostream&amp; dst, <span class="keyword">const</span> <a class="code" href="a00051.html" title="DiracException is the class which should be used for all exceptions within Dirac...">DiracException</a>&amp; exception);
<a name="l00178"></a>00178 
<a name="l00179"></a>00179 
<a name="l00180"></a>00180 <span class="comment">// MACROS FOR LOGGING AND THROWING DIRAC EXCEPTIONS</span>
<a name="l00181"></a>00181 <span class="comment">//</span>
<a name="l00182"></a>00182 
<a name="l00183"></a>00183 
<a name="l00187"></a><a class="code" href="a00183.html#69836693e7ce0109853cb6cd589d90f3">00187</a> <span class="preprocessor">#define DIRAC_LOG_EXCEPTION(exception)                           \</span>
<a name="l00188"></a>00188 <span class="preprocessor">    {                                                                   \</span>
<a name="l00189"></a>00189 <span class="preprocessor">       if(exception.GetSeverityCode()!=SEVERITY_NO_ERROR)       \</span>
<a name="l00190"></a>00190 <span class="preprocessor">            std::cerr &lt;&lt; exception.GetErrorMessage();          \</span>
<a name="l00191"></a>00191 <span class="preprocessor">    }</span>
<a name="l00192"></a>00192 <span class="preprocessor"></span>
<a name="l00196"></a><a class="code" href="a00183.html#4b789865f6990b8be2f430b08886d015">00196</a> <span class="preprocessor">#define DIRAC_THROW_EXCEPTION(arg1,arg2,arg3)                          \</span>
<a name="l00197"></a>00197 <span class="preprocessor">    {                                                                   \</span>
<a name="l00198"></a>00198 <span class="preprocessor">        DiracException exception(arg1,arg2, arg3);      \</span>
<a name="l00199"></a>00199 <span class="preprocessor">        DIRAC_LOG_EXCEPTION(exception)  \</span>
<a name="l00200"></a>00200 <span class="preprocessor">        throw exception;                        \</span>
<a name="l00201"></a>00201 <span class="preprocessor">    }</span>
<a name="l00202"></a>00202 <span class="preprocessor"></span>
<a name="l00206"></a><a class="code" href="a00183.html#db6e56257b99e555df22cd8040ad97f2">00206</a> <span class="preprocessor">#define DIRAC_CATCH_AND_RETHROW()                                 \</span>
<a name="l00207"></a>00207 <span class="preprocessor">    catch (const DiracException&amp; e) {                                     \</span>
<a name="l00208"></a>00208 <span class="preprocessor">        DiracException exception(e);           \</span>
<a name="l00209"></a>00209 <span class="preprocessor">        DIRAC_LOG_EXCEPTION(exception)\</span>
<a name="l00210"></a>00210 <span class="preprocessor">        throw exception;                     \</span>
<a name="l00211"></a>00211 <span class="preprocessor">    }</span>
<a name="l00212"></a>00212 <span class="preprocessor"></span>
<a name="l00213"></a>00213 } <span class="comment">// namespace Dirac</span>
<a name="l00214"></a>00214 
<a name="l00215"></a>00215 <span class="preprocessor">#endif // DiracException_h</span>
</pre></div></div>
<hr>
<p align="center"><small>
&copy; 2004 British Broadcasting Corporation.
Dirac code licensed under the <a href="http://www.mozilla.org/MPL/">Mozilla Public License (MPL) Version 1.1</a>.<br>
HTML documentation generated by Dimitri van Heesch's
excellent <a href="http://www.doxygen.org">Doxygen</a> tool.
</small></p>
</body>
</html>