2
* Copyright 2006-2012 The FLWOR Foundation.
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
8
* http://www.apache.org/licenses/LICENSE-2.0
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.
17
// ******************************************
19
// * THIS IS A GENERATED FILE. DO NOT EDIT! *
20
// * SEE .xml FILE WITH SAME NAME *
22
// ******************************************
23
#ifndef ZORBA_RUNTIME_FUNCTION_ITEM_FUNCTION_ITEM_ITER_H
24
#define ZORBA_RUNTIME_FUNCTION_ITEM_FUNCTION_ITEM_ITER_H
27
#include "common/shared_types.h"
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"
42
* Returns the function having a given name and arity, if there is one.
46
class FunctionLookupIterator : public NaryBaseIterator<FunctionLookupIterator, PlanIteratorState>
49
CompilerCB* theCompilerCB; //
51
SERIALIZABLE_CLASS(FunctionLookupIterator);
53
SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionLookupIterator,
54
NaryBaseIterator<FunctionLookupIterator, PlanIteratorState>);
56
void serialize( ::zorba::serialization::Archiver& ar);
58
FunctionLookupIterator(
61
std::vector<PlanIter_t>& children,
62
CompilerCB* aCompilerCB)
64
NaryBaseIterator<FunctionLookupIterator, PlanIteratorState>(sctx, loc, children),
65
theCompilerCB(aCompilerCB)
68
virtual ~FunctionLookupIterator();
70
void accept(PlanIterVisitor& v) const;
72
bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
78
* Returns the name of the function identified by a function item.
82
class FunctionNameIterator : public NaryBaseIterator<FunctionNameIterator, PlanIteratorState>
85
SERIALIZABLE_CLASS(FunctionNameIterator);
87
SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionNameIterator,
88
NaryBaseIterator<FunctionNameIterator, PlanIteratorState>);
90
void serialize( ::zorba::serialization::Archiver& ar);
95
std::vector<PlanIter_t>& children)
97
NaryBaseIterator<FunctionNameIterator, PlanIteratorState>(sctx, loc, children)
100
virtual ~FunctionNameIterator();
102
void accept(PlanIterVisitor& v) const;
104
bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
110
* Returns the arity of the function identified by a function item.
114
class FunctionArityIterator : public NaryBaseIterator<FunctionArityIterator, PlanIteratorState>
117
SERIALIZABLE_CLASS(FunctionArityIterator);
119
SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionArityIterator,
120
NaryBaseIterator<FunctionArityIterator, PlanIteratorState>);
122
void serialize( ::zorba::serialization::Archiver& ar);
124
FunctionArityIterator(
125
static_context* sctx,
127
std::vector<PlanIter_t>& children)
129
NaryBaseIterator<FunctionArityIterator, PlanIteratorState>(sctx, loc, children)
132
virtual ~FunctionArityIterator();
134
void accept(PlanIterVisitor& v) const;
136
bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
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.
146
class FnMapPairsIteratorState : public PlanIteratorState
149
PlanState* thePlanState; //
150
PlanIter_t thePlan; //
152
uint32_t theUDFStateOffset; //
153
store::Item_t theFnItem; //
155
FnMapPairsIteratorState();
157
~FnMapPairsIteratorState();
159
void init(PlanState&);
160
void reset(PlanState&);
163
class FnMapPairsIterator : public NaryBaseIterator<FnMapPairsIterator, FnMapPairsIteratorState>
166
SERIALIZABLE_CLASS(FnMapPairsIterator);
168
SERIALIZABLE_CLASS_CONSTRUCTOR2T(FnMapPairsIterator,
169
NaryBaseIterator<FnMapPairsIterator, FnMapPairsIteratorState>);
171
void serialize( ::zorba::serialization::Archiver& ar);
174
static_context* sctx,
176
std::vector<PlanIter_t>& children)
178
NaryBaseIterator<FnMapPairsIterator, FnMapPairsIteratorState>(sctx, loc, children)
181
virtual ~FnMapPairsIterator();
183
uint32_t getStateSizeOfSubtree() const;
185
void accept(PlanIterVisitor& v) const;
187
bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
189
void openImpl(PlanState&, uint32_t&);
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.
199
class FnFoldLeftIteratorState : public PlanIteratorState
202
PlanState* thePlanState; //
203
PlanIter_t thePlan; //
205
uint32_t theUDFStateOffset; //
206
store::Item_t theFnItem; //
208
FnFoldLeftIteratorState();
210
~FnFoldLeftIteratorState();
212
void init(PlanState&);
213
void reset(PlanState&);
216
class FnFoldLeftIterator : public NaryBaseIterator<FnFoldLeftIterator, FnFoldLeftIteratorState>
219
bool theIsFoldRight; //
221
SERIALIZABLE_CLASS(FnFoldLeftIterator);
223
SERIALIZABLE_CLASS_CONSTRUCTOR2T(FnFoldLeftIterator,
224
NaryBaseIterator<FnFoldLeftIterator, FnFoldLeftIteratorState>);
226
void serialize( ::zorba::serialization::Archiver& ar);
229
static_context* sctx,
231
std::vector<PlanIter_t>& children,
234
NaryBaseIterator<FnFoldLeftIterator, FnFoldLeftIteratorState>(sctx, loc, children),
235
theIsFoldRight(aIsFoldRight)
238
virtual ~FnFoldLeftIterator();
240
uint32_t getStateSizeOfSubtree() const;
242
void accept(PlanIterVisitor& v) const;
244
bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
246
void openImpl(PlanState&, uint32_t&);