~zorba-coders/zorba/bug1123016

« back to all changes in this revision

Viewing changes to src/runtime/hof/function_item_iter.h

  • Committer: Sorin Marian Nasoi
  • Date: 2013-04-09 11:44:43 UTC
  • mfrom: (11301.1.53 zorba)
  • Revision ID: spungi@gmail.com-20130409114443-89vz57gpyjzwoiok
Merged lp:zorba trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2006-2008 The FLWOR Foundation.
 
3
 *
 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
 
5
 * you may not use this file except in compliance with the License.
 
6
 * You may obtain a copy of the License at
 
7
 *
 
8
 * http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 * Unless required by applicable law or agreed to in writing, software
 
11
 * distributed under the License is distributed on an "AS IS" BASIS,
 
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
 
15
 */
 
16
#ifndef ZORBA_RUNTIME_FUNCTION_ITEM_ITER_H
 
17
#define ZORBA_RUNTIME_FUNCTION_ITEM_ITER_H
 
18
 
 
19
#include "common/shared_types.h"
 
20
 
 
21
#include "runtime/base/narybase.h"
 
22
 
 
23
namespace zorba
 
24
{
 
25
 
 
26
class FunctionItemInfo;
 
27
 
 
28
typedef rchandle<FunctionItemInfo> FunctionItemInfo_t;
 
29
 
 
30
 
 
31
/*******************************************************************************
 
32
  An iterator that creates and returns dynamic function items
 
33
********************************************************************************/
 
34
class FunctionItemIterator : public NaryBaseIterator<FunctionItemIterator,
 
35
                                                     PlanIteratorState>
 
36
{
 
37
protected:
 
38
  FunctionItemInfo_t theFunctionItemInfo;
 
39
 
 
40
public:
 
41
  SERIALIZABLE_CLASS(FunctionItemIterator)
 
42
  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionItemIterator,
 
43
  NaryBaseIterator<FunctionItemIterator, PlanIteratorState>)
 
44
  void serialize(::zorba::serialization::Archiver& ar);
 
45
 
 
46
public:
 
47
  FunctionItemIterator(
 
48
      static_context* sctx,
 
49
      const QueryLoc& loc,
 
50
      FunctionItemInfo* fnInfo);
 
51
 
 
52
  virtual ~FunctionItemIterator();
 
53
 
 
54
  const FunctionItemInfo_t getFunctionItemInfo() const
 
55
  {
 
56
    return theFunctionItemInfo;
 
57
  }
 
58
 
 
59
  void accept(PlanIterVisitor& v) const;
 
60
 
 
61
  bool nextImpl(store::Item_t& result, PlanState& planState) const;
 
62
 
 
63
protected:
 
64
  void importOuterEnv(
 
65
      PlanState& planState,
 
66
      CompilerCB* evalCCB,
 
67
      static_context* importSctx,
 
68
      dynamic_context* evalDctx) const;
 
69
};
 
70
 
 
71
 
 
72
}//end of zorba namespace
 
73
 
 
74
#endif
 
75
/* vim:set et sw=2 ts=2: */