本文整理汇总了C++中QExplicitlySharedDataPointer::namePool方法的典型用法代码示例。如果您正苦于以下问题:C++ QExplicitlySharedDataPointer::namePool方法的具体用法?C++ QExplicitlySharedDataPointer::namePool怎么用?C++ QExplicitlySharedDataPointer::namePool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QExplicitlySharedDataPointer
的用法示例。
在下文中一共展示了QExplicitlySharedDataPointer::namePool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: evaluateEBV
bool AtomicValue::evaluateEBV(const QExplicitlySharedDataPointer<DynamicContext> &context) const
{
context->error(QtXmlPatterns::tr("A value of type %1 cannot have an "
"Effective Boolean Value.")
.arg(formatType(context->namePool(), type())),
ReportContext::FORG0006,
QSourceLocation());
return false; /* Silence GCC warning. */
}
示例2: calculate
Item DurationNumericMathematician::calculate(const Item &o1,
const Operator op,
const Item &o2,
const QExplicitlySharedDataPointer<DynamicContext> &context) const
{
Q_ASSERT(op == Div || op == Multiply);
const AbstractDuration::Ptr duration(o1.as<AbstractDuration>());
const xsDouble dbl = o2.as<Numeric>()->toDouble();
switch(op)
{
case Div:
{
if(qIsInf(dbl))
return duration->fromValue(0);
else if(qIsNaN(dbl))
{
context->error(QtXmlPatterns::tr(
"Dividing a value of type %1 by %2 (not-a-number) "
"is not allowed.")
.arg(formatType(context->namePool(),
duration->type()))
.arg(formatData("NaN")),
ReportContext::FOCA0005,
this);
return Item();
}
else if(Double::isEqual(dbl, 0))
{
context->error(QtXmlPatterns::tr(
"Dividing a value of type %1 by %2 or %3 (plus or "
"minus zero) is not allowed.")
.arg(formatType(context->namePool(),
duration->type()))
.arg(formatData("-0"))
.arg(formatData("0")),
ReportContext::FODT0002,
this);
return Item();
}
return duration->fromValue(static_cast<AbstractDuration::Value>(duration->value() / dbl));
}
case Multiply:
{
if(Double::isEqual(dbl, 0))
return duration->fromValue(0);
else if(qIsNaN(dbl))
{
context->error(QtXmlPatterns::tr(
"Dividing a value of type %1 by %2 (not-a-number) "
"is not allowed.")
.arg(formatType(context->namePool(),
duration->type()))
.arg(formatData("NaN")),
ReportContext::FOCA0005,
this);
return Item();
}
else if(qIsInf(dbl))
{
context->error(QtXmlPatterns::tr(
"Multiplication of a value of type %1 by %2 or %3 "
"(plus or minus infinity) is not allowed.")
.arg(formatType(context->namePool(),
duration->type()))
.arg(formatData("-INF"))
.arg(formatData("INF")),
ReportContext::FODT0002,
this);
return Item();
}
return duration->fromValue(static_cast<AbstractDuration::Value>(duration->value() * dbl));
}
default:
{
Q_ASSERT(false);
return Item(); /* Silence warning. */
}
}
}
示例3: castFrom
Item StringToHexBinaryCaster::castFrom(const Item &from,
const QExplicitlySharedDataPointer<DynamicContext> &context) const
{
return HexBinary::fromLexical(context->namePool(), from.stringValue());
}