mexlog_8h-source.html

来自「显著区域检测。求的图像中感兴趣区域的位置」· HTML 代码 · 共 100 行

HTML
100
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>SaliencyToolbox: mexLog.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.2 --><div class="tabs">  <ul>    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>    <li class="current"><a href="files.html"><span>Files</span></a></li>  </ul></div><div class="tabs">  <ul>    <li><a href="files.html"><span>File&nbsp;List</span></a></li>    <li><a href="globals.html"><span>Globals</span></a></li>  </ul></div><h1>mexLog.h</h1><a href="mexLog_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00004"></a>00004 <span class="comment">// This file is part of the SaliencyToolbox - Copyright (C) 2006-2007</span><a name="l00005"></a>00005 <span class="comment">// by Dirk B. Walther and the California Institute of Technology.</span><a name="l00006"></a>00006 <span class="comment">// See the enclosed LICENSE.TXT document for the license agreement. </span><a name="l00007"></a>00007 <span class="comment">// More information about this project is available at: </span><a name="l00008"></a>00008 <span class="comment">// http://www.saliencytoolbox.net</span><a name="l00009"></a>00009 <a name="l00010"></a>00010 <span class="preprocessor">#ifndef MEXLOG_H_DEFINED</span><a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define MEXLOG_H_DEFINED</span><a name="l00012"></a>00012 <span class="preprocessor"></span><a name="l00013"></a>00013 <span class="preprocessor">#include &lt;streambuf&gt;</span><a name="l00014"></a>00014 <span class="preprocessor">#include &lt;iostream&gt;</span><a name="l00015"></a>00015 <span class="preprocessor">#include &lt;mex.h&gt;</span><a name="l00016"></a>00016 <a name="l00017"></a><a class="code" href="mexLog_8h.html#092bd7bb2cb7fd9f483b6995cee61bc0">00017</a> <span class="preprocessor">#define ASSERT(exp) if (!(exp)) mexFatal("ASSERT failed in %s at line %d: " \</span><a name="l00018"></a>00018 <span class="preprocessor">                                         #exp,__FILE__,__LINE__);</span><a name="l00019"></a>00019 <span class="preprocessor"></span><a name="l00021"></a>00021 <span class="keywordtype">void</span> <a class="code" href="mexLog_8cpp.html#c165d9b7c0b7acc9709c3cfd972e2703" title="writes an info message to mexPrintf">mexInfo</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt,...);<a name="l00022"></a>00022 <a name="l00024"></a>00024 <span class="keywordtype">void</span> <a class="code" href="mexLog_8cpp.html#0ad98cb2a2d8361d55f70d233e68276b" title="writes an error message">mexError</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt,...);<a name="l00025"></a>00025 <a name="l00027"></a>00027 <span class="keywordtype">void</span> <a class="code" href="mexLog_8cpp.html#c481c8d9ffe7644bd9a0923a84264cd3" title="writes an error message and leaved the mex file">mexFatal</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt,...);<a name="l00028"></a>00028 <a name="l00030"></a>00030 <span class="keywordtype">void</span> <a class="code" href="mexLog_8cpp.html#b4a76bba0d5c3a286086a6022b4056da" title="writes a debug message">mexDebug</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt,...);<a name="l00031"></a>00031 <a name="l00032"></a>00032 <span class="comment">// ######################################################################</span><a name="l00034"></a><a class="code" href="classMexBuf.html">00034</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="classMexBuf.html" title="This streambuf is used to re-direct cout and cerr.">MexBuf</a> : <span class="keyword">public</span> std::streambuf<a name="l00035"></a>00035 {<a name="l00036"></a>00036  <span class="keyword">public</span>:<a name="l00037"></a><a class="code" href="classMexBuf.html#1c733608b67061cbf709664407bacc97">00037</a>   <a class="code" href="classMexBuf.html#1c733608b67061cbf709664407bacc97">MexBuf</a>()  : std::streambuf() <a name="l00038"></a>00038   { setbuf((<span class="keywordtype">char</span>*)0,0); }<a name="l00039"></a>00039   <a name="l00040"></a><a class="code" href="classMexBuf.html#1c9a7d6b79bc0575e92bc763a12e663a">00040</a>   <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classMexBuf.html#1c9a7d6b79bc0575e92bc763a12e663a">overflow</a>(<span class="keywordtype">int</span> c)<a name="l00041"></a>00041   {<a name="l00042"></a>00042     <span class="keywordflow">if</span> (c != EOF)<a name="l00043"></a>00043       mexPrintf(<span class="stringliteral">"%c"</span>, c);<a name="l00044"></a>00044     <span class="keywordflow">return</span> c;<a name="l00045"></a>00045   }<a name="l00046"></a>00046 <a name="l00047"></a><a class="code" href="classMexBuf.html#b869911ff21b4c0bf9c56c82b7ebdba6">00047</a>   <span class="keyword">virtual</span> std::streamsize <a class="code" href="classMexBuf.html#b869911ff21b4c0bf9c56c82b7ebdba6">xsputn</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* s, <span class="keyword">const</span> std::streamsize n)<a name="l00048"></a>00048   {<a name="l00049"></a>00049     std::streamsize c = n;<a name="l00050"></a>00050     <span class="keywordflow">while</span> (*s &amp;&amp; c--)<a name="l00051"></a>00051       mexPrintf(<span class="stringliteral">"%c"</span>, *s++);<a name="l00052"></a>00052     <span class="keywordflow">return</span> n;<a name="l00053"></a>00053   }<a name="l00054"></a>00054 <a name="l00055"></a>00055 };<a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="comment">// ######################################################################</span><a name="l00059"></a><a class="code" href="classMexBufInit.html">00059</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="classMexBufInit.html" title="This class triggers the redirection of the standard streams at construction.">MexBufInit</a><a name="l00060"></a>00060 {<a name="l00061"></a>00061  <span class="keyword">public</span>:<a name="l00062"></a><a class="code" href="classMexBufInit.html#5f5460acedd50e6eea476d8ffd0d338e">00062</a>   <a class="code" href="classMexBufInit.html#5f5460acedd50e6eea476d8ffd0d338e">MexBufInit</a>(<a class="code" href="classMexBuf.html" title="This streambuf is used to re-direct cout and cerr.">MexBuf</a>&amp; buf)  <a name="l00063"></a>00063   {<a name="l00064"></a>00064     std::cout.rdbuf(&amp;buf);<a name="l00065"></a>00065     std::cerr.rdbuf(&amp;buf);<a name="l00066"></a>00066   }<a name="l00067"></a>00067 <a name="l00068"></a><a class="code" href="classMexBufInit.html#38531044240b068a0ce0d42cc10277f7">00068</a>   <a class="code" href="classMexBufInit.html#38531044240b068a0ce0d42cc10277f7">~MexBufInit</a>() {}<a name="l00069"></a>00069 <a name="l00070"></a>00070  <span class="keyword">private</span>:<a name="l00071"></a>00071   <a class="code" href="classMexBufInit.html#5f5460acedd50e6eea476d8ffd0d338e">MexBufInit</a>(<span class="keyword">const</span> <a class="code" href="classMexBufInit.html" title="This class triggers the redirection of the standard streams at construction.">MexBufInit</a>&amp;);<a name="l00072"></a>00072   <a class="code" href="classMexBufInit.html" title="This class triggers the redirection of the standard streams at construction.">MexBufInit</a>&amp; <a class="code" href="classMexBufInit.html#dde5ccd40f7a3cbb377fac2e60b6f10e">operator=</a>(<span class="keyword">const</span> <a class="code" href="classMexBufInit.html" title="This class triggers the redirection of the standard streams at construction.">MexBufInit</a>&amp;);<a name="l00073"></a>00073 };<a name="l00074"></a>00074 <a name="l00075"></a>00075 <span class="comment">// ######################################################################</span><a name="l00076"></a>00076 <span class="keyword">namespace</span><a name="l00077"></a>00077 {<a name="l00078"></a><a class="code" href="mexLog_8h.html#40b3862cf4607dceb55c801a2bcbc09b">00078</a>   <span class="keyword">static</span> <a class="code" href="classMexBuf.html" title="This streambuf is used to re-direct cout and cerr.">MexBuf</a> <a class="code" href="mexLog_8h.html#40b3862cf4607dceb55c801a2bcbc09b">mexbuf__</a>;<a name="l00079"></a>00079   <span class="keyword">static</span> <a class="code" href="classMexBufInit.html" title="This class triggers the redirection of the standard streams at construction.">MexBufInit</a> <a class="code" href="mexLog_8h.html#d0b5fc73fee30b44e3315a08457157f7">mexbufInit__</a>(<a class="code" href="mexLog_8h.html#40b3862cf4607dceb55c801a2bcbc09b">mexbuf__</a>);<a name="l00080"></a>00080 }<a name="l00081"></a>00081 <a name="l00082"></a>00082 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Sep 7 13:09:49 2007 for SaliencyToolbox by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?