本文整理汇总了C++中consumeNext函数的典型用法代码示例。如果您正苦于以下问题:C++ consumeNext函数的具体用法?C++ consumeNext怎么用?C++ consumeNext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了consumeNext函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: DEFAULT_STACK_INIT
bool ForIterator::nextImpl(store::Item_t& aResult, PlanState& aPlanState) const
{
ForState* lState;
store::Item_t lItem;
DEFAULT_STACK_INIT(ForState, lState, aPlanState);
while (consumeNext(aResult, theChild0, aPlanState))
{
while (consumeNext(lItem, theChild1, aPlanState))
{
bindVariables(lItem, theVarRefs, aPlanState);
if (theHasPosVars)
{
store::Item_t lPosItem;
GENV_ITEMFACTORY->createInteger(lPosItem,
xs_integer(lState->incReturnPosition()));
bindVariables(lPosItem, thePosVarRefs, aPlanState);
}
STACK_PUSH(true, lState);
}
lState->resetPosition();
theChild1->reset(aPlanState);
}
STACK_END(lState);
}
开发者ID:zorba-processor,项目名称:zorba,代码行数:30,代码来源:for_iterator.cpp
示例2: DEFAULT_STACK_INIT
bool
IsFollowingSiblingPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
{
store::Item_t lUriA;
store::Item_t lUriB;
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
consumeNext(lUriA, theChildren[0].getp(), planState);
consumeNext(lUriB, theChildren[1].getp(), planState);
try
{
GENV_ITEMFACTORY->createBoolean(result, lUriA->isFollowingSibling(lUriB));
}
catch (ZorbaException& e)
{
set_source(e, loc);
throw;
}
STACK_PUSH(true,state);
STACK_END (state);
}
开发者ID:alyst,项目名称:zorba,代码行数:26,代码来源:node_position_impl.cpp
示例3: DEFAULT_STACK_INIT
bool JSoundValidateIterator::nextImpl( store::Item_t &result,
PlanState &plan_state ) const {
bool cast = cast_default;
store::Item_t jsd_item, type_item, json_item, options_item;
PlanIteratorState *state;
DEFAULT_STACK_INIT( PlanIteratorState, state, plan_state );
consumeNext( jsd_item, theChildren[0], plan_state );
consumeNext( type_item, theChildren[1], plan_state );
consumeNext( json_item, theChildren[2], plan_state );
consumeNext( options_item, theChildren[3], plan_state );
try {
get_bool_opt( options_item, "cast-atomic-values", &cast );
jsound::schema const schema( jsd_item );
GENV_ITEMFACTORY->createBoolean(
result, schema.validate( json_item, type_item->getStringValue(), cast )
);
}
catch ( ZorbaException &e ) {
set_source( e, loc, false );
throw;
}
STACK_PUSH( true, state );
STACK_END( state );
}
开发者ID:zorba-processor,项目名称:zorba,代码行数:28,代码来源:jsound_impl.cpp
示例4: DEFAULT_STACK_INIT
bool IfThenElseIterator::nextImpl(store::Item_t& result, PlanState& planState) const
{
IfThenElseIteratorState* state;
DEFAULT_STACK_INIT(IfThenElseIteratorState, state, planState);
if (theIsBooleanIter)
{
store::Item_t condResult;
consumeNext ( condResult, theCondIter.getp(), planState );
state->theThenUsed = condResult->getBooleanValue();
}
else
{
state->theThenUsed = FnBooleanIterator::effectiveBooleanValue(this->loc,
planState,
theCondIter);
}
while (true)
{
STACK_PUSH(consumeNext(result,
(state->theThenUsed ? theThenIter.getp() : theElseIter.getp()),
planState),
state);
}
STACK_END(state);
}
开发者ID:cezarfx,项目名称:zorba,代码行数:28,代码来源:item_iterator.cpp
示例5: getTypeManager
bool SeqValueIntersectIterator::nextImpl( store::Item_t &result,
PlanState &plan_state ) const {
XQPCollator *const coll = theSctx->get_default_collator( loc );
store::Item_t item;
TypeManager *const tm = getTypeManager();
long tz;
SeqValueIntersectIteratorState *state;
DEFAULT_STACK_INIT( SeqValueIntersectIteratorState, state, plan_state );
tz = plan_state.theLocalDynCtx->get_implicit_timezone();
state->set_[0] = new_Item_set( tm, tz, coll, loc );
state->set_[1] = new_Item_set( tm, tz, coll, loc );
while ( consumeNext( item, theChildren[0], plan_state ) )
if ( state->set_[0]->insert( item.getp() ).second )
item->addReference();
while ( consumeNext( item, theChildren[1], plan_state ) )
if ( ztd::contains( *state->set_[0], item.getp() ) &&
state->set_[1]->insert( item.getp() ).second ) {
item->addReference();
result = item;
STACK_PUSH( true, state );
}
delete_Item_set( state->set_[0] );
delete_Item_set( state->set_[1] );
STACK_END( state );
}
开发者ID:zorba-processor,项目名称:zorba,代码行数:31,代码来源:seq_impl.cpp
示例6: DEFAULT_STACK_INIT
bool JSONtoXMLInternal::nextImpl( store::Item_t& result,
PlanState &planState ) const {
store::Item_t item;
options_type options;
PlanIteratorState *state;
DEFAULT_STACK_INIT( PlanIteratorState, state, planState );
ZORBA_ASSERT( theChildren.size() == 2 );
consumeNext( item, theChildren[1], planState );
get_options( item, &options );
consumeNext( item, theChildren[0], planState );
result = nullptr;
{ // local scope
options_type::mapped_type const &format_opt = options[ "json-format" ];
ZORBA_ASSERT( !format_opt.empty() );
if ( format_opt == "Snelson" )
snelson::json_to_xml( item, &result );
else if ( format_opt == "JsonML" || format_opt == "JsonML-array" )
jsonml_array::json_to_xml( item, &result );
else if ( format_opt == "JsonML-object" )
jsonml_object::json_to_xml( item, &result );
else
ZORBA_ASSERT( false );
} // local scope
STACK_PUSH( !!result, state );
STACK_END( state );
}
开发者ID:cezarfx,项目名称:zorba,代码行数:31,代码来源:json_impl.cpp
示例7: DEFAULT_STACK_INIT
bool CastableIterator::nextImpl(store::Item_t& result, PlanState& planState) const
{
bool res;
store::Item_t item;
TypeManager* tm = theSctx->get_typemanager();
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
if (!consumeNext(item, theChild.getp(), planState))
{
res = theAllowEmpty;
}
else
{
res = GenericCast::isCastable(item, theCastType, tm);
if (consumeNext(item, theChild.getp(), planState))
{
res = false;
}
}
STACK_PUSH(GENV_ITEMFACTORY->createBoolean(result, res), state);
STACK_END(state);
}
开发者ID:alyst,项目名称:zorba,代码行数:27,代码来源:sequencetypes.cpp
示例8: put
/*******************************************************************************
declare updating function
put($uri as xs:string, $doc as xs:document-node()) as empty-sequence()
********************************************************************************/
bool PutDocumentIterator::nextImpl(
store::Item_t& result,
PlanState& aPlanState) const
{
zstring lRetrievedUriString;
zstring lResolvedUriString;
store::Item_t lUri;
store::Item_t lDoc;
store::Item_t lResolvedUriItem;
std::unique_ptr<store::PUL> lPul;
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState);
consumeNext(lUri, theChildren[0].getp(), aPlanState);
// absolutize retrieved uri
try
{
lUri->getStringValue2(lRetrievedUriString);
lResolvedUriString = theSctx->resolve_relative_uri(lRetrievedUriString, true);
}
catch (ZorbaException const&)
{
RAISE_ERROR(err::FODC0004, loc,
ERROR_PARAMS(lResolvedUriString, ZED(NoResolveRelativeURI)));
}
// check if document already exists in the store
if (GENV_STORE.getDocument(lResolvedUriString) != NULL)
{
RAISE_ERROR(zerr::ZAPI0020_DOCUMENT_ALREADY_EXISTS, loc,
ERROR_PARAMS(lResolvedUriString));
}
// create the pul and add the primitive
GENV_ITEMFACTORY->createAnyURI(lResolvedUriItem, lResolvedUriString);
lPul.reset(GENV_ITEMFACTORY->createPendingUpdateList());
consumeNext(lDoc, theChildren[1].getp(), aPlanState);
lPul->addCreateDocument(&loc, lResolvedUriItem, lDoc);
result = lPul.release();
STACK_PUSH(result != NULL, state);
STACK_END(state);
}
开发者ID:alyst,项目名称:zorba,代码行数:52,代码来源:documents_impl.cpp
示例9: DEFAULT_STACK_INIT
/*******************************************************************************
declare function
is-available-document($uri as xs:string) as xs:boolean
********************************************************************************/
bool IsAvailableDocumentIterator::nextImpl(
store::Item_t& result,
PlanState& aPlanState) const
{
zstring lRetrievedUriString;
zstring lResolvedUriString;
store::Item_t lUri;
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState);
consumeNext(lUri, theChildren[0].getp(), aPlanState);
// absolutize retrieved uri
try
{
lUri->getStringValue2(lRetrievedUriString);
lResolvedUriString = theSctx->resolve_relative_uri(lRetrievedUriString, true);
}
catch (ZorbaException const&)
{
RAISE_ERROR(err::FODC0004, loc,
ERROR_PARAMS(lResolvedUriString, ZED(NoResolveRelativeURI)));
}
// check if document exists in the store
GENV_ITEMFACTORY->
createBoolean(result, GENV_STORE.getDocument(lResolvedUriString) != NULL);
STACK_PUSH(true, state);
STACK_END(state);
}
开发者ID:alyst,项目名称:zorba,代码行数:37,代码来源:documents_impl.cpp
示例10: DEFAULT_STACK_INIT
bool FunctionNameIterator::nextImpl(
store::Item_t& r,
PlanState& planState) const
{
store::Item_t lFItem;
FunctionItem* lFunctionItem = 0;
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
consumeNext(lFItem, theChildren[0], planState);
// function signature guarantees that
ZORBA_ASSERT(lFItem->isFunction());
lFunctionItem = static_cast<FunctionItem*>(lFItem.getp());
if ((!lFunctionItem->isInline() || lFunctionItem->isCoercion())
&&
lFunctionItem->getFunctionName()
&&
(lFunctionItem->getArity() == lFunctionItem->getStartArity()))
{
// non-inline function
r = lFunctionItem->getFunctionName();
STACK_PUSH(true, state);
}
STACK_END(state);
}
开发者ID:zorba-processor,项目名称:zorba,代码行数:30,代码来源:fn_hof_functions_impl.cpp
示例11: DEFAULT_STACK_INIT
bool OpNumericUnaryIterator::nextImpl(store::Item_t& result, PlanState& planState) const
{
store::Item_t item;
store::SchemaTypeCode type;
const TypeManager* tm = theSctx->get_typemanager();
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
if (consumeNext(item, theChild.getp(), planState ))
{
assert(item->isAtomic());
type = item->getTypeCode();
if (type == store::XS_UNTYPED_ATOMIC)
{
GenericCast::castToBuiltinAtomic(item, item, store::XS_DOUBLE, NULL, loc);
type = store::XS_DOUBLE;
}
// TODO Optimizations (e.g. if item has already the correct type and value,
// it does not have to be created newly)
if (TypeOps::is_subtype(type, store::XS_DOUBLE))
{
GENV_ITEMFACTORY->
createDouble(result,
(thePlus ? item->getDoubleValue() : -item->getDoubleValue()));
}
else if (TypeOps::is_subtype(type, store::XS_FLOAT))
{
GENV_ITEMFACTORY->
createFloat(result,
(thePlus ? item->getFloatValue() : -item->getFloatValue()));
}
else if (TypeOps::is_subtype(type, store::XS_INTEGER))
{
GENV_ITEMFACTORY->
createInteger(result,
(thePlus ? item->getIntegerValue() : -item->getIntegerValue()));
}
else if (TypeOps::is_subtype(type, store::XS_DECIMAL))
{
GENV_ITEMFACTORY->
createDecimal(result,
(thePlus ? item->getDecimalValue() : -item->getDecimalValue()));
}
else
{
xqtref_t type = tm->create_value_type(item);
RAISE_ERROR(err::XPTY0004, loc,
ERROR_PARAMS(ZED(BadTypeFor_23), type->toSchemaString(), ZED(UnaryArithOp)));
}
STACK_PUSH(true, state);
}
STACK_END(state);
}
开发者ID:alyst,项目名称:zorba,代码行数:60,代码来源:NumericsImpl.cpp
示例12: DEFAULT_STACK_INIT
bool
ZorbaValidateInPlaceIterator::nextImpl(store::Item_t& result, PlanState& planState) const
{
store::Item_t node;
PlanIteratorState* state;
store::PUL_t pul;
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
if (consumeNext(node, theChild.getp(), planState))
{
// verify that if the element being revalidated is an element it is the root
if (node->getNodeKind()==store::StoreConsts::elementNode &&
node->getParent() &&
node->getParent()->getNodeKind()!=store::StoreConsts::documentNode)
throw XQUERY_EXCEPTION( zerr::ZAPI0090_CANNOT_VALIDATE_NON_ROOT, ERROR_LOC( loc ) );
pul = GENV_ITEMFACTORY->createPendingUpdateList();
pul->addRevalidate(&loc,node);
result.transfer(pul);
STACK_PUSH(true, state);
}
STACK_END(state);
}
开发者ID:zorba-processor,项目名称:zorba,代码行数:28,代码来源:schema_impl.cpp
示例13: DEFAULT_STACK_INIT
bool
DeleteIterator::nextImpl(store::Item_t& result, PlanState& aPlanState) const
{
store::Item_t target;
std::unique_ptr<store::PUL> pul;
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState);
pul.reset(GENV_ITEMFACTORY->createPendingUpdateList());
while (consumeNext(target, theChild, aPlanState))
{
if (!target->isNode())
throw XQUERY_EXCEPTION( err::XUTY0007, ERROR_LOC( loc ) );
areNodeModifiersViolated(theSctx, target, loc);
pul->addDelete(&loc, target);
}
result = pul.release();
STACK_PUSH(true, state);
STACK_END(state);
}
开发者ID:buchenberg,项目名称:zorba,代码行数:25,代码来源:update.cpp
示例14: DEFAULT_STACK_INIT
bool
IndexKeysIterator::nextImpl(
store::Item_t& result,
PlanState& aPlanState) const
{
store::Item_t lQName;
IndexDecl_t indexDecl;
store::IndexKey lKey;
store::Item_t lKeyNodeName;
GENV_ITEMFACTORY->createQName(lKeyNodeName,
static_context::ZORBA_STORE_UNORDERED_MAPS_FN_NS,
"", "key");
IndexKeysIteratorState* state;
DEFAULT_STACK_INIT(IndexKeysIteratorState, state, aPlanState);
consumeNext(lQName, theChildren[0].getp(), aPlanState);
if ((indexDecl = theSctx->lookup_index(lQName)) == NULL)
{
throw XQUERY_EXCEPTION(
zerr::ZDDY0021_INDEX_NOT_DECLARED,
ERROR_PARAMS( lQName->getStringValue() ),
ERROR_LOC( loc )
);
}
state->theIndex = GENV_STORE.getIndex(lQName);
if (!state->theIndex)
{
throw XQUERY_EXCEPTION(
zerr::ZDDY0023_INDEX_DOES_NOT_EXIST,
ERROR_PARAMS( lQName->getStringValue() ),
ERROR_LOC( loc )
);
}
state->theIter = state->theIndex->keys();
state->theIter->open();
// generate result elements of the form
// <key>
// <attribute value="key1_value"/>
// <attribute value="key2_value"/>
// <attribute value="key3_value"/>
// </key>
while (state->theIter->next(lKey))
{
IndexUtil::createIndexKeyElement(
state->theIndex->getSpecification().theIsGeneral,
result, lKey, static_context::ZORBA_STORE_STATIC_INDEXES_DML_FN_NS
);
STACK_PUSH(true, state);
}
STACK_END(state);
}
开发者ID:alyst,项目名称:zorba,代码行数:60,代码来源:index_func_impl.cpp
示例15: DEFAULT_STACK_INIT
/*******************************************************************************
14.9.2 fn:parse-xml-fragment
********************************************************************************/
bool FnParseXmlFragmentIterator::nextImpl(
store::Item_t& result,
PlanState& planState) const
{
zstring docString;
FnParseXmlFragmentIteratorState* state;
DEFAULT_STACK_INIT(FnParseXmlFragmentIteratorState, state, planState);
if (consumeNext(result, theChildren[0].getp(), planState))
{
if (result->isStreamable())
{
state->theFragmentStream.theStream = &result->getStream();
}
else
{
result->getStringValue2(docString);
state->theFragmentStream.theIss = new std::istringstream(docString.c_str());
state->theFragmentStream.theStream = state->theFragmentStream.theIss;
}
state->theProperties.setBaseUri(theSctx->get_base_uri());
state->theProperties.setParseExternalParsedEntity(true);
state->theProperties.setStoreDocument(false);
state->baseUri = state->theProperties.getBaseUri();
// create only one document node holding all fragment nodes
state->theFragmentStream.only_one_doc_node = 1;
try
{
result = GENV.getStore().loadDocument(state->baseUri,
state->docUri,
state->theFragmentStream,
state->theProperties);
}
catch ( ZorbaException const &e )
{
if ( !state->theProperties.getNoError() )
{
XQueryException xe(
XQUERY_EXCEPTION(err::FODC0006,
ERROR_PARAMS( "fn:parse-xml-fragment()", e.what() ),
ERROR_LOC( loc )));
set_data( xe, e );
throw xe;
}
result = nullptr;
}
if (result != NULL)
STACK_PUSH(true, state);
} // if
STACK_END(state);
}
开发者ID:zorba-processor,项目名称:zorba,代码行数:62,代码来源:parse_fragment_impl.cpp
示例16: while
bool PlanIterator::skip(int64_t count, PlanState& planState) const
{
bool have_more_items = true;
store::Item_t item;
while (count-- > 0 && (have_more_items = consumeNext(item, this, planState)))
;
return have_more_items;
}
开发者ID:cezarfx,项目名称:zorba,代码行数:10,代码来源:plan_iterator.cpp
示例17: count
bool PlanIterator::count(store::Item_t& result, PlanState& planState) const
{
store::Item_t item;
xs_integer count(0);
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
while (consumeNext(item, this, planState))
{
++count;
}
STACK_PUSH(GENV_ITEMFACTORY->createInteger(result, xs_integer(count)), state);
STACK_END(state);
}
开发者ID:cezarfx,项目名称:zorba,代码行数:16,代码来源:plan_iterator.cpp
示例18: remove
/*******************************************************************************
declare updating function
remove($uri as xs:string) as empty-sequence()
********************************************************************************/
bool RemoveDocumentIterator::nextImpl(
store::Item_t& result,
PlanState& aPlanState) const
{
zstring lRetrievedUriString;
zstring lResolvedUriString;
store::Item_t lUri;
store::Item_t lResolvedUriItem;
store::PUL_t lPul;
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState);
consumeNext(lUri, theChildren[0].getp(), aPlanState);
// absolutize retrieved uri
try
{
lUri->getStringValue2(lRetrievedUriString);
lResolvedUriString = theSctx->resolve_relative_uri(lRetrievedUriString, true);
}
catch (ZorbaException const&)
{
RAISE_ERROR(err::FODC0004, loc,
ERROR_PARAMS(lResolvedUriString, ZED(NoResolveRelativeURI)));
}
// check if document exists in the store
if (GENV_STORE.getDocument(lResolvedUriString) == NULL)
{
RAISE_ERROR(zerr::ZXQD0002_DOCUMENT_NOT_VALID, loc,
ERROR_PARAMS(lResolvedUriString, ZED(NoURIInStore)));
}
// create the pul and add the primitive
GENV_ITEMFACTORY->createAnyURI(lResolvedUriItem, lResolvedUriString);
lPul = GENV_ITEMFACTORY->createPendingUpdateList();
lPul->addDeleteDocument(&loc, lResolvedUriItem);
result.transfer(lPul);
STACK_PUSH(result != NULL, state);
STACK_END(state);
}
开发者ID:alyst,项目名称:zorba,代码行数:50,代码来源:documents_impl.cpp
示例19: DEFAULT_STACK_INIT
bool
LoopIterator::nextImpl(store::Item_t& result, PlanState& planState) const
{
bool lBreakLoop = false;
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
while (!lBreakLoop)
{
try
{
while (! consumeNext(result, theChild, planState))
{
// bugfix: removed a goto in case
// planState.theHasToQuit was true
// this should not be needed because
// the FlowCtlException::INTERRUPT
// exception is rethrown below
theChild->reset(planState);
}
}
catch (FlowCtlException &e)
{
switch (e.act)
{
case FlowCtlException::BREAK:
lBreakLoop = true;
break;
case FlowCtlException::CONTINUE:
theChild->reset(planState);
continue;
default:
throw;
}
}
if (!lBreakLoop)
{
STACK_PUSH(true, state);
}
}
STACK_END(state);
}
开发者ID:alyst,项目名称:zorba,代码行数:45,代码来源:scripting.cpp
示例20: document
/*******************************************************************************
declare function
document($uri as xs:string) as document-node()
********************************************************************************/
bool RetrieveDocumentIterator::nextImpl(
store::Item_t& result,
PlanState& aPlanState) const
{
zstring lRetrievedUriString;
zstring lResolvedUriString;
store::Item_t lUri;
store::Item_t lResolvedUriItem;
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState);
consumeNext(lUri, theChildren[0].getp(), aPlanState);
// absolutize retrieved uri
try
{
lUri->getStringValue2(lRetrievedUriString);
lResolvedUriString = theSctx->resolve_relative_uri(lRetrievedUriString, true);
}
catch (ZorbaException const&)
{
RAISE_ERROR(err::FODC0004, loc,
ERROR_PARAMS(lResolvedUriString, ZED( NoResolveRelativeURI)));
}
// check if document exists in the store
if ((result = GENV_STORE.getDocument(lResolvedUriString)) == NULL)
{
RAISE_ERROR(zerr::ZXQD0002_DOCUMENT_NOT_VALID, loc,
ERROR_PARAMS(lResolvedUriString, ZED( NoURIInStore)));
}
STACK_PUSH(true, state);
STACK_END(state);
}
开发者ID:alyst,项目名称:zorba,代码行数:41,代码来源:documents_impl.cpp
注:本文中的consumeNext函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论