⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ourheroichandler.htm

📁 The goal of this library is to make ODBC recordsets look just like an STL container. As a user, you
💻 HTM
字号:
<pre><code><span class="codeComment">// Let's Use our X-Ray Vision to Look at the Innards of our Hero</span>


template&lt;class DataObj, class ParamObj = DefaultParamObj&lt;DataObj&gt; &gt; class OurHeroicHandler
{
private:
	<span class="codeComment">// ... some state data, but assume handler is default constructible</span>
public:

	dtl_ios_base::MeansOfRecovery
		operator()(RootException &amp;ex, dtl_ios_base &amp;base,
		   DataObj &amp;data, ParamObj &amp;params)
	{
		<span class="codeComment">// example of what you might do in a handler</span>
		if (bad())
		{
			LogErrorToFile(ex);
			return dtl_ios_base::THROW_EXCEPTION;
		}
		else if (fail())
		{
			<span class="codeComment">// tries to make the DataObj valid and then reapplies previous operation
			// to base on the good object ... may still fail</span>
			bool failed = WorkMagicOnDataObjAndTryAgain(...);

			if (failed)
			{
				LogErrorToFile(ex);
				return dtl_ios_base::THROW_EXCEPTION;
			}
			else
				return dtl_ios_base::SUPPRESS_ERROR; <span class="codeComment">// success ... our superhero
								     // has saved the day!</span>
		}
	}
};
</code></pre>

⌨️ 快捷键说明

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