本文整理汇总了C++中MetaName::printf方法的典型用法代码示例。如果您正苦于以下问题:C++ MetaName::printf方法的具体用法?C++ MetaName::printf怎么用?C++ MetaName::printf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MetaName
的用法示例。
在下文中一共展示了MetaName::printf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printInversion
void RecordSource::printInversion(thread_db* tdbb, const InversionNode* inversion,
string& plan, bool detailed, unsigned level, bool navigation)
{
if (detailed)
plan += printIndent(++level);
switch (inversion->type)
{
case InversionNode::TYPE_AND:
if (detailed)
plan += "Bitmap And";
printInversion(tdbb, inversion->node1, plan, detailed, level);
printInversion(tdbb, inversion->node2, plan, detailed, level);
break;
case InversionNode::TYPE_OR:
case InversionNode::TYPE_IN:
if (detailed)
plan += "Bitmap Or";
printInversion(tdbb, inversion->node1, plan, detailed, level);
printInversion(tdbb, inversion->node2, plan, detailed, level);
break;
case InversionNode::TYPE_DBKEY:
if (detailed)
plan += "DBKEY";
break;
case InversionNode::TYPE_INDEX:
{
const IndexRetrieval* const retrieval = inversion->retrieval;
const jrd_rel* const relation = retrieval->irb_relation;
MetaName indexName;
if (retrieval->irb_name && retrieval->irb_name->hasData())
indexName = *retrieval->irb_name;
else
indexName.printf("<index id %d>", retrieval->irb_index + 1);
if (detailed)
{
if (!navigation)
plan += "Bitmap" + printIndent(++level);
const index_desc& idx = retrieval->irb_desc;
const bool uniqueIdx = (idx.idx_flags & idx_unique);
const USHORT segCount = idx.idx_count;
const USHORT minSegs = MIN(retrieval->irb_lower_count, retrieval->irb_upper_count);
const USHORT maxSegs = MAX(retrieval->irb_lower_count, retrieval->irb_upper_count);
const bool equality = (retrieval->irb_generic & irb_equality);
const bool partial = (retrieval->irb_generic & irb_partial);
const bool fullscan = (maxSegs == 0);
const bool unique = uniqueIdx && equality && (minSegs == segCount);
string bounds;
if (!unique && !fullscan)
{
if (retrieval->irb_lower_count && retrieval->irb_upper_count)
{
if (equality)
{
if (partial)
bounds.printf(" (partial match: %d/%d)", maxSegs, segCount);
else
bounds.printf(" (full match)");
}
else
{
bounds.printf(" (lower bound: %d/%d, upper bound: %d/%d)",
retrieval->irb_lower_count, segCount,
retrieval->irb_upper_count, segCount);
}
}
else if (retrieval->irb_lower_count)
{
bounds.printf(" (lower bound: %d/%d)",
retrieval->irb_lower_count, segCount);
}
else if (retrieval->irb_upper_count)
{
bounds.printf(" (upper bound: %d/%d)",
retrieval->irb_upper_count, segCount);
}
}
plan += "Index " + printName(tdbb, indexName.c_str()) +
(fullscan ? " Full" : unique ? " Unique" : " Range") + " Scan" + bounds;
}
else
{
plan += (plan.hasData() ? ", " : "") + printName(tdbb, indexName.c_str(), false);
}
}
break;
default:
fb_assert(false);
//.........这里部分代码省略.........