~zorba-coders/zorba/bug1123016

« back to all changes in this revision

Viewing changes to src/runtime/function_item/pregenerated/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-2012 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
 
 
17
 
// ******************************************
18
 
// *                                        *
19
 
// * THIS IS A GENERATED FILE. DO NOT EDIT! *
20
 
// * SEE .xml FILE WITH SAME NAME           *
21
 
// *                                        *
22
 
// ******************************************
23
 
#ifndef ZORBA_RUNTIME_FUNCTION_ITEM_FUNCTION_ITEM_ITER_H
24
 
#define ZORBA_RUNTIME_FUNCTION_ITEM_FUNCTION_ITEM_ITER_H
25
 
 
26
 
 
27
 
#include "common/shared_types.h"
28
 
 
29
 
 
30
 
 
31
 
#include "runtime/base/narybase.h"
32
 
#include "compiler/expression/expr_base.h"
33
 
#include "runtime/util/plan_wrapper_holder.h"
34
 
#include "types/typeimpl.h"
35
 
#include "functions/function.h"
36
 
 
37
 
 
38
 
namespace zorba {
39
 
 
40
 
/**
41
 
 * 
42
 
 *      Returns the function having a given name and arity, if there is one.
43
 
 *    
44
 
 * Author: Zorba Team
45
 
 */
46
 
class FunctionLookupIterator : public NaryBaseIterator<FunctionLookupIterator, PlanIteratorState>
47
 
48
 
protected:
49
 
  CompilerCB* theCompilerCB; //
50
 
public:
51
 
  SERIALIZABLE_CLASS(FunctionLookupIterator);
52
 
 
53
 
  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionLookupIterator,
54
 
    NaryBaseIterator<FunctionLookupIterator, PlanIteratorState>);
55
 
 
56
 
  void serialize( ::zorba::serialization::Archiver& ar);
57
 
 
58
 
  FunctionLookupIterator(
59
 
    static_context* sctx,
60
 
    const QueryLoc& loc,
61
 
    std::vector<PlanIter_t>& children,
62
 
    CompilerCB* aCompilerCB)
63
 
    : 
64
 
    NaryBaseIterator<FunctionLookupIterator, PlanIteratorState>(sctx, loc, children),
65
 
    theCompilerCB(aCompilerCB)
66
 
  {}
67
 
 
68
 
  virtual ~FunctionLookupIterator();
69
 
 
70
 
  void accept(PlanIterVisitor& v) const;
71
 
 
72
 
  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
73
 
};
74
 
 
75
 
 
76
 
/**
77
 
 * 
78
 
 *      Returns the name of the function identified by a function item.
79
 
 *    
80
 
 * Author: Zorba Team
81
 
 */
82
 
class FunctionNameIterator : public NaryBaseIterator<FunctionNameIterator, PlanIteratorState>
83
 
84
 
public:
85
 
  SERIALIZABLE_CLASS(FunctionNameIterator);
86
 
 
87
 
  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionNameIterator,
88
 
    NaryBaseIterator<FunctionNameIterator, PlanIteratorState>);
89
 
 
90
 
  void serialize( ::zorba::serialization::Archiver& ar);
91
 
 
92
 
  FunctionNameIterator(
93
 
    static_context* sctx,
94
 
    const QueryLoc& loc,
95
 
    std::vector<PlanIter_t>& children)
96
 
    : 
97
 
    NaryBaseIterator<FunctionNameIterator, PlanIteratorState>(sctx, loc, children)
98
 
  {}
99
 
 
100
 
  virtual ~FunctionNameIterator();
101
 
 
102
 
  void accept(PlanIterVisitor& v) const;
103
 
 
104
 
  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
105
 
};
106
 
 
107
 
 
108
 
/**
109
 
 * 
110
 
 *      Returns the arity of the function identified by a function item.
111
 
 *    
112
 
 * Author: Zorba Team
113
 
 */
114
 
class FunctionArityIterator : public NaryBaseIterator<FunctionArityIterator, PlanIteratorState>
115
 
116
 
public:
117
 
  SERIALIZABLE_CLASS(FunctionArityIterator);
118
 
 
119
 
  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionArityIterator,
120
 
    NaryBaseIterator<FunctionArityIterator, PlanIteratorState>);
121
 
 
122
 
  void serialize( ::zorba::serialization::Archiver& ar);
123
 
 
124
 
  FunctionArityIterator(
125
 
    static_context* sctx,
126
 
    const QueryLoc& loc,
127
 
    std::vector<PlanIter_t>& children)
128
 
    : 
129
 
    NaryBaseIterator<FunctionArityIterator, PlanIteratorState>(sctx, loc, children)
130
 
  {}
131
 
 
132
 
  virtual ~FunctionArityIterator();
133
 
 
134
 
  void accept(PlanIterVisitor& v) const;
135
 
 
136
 
  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
137
 
};
138
 
 
139
 
 
140
 
/**
141
 
 * 
142
 
 *      Applies the function item $f to successive pairs of items taken one from $seq1 and one from $seq2, returning the concatenation of the resulting sequences in order.
143
 
 *    
144
 
 * Author: Zorba Team
145
 
 */
146
 
class FnMapPairsIteratorState : public PlanIteratorState
147
 
{
148
 
public:
149
 
  PlanState* thePlanState; //
150
 
  PlanIter_t thePlan; //
151
 
  bool theIsOpen; //
152
 
  uint32_t theUDFStateOffset; //
153
 
  store::Item_t theFnItem; //
154
 
 
155
 
  FnMapPairsIteratorState();
156
 
 
157
 
  ~FnMapPairsIteratorState();
158
 
 
159
 
  void init(PlanState&);
160
 
  void reset(PlanState&);
161
 
};
162
 
 
163
 
class FnMapPairsIterator : public NaryBaseIterator<FnMapPairsIterator, FnMapPairsIteratorState>
164
 
165
 
public:
166
 
  SERIALIZABLE_CLASS(FnMapPairsIterator);
167
 
 
168
 
  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FnMapPairsIterator,
169
 
    NaryBaseIterator<FnMapPairsIterator, FnMapPairsIteratorState>);
170
 
 
171
 
  void serialize( ::zorba::serialization::Archiver& ar);
172
 
 
173
 
  FnMapPairsIterator(
174
 
    static_context* sctx,
175
 
    const QueryLoc& loc,
176
 
    std::vector<PlanIter_t>& children)
177
 
    : 
178
 
    NaryBaseIterator<FnMapPairsIterator, FnMapPairsIteratorState>(sctx, loc, children)
179
 
  {}
180
 
 
181
 
  virtual ~FnMapPairsIterator();
182
 
 
183
 
  uint32_t getStateSizeOfSubtree() const;
184
 
 
185
 
  void accept(PlanIterVisitor& v) const;
186
 
 
187
 
  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
188
 
 
189
 
  void openImpl(PlanState&, uint32_t&);
190
 
};
191
 
 
192
 
 
193
 
/**
194
 
 * 
195
 
 *      Processes the supplied sequence from left to right or right to left, applying the supplied function repeatedly to each item in turn, together with an accumulated result value.
196
 
 *    
197
 
 * Author: Zorba Team
198
 
 */
199
 
class FnFoldLeftIteratorState : public PlanIteratorState
200
 
{
201
 
public:
202
 
  PlanState* thePlanState; //
203
 
  PlanIter_t thePlan; //
204
 
  bool theIsOpen; //
205
 
  uint32_t theUDFStateOffset; //
206
 
  store::Item_t theFnItem; //
207
 
 
208
 
  FnFoldLeftIteratorState();
209
 
 
210
 
  ~FnFoldLeftIteratorState();
211
 
 
212
 
  void init(PlanState&);
213
 
  void reset(PlanState&);
214
 
};
215
 
 
216
 
class FnFoldLeftIterator : public NaryBaseIterator<FnFoldLeftIterator, FnFoldLeftIteratorState>
217
 
218
 
protected:
219
 
  bool theIsFoldRight; //
220
 
public:
221
 
  SERIALIZABLE_CLASS(FnFoldLeftIterator);
222
 
 
223
 
  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FnFoldLeftIterator,
224
 
    NaryBaseIterator<FnFoldLeftIterator, FnFoldLeftIteratorState>);
225
 
 
226
 
  void serialize( ::zorba::serialization::Archiver& ar);
227
 
 
228
 
  FnFoldLeftIterator(
229
 
    static_context* sctx,
230
 
    const QueryLoc& loc,
231
 
    std::vector<PlanIter_t>& children,
232
 
    bool aIsFoldRight)
233
 
    : 
234
 
    NaryBaseIterator<FnFoldLeftIterator, FnFoldLeftIteratorState>(sctx, loc, children),
235
 
    theIsFoldRight(aIsFoldRight)
236
 
  {}
237
 
 
238
 
  virtual ~FnFoldLeftIterator();
239
 
 
240
 
  uint32_t getStateSizeOfSubtree() const;
241
 
 
242
 
  void accept(PlanIterVisitor& v) const;
243
 
 
244
 
  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
245
 
 
246
 
  void openImpl(PlanState&, uint32_t&);
247
 
};
248
 
 
249
 
 
250
 
}
251
 
#endif
252
 
/*
253
 
 * Local variables:
254
 
 * mode: c++
255
 
 * End:
256
 
 */