当前位置: 首页>>代码示例>>C++>>正文


C++ DEFAULT_STACK_INIT函数代码示例

本文整理汇总了C++中DEFAULT_STACK_INIT函数的典型用法代码示例。如果您正苦于以下问题:C++ DEFAULT_STACK_INIT函数的具体用法?C++ DEFAULT_STACK_INIT怎么用?C++ DEFAULT_STACK_INIT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DEFAULT_STACK_INIT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: DEFAULT_STACK_INIT

bool SpecificNumArithIterator<Operation, Type>::nextImpl(
    store::Item_t& result,
    PlanState& planState) const
{
  bool res;
  store::Item_t n0;
  store::Item_t n1;
  
  PlanIteratorState* state;
  DEFAULT_STACK_INIT(PlanIteratorState, state, planState);

  if (this->consumeNext(n0, this->theChild0.getp(), planState))
  {
    if (this->consumeNext(n1, this->theChild1.getp(), planState))
    {
      assert(n0->isAtomic());
      assert(n1->isAtomic());

      res = Operation::template 
      computeSingleType<Type>(result, NULL, NULL, &this->loc, n0.getp(), n1.getp());

      STACK_PUSH(res, state);
    }
  }
  STACK_END(state);
}
开发者ID:alyst,项目名称:zorba,代码行数:26,代码来源:NumericsImpl.cpp

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: DEFAULT_STACK_INIT

bool ExitIterator::nextImpl(store::Item_t& result, PlanState& planState) const 
{
  PlanIteratorState* state;
  DEFAULT_STACK_INIT(PlanIteratorState, state, planState);

  throw ExitException(new PlanIteratorWrapper(theChild, planState));
    
  STACK_END(state);
}
开发者ID:alyst,项目名称:zorba,代码行数:9,代码来源:scripting.cpp


注:本文中的DEFAULT_STACK_INIT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。