本文整理汇总了C++中store::Item_t::isAtomic方法的典型用法代码示例。如果您正苦于以下问题:C++ Item_t::isAtomic方法的具体用法?C++ Item_t::isAtomic怎么用?C++ Item_t::isAtomic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类store::Item_t
的用法示例。
在下文中一共展示了Item_t::isAtomic方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeAtomic
bool NumArithIterator<Operation>::compute(
store::Item_t& result,
dynamic_context* dctx,
const TypeManager* tm,
const QueryLoc& aLoc,
store::Item_t& n0,
store::Item_t& n1)
{
assert(n0->isAtomic());
assert(n1->isAtomic());
store::SchemaTypeCode type0 = n0->getTypeCode();
store::SchemaTypeCode type1 = n1->getTypeCode();
return computeAtomic(result, dctx, tm, aLoc, n0, type0, n1, type1);
}
示例2: addGeneralPair
void IndexDelta::addGeneralPair(store::Item_t& node, store::Item_t& key)
{
assert(node->isNode() && key->isAtomic());
theGeneralDelta.resize(theGeneralDelta.size() + 1);
theGeneralDelta.back().first.transfer(node);
theGeneralDelta.back().second.transfer(key);
}
示例3: pushRange
void GeneralIndexCondition::pushRange(
store::Item_t& lower,
store::Item_t& upper,
bool haveLower,
bool haveUpper,
bool lowerIncl,
bool upperIncl)
{
assert(theKind == BOX_VALUE);
assert(!theIsSet);
assert(!haveLower || (lower && lower->isAtomic()));
assert(!haveUpper || (upper && upper->isAtomic()));
theRangeFlags.theHaveLowerBound = haveLower;
theRangeFlags.theHaveUpperBound = haveUpper;
theRangeFlags.theLowerBoundIncl = lowerIncl;
theRangeFlags.theUpperBoundIncl = upperIncl;
if (haveLower)
{
theLowerBound.transfer(lower);
store::Item* baseItem = theLowerBound->getBaseItem();
if (baseItem != NULL)
theLowerBound = baseItem;
}
if (haveUpper)
{
theUpperBound.transfer(upper);
store::Item* baseItem = theUpperBound->getBaseItem();
if (baseItem != NULL)
theUpperBound = baseItem;
}
theIsSet = true;
}
示例4: pushItem
void GeneralIndexCondition::pushItem(store::Item_t& item)
{
assert(theKind == POINT_VALUE || theKind == POINT_GENERAL);
assert(!theIsSet);
assert(item && item->isAtomic());
theKey.transfer(item);
store::Item* baseItem = theKey->getBaseItem();
if (baseItem != NULL)
theKey = baseItem;
theIsSet = true;
}
示例5: x2j_map_atomic
bool x2j_map_atomic( store::Item_t const &xml_item, store::Item_t *json_item ) {
if ( xml_item->isAtomic() ) {
switch ( xml_item->getTypeCode() ) {
case store::JS_NULL:
case store::XS_BOOLEAN:
case store::XS_BYTE:
case store::XS_DECIMAL:
case store::XS_DOUBLE:
case store::XS_ENTITY:
case store::XS_FLOAT:
case store::XS_ID:
case store::XS_IDREF:
case store::XS_INT:
case store::XS_INTEGER:
case store::XS_LONG:
case store::XS_NAME:
case store::XS_NCNAME:
case store::XS_NEGATIVE_INTEGER:
case store::XS_NMTOKEN:
case store::XS_NON_NEGATIVE_INTEGER:
case store::XS_NON_POSITIVE_INTEGER:
case store::XS_NORMALIZED_STRING:
case store::XS_POSITIVE_INTEGER:
case store::XS_SHORT:
case store::XS_STRING:
case store::XS_TOKEN:
case store::XS_UNSIGNED_BYTE:
case store::XS_UNSIGNED_INT:
case store::XS_UNSIGNED_LONG:
case store::XS_UNSIGNED_SHORT:
*json_item = xml_item;
break;
default:
zstring s( xml_item->getStringValue() );
GENV_ITEMFACTORY->createString( *json_item, s );
break;
} // switch
return true;
} // if
return false;
}
示例6: if
bool GenericArithIterator<Operation>::compute(
store::Item_t& result,
dynamic_context* dctx,
const TypeManager* tm,
const QueryLoc& aLoc,
store::Item_t& n0,
store::Item_t& n1)
{
RootTypeManager& rtm = GENV_TYPESYSTEM;
assert(n0->isAtomic());
assert(n1->isAtomic());
store::SchemaTypeCode type0 = n0->getTypeCode();
store::SchemaTypeCode type1 = n1->getTypeCode();
if (TypeOps::is_numeric(type0) &&
(TypeOps::is_subtype(type1, store::XS_YM_DURATION) ||
TypeOps::is_subtype(type1, store::XS_DT_DURATION)))
{
GenericCast::castToAtomic(n0, n0, &*rtm.DOUBLE_TYPE_ONE, tm, NULL, aLoc);
if (TypeOps::is_subtype(type1, store::XS_YM_DURATION))
{
return Operation::template
compute<store::XS_DOUBLE, store::XS_YM_DURATION>
(result, dctx, tm, &aLoc, n0, n1);
}
else
{
return Operation::template
compute<store::XS_DOUBLE,store::XS_DT_DURATION>
(result, dctx, tm, &aLoc, n0, n1);
}
}
else if (TypeOps::is_subtype(type0, store::XS_DT_DURATION) &&
TypeOps::is_subtype(type1, store::XS_TIME))
{
return Operation::template
compute<store::XS_DURATION,store::XS_TIME>
(result, dctx, tm, &aLoc, n0, n1);
}
else if (TypeOps::is_subtype(type0, store::XS_YM_DURATION))
{
if (TypeOps::is_numeric(type1))
{
GenericCast::castToAtomic(n1, n1, &*rtm.DOUBLE_TYPE_ONE, tm, NULL, aLoc);
return Operation::template
compute<store::XS_YM_DURATION,store::XS_DOUBLE>
(result, dctx, tm, &aLoc, n0, n1);
}
else if (TypeOps::is_subtype(type1, store::XS_DATETIME))
{
return Operation::template
compute<store::XS_DURATION,store::XS_DATETIME>
(result, dctx, tm, &aLoc, n0, n1);
}
else if (TypeOps::is_subtype(type1, store::XS_DATE))
{
return Operation::template
compute<store::XS_DURATION,store::XS_DATE>
(result, dctx, tm, &aLoc, n0, n1);
}
else if (type0 == type1)
{
return Operation::template
computeSingleType<store::XS_YM_DURATION>
(result, dctx, tm, &aLoc, n0, n1);
}
}
else if (TypeOps::is_subtype(type0, store::XS_DT_DURATION))
{
if (TypeOps::is_numeric(type1))
{
GenericCast::castToAtomic(n1, n1, &*rtm.DOUBLE_TYPE_ONE, tm, NULL, aLoc);
return Operation::template
compute<store::XS_DT_DURATION,store::XS_DOUBLE>
(result, dctx, tm, &aLoc, n0, n1);
}
else if (TypeOps::is_subtype(type1, store::XS_DATETIME))
{
return Operation::template
compute<store::XS_DURATION,store::XS_DATETIME>
(result, dctx, tm, &aLoc, n0, n1);
}
else if (TypeOps::is_subtype(type1, store::XS_DATE))
{
return Operation::template
compute<store::XS_DURATION,store::XS_DATE>
(result, dctx, tm, &aLoc, n0, n1);
}
else if (type0 == type1)
{
return Operation::template
computeSingleType<store::XS_DT_DURATION>
(result, dctx, tm, &aLoc, n0, n1);
}
}
else if (TypeOps::is_subtype(type0, store::XS_DATETIME))
//.........这里部分代码省略.........
示例7: nextImpl
bool TreatIterator::nextImpl(store::Item_t& result, PlanState& planState) const
{
store::Item_t temp;
bool res;
const TypeManager* tm = theSctx->get_typemanager();
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
if (!consumeNext(result, theChild.getp(), planState))
{
if (theQuantifier == SequenceType::QUANT_PLUS ||
theQuantifier == SequenceType::QUANT_ONE)
{
raiseError("empty-sequence()");
}
}
else if (theQuantifier == SequenceType::QUANT_QUESTION ||
theQuantifier == SequenceType::QUANT_ONE)
{
if (consumeNext(temp, theChild.getp(), planState))
{
raiseError("sequence of more than one item");
}
if (theCheckPrime)
{
if (theTreatType->type_kind() == XQType::ATOMIC_TYPE_KIND &&
result->isAtomic())
{
store::SchemaTypeCode targetType =
static_cast<const AtomicXQType*>(theTreatType.getp())->get_type_code();
store::SchemaTypeCode itemType = result->getTypeCode();
res = TypeOps::is_subtype(itemType, targetType);
}
else
{
res = TypeOps::is_subtype(tm, result, *theTreatType, loc);
}
if (!res)
{
zstring valueType = tm->create_value_type(result)->toSchemaString();
raiseError(valueType);
}
}
STACK_PUSH(true, state);
}
else
{
do
{
if (theCheckPrime)
{
if (theTreatType->type_kind() == XQType::ATOMIC_TYPE_KIND &&
result->isAtomic())
{
store::SchemaTypeCode targetType =
static_cast<const AtomicXQType*>(theTreatType.getp())->get_type_code();
store::SchemaTypeCode itemType = result->getTypeCode();
res = TypeOps::is_subtype(itemType, targetType);
}
else
{
res = TypeOps::is_subtype(tm, result, *theTreatType, loc);
}
if (!res)
{
zstring valueType = tm->create_value_type(result)->toSchemaString();
raiseError(valueType);
}
}
STACK_PUSH(true, state);
}
while (consumeNext(result, theChild.getp(), planState));
}
STACK_END(state);
}
示例8: deepEqual
bool deepEqual(
const QueryLoc& loc,
static_context* sctx,
store::Item_t& item1,
store::Item_t& item2,
XQPCollator* collator,
int timezone,
bool raiseError)
{
if (item1->isFunction() || item2->isFunction())
{
if (raiseError)
{
RAISE_ERROR(err::FOTY0015, loc,
ERROR_PARAMS((item1->isFunction() ? item1 : item2)->getFunctionName()->getStringValue()));
}
else
return false;
}
if (item1->getKind() != item2->getKind())
return false;
switch (item1->getKind())
{
case store::Item::ATOMIC:
{
assert(item2->isAtomic());
store::SchemaTypeCode type1 = item1->getTypeCode();
store::SchemaTypeCode type2 = item2->getTypeCode();
// check if both items are NaN
if (((type1 == store::XS_FLOAT && item1->getFloatValue().isNaN()) ||
(type1 == store::XS_DOUBLE && item1->getDoubleValue().isNaN()))
&&
((type2 == store::XS_FLOAT && item2->getFloatValue().isNaN()) ||
(type2 == store::XS_DOUBLE && item2->getDoubleValue().isNaN())))
{
return true;
}
if (raiseError)
{
try
{
TypeManager* tm = sctx->get_typemanager();
return CompareIterator::valueEqual(loc, item1, item2, tm, timezone, collator, raiseError);
}
catch (ZorbaException const& e)
{
if (e.diagnostic() == err::XPTY0004)
return false;
throw;
}
}
else
{
TypeManager* tm = sctx->get_typemanager();
return CompareIterator::valueEqual(loc, item1, item2, tm, timezone, collator, raiseError);
}
break;
}
case store::Item::NODE:
{
return deepEqualNodes(loc, sctx, item1, item2, collator, timezone, raiseError);
}
case store::Item::OBJECT:
{
return deepEqualObjects(loc, sctx, item1, item2, collator, timezone, raiseError);
}
case store::Item::ARRAY:
{
return deepEqualArrays(loc, sctx, item1, item2, collator, timezone, raiseError);
}
default:
{
ZORBA_ASSERT(false); // should never reach here
}
}
return false;
}