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_INDEXING_INDEX_FUNC_H
24 #define ZORBA_RUNTIME_INDEXING_INDEX_FUNC_H
25 
26 
27 #include "common/shared_types.h"
28 
29 
30 
31 #include "runtime/base/narybase.h"
32 #include "store/api/index.h"
33 
34 
35 namespace zorba {
36 
37 /**
38  *
39  *      keys($iindexName as xs:QName) as ()
40  *
41  * Author: Zorba Team
42  */
43 class IndexKeysIteratorState : public PlanIteratorState
44 {
45 public:
46   store::Index::KeyIterator_t theIter; //
47   store::Index* theIndex; //
48 
49   IndexKeysIteratorState();
50 
51   ~IndexKeysIteratorState();
52 
53   void init(PlanState&);
54   void reset(PlanState&);
55 };
56 
57 class IndexKeysIterator : public NaryBaseIterator<IndexKeysIterator, IndexKeysIteratorState>
58 {
59 protected:
60   store::NsBindings theNSBindings; //
61 public:
62   SERIALIZABLE_CLASS(IndexKeysIterator);
63 
64   SERIALIZABLE_CLASS_CONSTRUCTOR2T(IndexKeysIterator,
65     NaryBaseIterator<IndexKeysIterator, IndexKeysIteratorState>);
66 
67   void serialize( ::zorba::serialization::Archiver& ar);
68 
IndexKeysIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)69   IndexKeysIterator(
70     static_context* sctx,
71     const QueryLoc& loc,
72     std::vector<PlanIter_t>& children)
73     :
74     NaryBaseIterator<IndexKeysIterator, IndexKeysIteratorState>(sctx, loc, children),
75     theNSBindings()
76   {}
77 
78   virtual ~IndexKeysIterator();
79 
80   void accept(PlanIterVisitor& v) const;
81 
82   bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
83 };
84 
85 
86 }
87 #endif
88 /*
89  * Local variables:
90  * mode: c++
91  * End:
92  */
93