本文整理汇总了C++中anyatomictype::Ptr::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::isNull方法的具体用法?C++ Ptr::isNull怎么用?C++ Ptr::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anyatomictype::Ptr
的用法示例。
在下文中一共展示了Ptr::isNull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
Item::Ptr Multiply::execute(const AnyAtomicType::Ptr &atom1, const AnyAtomicType::Ptr &atom2, DynamicContext *context) const
{
if(atom1.isNull() || atom2.isNull()) return 0;
// xs:double * xs:duration (only xdt:dayTimeDuration and xdt:yearMonthDuration)
if(atom1->isNumericValue() &&
(atom2->getPrimitiveTypeIndex() == AnyAtomicType::DAY_TIME_DURATION ||
atom2->getPrimitiveTypeIndex() == AnyAtomicType::YEAR_MONTH_DURATION)) {
return ((const ATDurationOrDerived*)atom2.get())->multiply((const Numeric*)atom1.get(), context);
}
// xs:duration * xs:double (only xdt:dayTimeDuration and xdt:yearMonthDuration)
if(atom2->isNumericValue() &&
(atom1->getPrimitiveTypeIndex() == AnyAtomicType::DAY_TIME_DURATION ||
atom1->getPrimitiveTypeIndex() == AnyAtomicType::YEAR_MONTH_DURATION)) {
return ((const ATDurationOrDerived*)atom1.get())->multiply((const Numeric*)atom2.get(), context);
}
// numeric * numeric
if(atom1->isNumericValue()) {
if(atom2->isNumericValue()) {
return ((const Numeric*)atom1.get())->multiply((const Numeric*)atom2.get(), context);
}
else {
XQThrow(XPath2ErrorException,X("Multiply::createSequence"), X("An attempt to multiply a non numeric type to a numeric type has occurred [err:XPTY0004]"));
}
}
XQThrow(XPath2ErrorException,X("Multiply::createSequence"), X("The operator * has been called on invalid operand types [err:XPTY0004]"));
}
示例2: next
Item::Ptr DistinctValueResult::next(DynamicContext *context)
{
if(toDo_) {
toDo_ = false;
parent_ = fdv_->getParamNumber(1, context);
Collation *collation;
if(fdv_->getNumArgs() > 1) {
const XMLCh* collName = fdv_->getParamNumber(2, context)->next(context)->asString(context);
try {
context->getItemFactory()->createAnyURI(collName, context);
} catch(XPath2ErrorException &e) {
XQThrow(FunctionException, X("FunctionDistinctValues::DistinctValueResult::next"), X("Invalid collationURI"));
}
collation = context->getCollation(collName, this);
}
else
collation = context->getDefaultCollation(this);
alreadySeen_ = new DistinctSet(dvCompare(collation, context));
}
AnyAtomicType::Ptr item;
while(true) {
item = (const AnyAtomicType *)parent_->next(context).get();
if(item.isNull()) break;
if(alreadySeen_->insert(item).second)
return item;
}
parent_ = 0;
return 0;
}
示例3: isEmptyOrNaN
static inline bool isEmptyOrNaN(const AnyAtomicType::Ptr &si)
{
return si.isNull() || (si->isNumericValue() && ((Numeric*)si.get())->isNaN());
}