本文整理汇总了C++中itemtype::Ptr::data方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::data方法的具体用法?C++ Ptr::data怎么用?C++ Ptr::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类itemtype::Ptr
的用法示例。
在下文中一共展示了Ptr::data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Ptr
AtomicComparator::Ptr ComparisonPlatform<TSubClass, issueError, comparisonType, errorCode>::
fetchComparator(const ItemType::Ptr &t1,
const ItemType::Ptr &t2,
const ReportContext::Ptr &context) const
{
Q_ASSERT(t1);
Q_ASSERT(t2);
if(*BuiltinTypes::xsAnyAtomicType == *t1 ||
*BuiltinTypes::xsAnyAtomicType == *t2 ||
*BuiltinTypes::item == *t1 ||
*BuiltinTypes::item == *t2 ||
*BuiltinTypes::numeric == *t1 ||
*BuiltinTypes::numeric == *t2 ||
*CommonSequenceTypes::Empty == *t1 ||
*CommonSequenceTypes::Empty == *t2)
{
/* The static type of(at least) one of the operands could not
* be narrowed further, so we do the operator
* lookup at runtime.
*/
return AtomicComparator::Ptr();
}
const AtomicComparatorLocator::Ptr locator
(static_cast<const AtomicType *>(t1.data())->comparatorLocator());
if(!locator)
{
if(issueError)
{
context->error(QtXmlPatterns::tr("No comparisons can be done involving the type %1.")
.arg(formatType(context->namePool(), t1)),
errorCode, static_cast<const TSubClass *>(this)->actualReflection());
}
return AtomicComparator::Ptr();
}
const AtomicComparator::Ptr comp(static_cast<const AtomicType *>(t2.data())->accept(locator, operatorID(),
static_cast<const TSubClass *>(this)->actualReflection()));
if(comp)
return comp;
else if(issueError)
{
context->error(QtXmlPatterns::tr("Operator %1 is not available between atomic values of type %2 and %3.")
.arg(formatKeyword(AtomicComparator::displayName(operatorID(),
comparisonType)),
formatType(context->namePool(), t1),
formatType(context->namePool(), t2)),
errorCode, static_cast<const TSubClass *>(this)->actualReflection());
}
return AtomicComparator::Ptr();
}
示例2: xdtTypeMatches
bool XSLTNodeTest::xdtTypeMatches(const ItemType::Ptr &other) const
{
if(!other->isNodeType())
return false;
return *static_cast<const XSLTNodeTest *>(other.data()) == *this
? true
: xdtTypeMatches(other->xdtSuperType());
}
示例3: xdtTypeMatches
bool BuiltinNodeType<kind>::xdtTypeMatches(const ItemType::Ptr &other) const
{
if(!other->isNodeType())
return false;
return *static_cast<const BuiltinNodeType *>(other.data()) == *this
? true
: xdtTypeMatches(other->xdtSuperType());
}