📄 defaultselval.htm
字号:
<pre><code><span class="codeComment">//Default SelVal function to make sure fields in a row selected from the database are valid
// Default select validation behavior ... data is valid if and only if
// there are no columns which are null.
// If there are other checks you wish to make, put them in
// your own SelVal functor.
// You can also specialize this template if you wish to have different default behavior
// for your data class.</span>
template<class DataObj> class DefaultSelValidate {
public:
bool operator()(BoundIOs &boundIOs,DataObj &rowbuf)
{
for (BoundIOs::iterator b_it = boundIOs.begin();
b_it != boundIOs.end(); b_it++)
{
BoundIO &boundIO = (*b_it).second;
if (boundIO.IsColumn() && boundIO.IsNull())
return false; <span class="codeComment">// found null column ... data is invalid</span>
}
return true; <span class="codeComment">// no nulls found ... data is OK</span>
}
};
</code></pre>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -