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_COLLECTIONS_COLLECTIONS_H 24 #define ZORBA_RUNTIME_COLLECTIONS_COLLECTIONS_H 25 26 27 #include "common/shared_types.h" 28 29 30 31 #include "runtime/base/narybase.h" 32 #include "runtime/collections/collections_base.h" 33 34 35 namespace zorba { 36 class StaticallyKnownCollection; 37 /** 38 * 39 * zorba:create 40 * 41 * Author: Zorba Team 42 */ 43 class ZorbaCreateCollectionIterator : public NaryBaseIterator<ZorbaCreateCollectionIterator, PlanIteratorState> 44 { 45 protected: 46 bool theIsDynamic; // 47 public: 48 SERIALIZABLE_CLASS(ZorbaCreateCollectionIterator); 49 50 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaCreateCollectionIterator, 51 NaryBaseIterator<ZorbaCreateCollectionIterator, PlanIteratorState>); 52 53 void serialize( ::zorba::serialization::Archiver& ar); 54 ZorbaCreateCollectionIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic)55 ZorbaCreateCollectionIterator( 56 static_context* sctx, 57 const QueryLoc& loc, 58 std::vector<PlanIter_t>& children, 59 bool isDynamic) 60 : 61 NaryBaseIterator<ZorbaCreateCollectionIterator, PlanIteratorState>(sctx, loc, children), 62 theIsDynamic(isDynamic) 63 {} 64 65 virtual ~ZorbaCreateCollectionIterator(); 66 67 public: 68 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 69 void accept(PlanIterVisitor& v) const; 70 71 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 72 }; 73 74 75 /** 76 * 77 * zorba:delete 78 * 79 * Author: Zorba Team 80 */ 81 class ZorbaDeleteCollectionIterator : public NaryBaseIterator<ZorbaDeleteCollectionIterator, PlanIteratorState> 82 { 83 protected: 84 bool theIsDynamic; // 85 public: 86 SERIALIZABLE_CLASS(ZorbaDeleteCollectionIterator); 87 88 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaDeleteCollectionIterator, 89 NaryBaseIterator<ZorbaDeleteCollectionIterator, PlanIteratorState>); 90 91 void serialize( ::zorba::serialization::Archiver& ar); 92 ZorbaDeleteCollectionIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic)93 ZorbaDeleteCollectionIterator( 94 static_context* sctx, 95 const QueryLoc& loc, 96 std::vector<PlanIter_t>& children, 97 bool isDynamic) 98 : 99 NaryBaseIterator<ZorbaDeleteCollectionIterator, PlanIteratorState>(sctx, loc, children), 100 theIsDynamic(isDynamic) 101 {} 102 103 virtual ~ZorbaDeleteCollectionIterator(); 104 105 void accept(PlanIterVisitor& v) const; 106 107 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 108 }; 109 110 111 /** 112 * 113 * dc:is-available-collection 114 * 115 * Author: Zorba Team 116 */ 117 class IsAvailableCollectionIterator : public NaryBaseIterator<IsAvailableCollectionIterator, PlanIteratorState> 118 { 119 protected: 120 bool theIsDynamic; // 121 public: 122 SERIALIZABLE_CLASS(IsAvailableCollectionIterator); 123 124 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsAvailableCollectionIterator, 125 NaryBaseIterator<IsAvailableCollectionIterator, PlanIteratorState>); 126 127 void serialize( ::zorba::serialization::Archiver& ar); 128 IsAvailableCollectionIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic)129 IsAvailableCollectionIterator( 130 static_context* sctx, 131 const QueryLoc& loc, 132 std::vector<PlanIter_t>& children, 133 bool isDynamic) 134 : 135 NaryBaseIterator<IsAvailableCollectionIterator, PlanIteratorState>(sctx, loc, children), 136 theIsDynamic(isDynamic) 137 {} 138 139 virtual ~IsAvailableCollectionIterator(); 140 141 void accept(PlanIterVisitor& v) const; 142 143 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 144 }; 145 146 147 /** 148 * 149 * dc:available-collections 150 * 151 * Author: Zorba Team 152 */ 153 class AvailableCollectionsIteratorState : public PlanIteratorState 154 { 155 public: 156 store::Iterator_t nameItState; // 157 158 AvailableCollectionsIteratorState(); 159 160 ~AvailableCollectionsIteratorState(); 161 162 void init(PlanState&); 163 void reset(PlanState&); 164 }; 165 166 class AvailableCollectionsIterator : public NaryBaseIterator<AvailableCollectionsIterator, AvailableCollectionsIteratorState> 167 { 168 protected: 169 bool theIsDynamic; // 170 public: 171 SERIALIZABLE_CLASS(AvailableCollectionsIterator); 172 173 SERIALIZABLE_CLASS_CONSTRUCTOR2T(AvailableCollectionsIterator, 174 NaryBaseIterator<AvailableCollectionsIterator, AvailableCollectionsIteratorState>); 175 176 void serialize( ::zorba::serialization::Archiver& ar); 177 AvailableCollectionsIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic)178 AvailableCollectionsIterator( 179 static_context* sctx, 180 const QueryLoc& loc, 181 std::vector<PlanIter_t>& children, 182 bool isDynamic) 183 : 184 NaryBaseIterator<AvailableCollectionsIterator, AvailableCollectionsIteratorState>(sctx, loc, children), 185 theIsDynamic(isDynamic) 186 {} 187 188 virtual ~AvailableCollectionsIterator(); 189 190 void accept(PlanIterVisitor& v) const; 191 192 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 193 }; 194 195 196 /** 197 * 198 * fn:collection 199 * 200 * Author: Zorba Team 201 */ 202 class FnCollectionIteratorState : public PlanIteratorState 203 { 204 public: 205 store::Iterator_t theIterator; //the current iterator 206 bool theIteratorOpened; //flag indicating whether theIterator was opened 207 208 FnCollectionIteratorState(); 209 210 ~FnCollectionIteratorState(); 211 212 void init(PlanState&); 213 void reset(PlanState&); 214 }; 215 216 class FnCollectionIterator : public NaryBaseIterator<FnCollectionIterator, FnCollectionIteratorState> 217 { 218 public: 219 SERIALIZABLE_CLASS(FnCollectionIterator); 220 221 SERIALIZABLE_CLASS_CONSTRUCTOR2T(FnCollectionIterator, 222 NaryBaseIterator<FnCollectionIterator, FnCollectionIteratorState>); 223 224 void serialize( ::zorba::serialization::Archiver& ar); 225 FnCollectionIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)226 FnCollectionIterator( 227 static_context* sctx, 228 const QueryLoc& loc, 229 std::vector<PlanIter_t>& children) 230 : 231 NaryBaseIterator<FnCollectionIterator, FnCollectionIteratorState>(sctx, loc, children) 232 {} 233 234 virtual ~FnCollectionIterator(); 235 236 void accept(PlanIterVisitor& v) const; 237 238 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 239 }; 240 241 242 /** 243 * 244 * zorba:collection 245 * 246 * Author: Zorba Team 247 */ 248 class ZorbaCollectionIteratorState : public PlanIteratorState 249 { 250 public: 251 store::Iterator_t theIterator; // 252 bool theIteratorOpened; // 253 254 ZorbaCollectionIteratorState(); 255 256 ~ZorbaCollectionIteratorState(); 257 258 void init(PlanState&); 259 void reset(PlanState&); 260 }; 261 262 class ZorbaCollectionIterator : public NaryBaseIterator<ZorbaCollectionIterator, ZorbaCollectionIteratorState> 263 { 264 protected: 265 bool theIsDynamic; // 266 public: 267 SERIALIZABLE_CLASS(ZorbaCollectionIterator); 268 269 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaCollectionIterator, 270 NaryBaseIterator<ZorbaCollectionIterator, ZorbaCollectionIteratorState>); 271 272 void serialize( ::zorba::serialization::Archiver& ar); 273 ZorbaCollectionIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic)274 ZorbaCollectionIterator( 275 static_context* sctx, 276 const QueryLoc& loc, 277 std::vector<PlanIter_t>& children, 278 bool isDynamic) 279 : 280 NaryBaseIterator<ZorbaCollectionIterator, ZorbaCollectionIteratorState>(sctx, loc, children), 281 theIsDynamic(isDynamic) 282 {} 283 284 virtual ~ZorbaCollectionIterator(); 285 isDynamic()286 bool isDynamic() const { return theIsDynamic; } 287 288 public: 289 bool isCountOptimizable() const; 290 void accept(PlanIterVisitor& v) const; 291 292 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 293 }; 294 295 296 /** 297 * 298 * zorba:collection-name 299 * 300 * Author: Zorba Team 301 */ 302 class ZorbaCollectionNameIterator : public NaryBaseIterator<ZorbaCollectionNameIterator, PlanIteratorState> 303 { 304 public: 305 SERIALIZABLE_CLASS(ZorbaCollectionNameIterator); 306 307 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaCollectionNameIterator, 308 NaryBaseIterator<ZorbaCollectionNameIterator, PlanIteratorState>); 309 310 void serialize( ::zorba::serialization::Archiver& ar); 311 ZorbaCollectionNameIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)312 ZorbaCollectionNameIterator( 313 static_context* sctx, 314 const QueryLoc& loc, 315 std::vector<PlanIter_t>& children) 316 : 317 NaryBaseIterator<ZorbaCollectionNameIterator, PlanIteratorState>(sctx, loc, children) 318 {} 319 320 virtual ~ZorbaCollectionNameIterator(); 321 322 void accept(PlanIterVisitor& v) const; 323 324 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 325 }; 326 327 328 /** 329 * 330 * zorba:index-of 331 * 332 * Author: Zorba Team 333 */ 334 class ZorbaIndexOfIterator : public NaryBaseIterator<ZorbaIndexOfIterator, PlanIteratorState> 335 { 336 protected: 337 bool theIsDynamic; // 338 public: 339 SERIALIZABLE_CLASS(ZorbaIndexOfIterator); 340 341 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaIndexOfIterator, 342 NaryBaseIterator<ZorbaIndexOfIterator, PlanIteratorState>); 343 344 void serialize( ::zorba::serialization::Archiver& ar); 345 ZorbaIndexOfIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic)346 ZorbaIndexOfIterator( 347 static_context* sctx, 348 const QueryLoc& loc, 349 std::vector<PlanIter_t>& children, 350 bool isDynamic) 351 : 352 NaryBaseIterator<ZorbaIndexOfIterator, PlanIteratorState>(sctx, loc, children), 353 theIsDynamic(isDynamic) 354 {} 355 356 virtual ~ZorbaIndexOfIterator(); 357 358 void accept(PlanIterVisitor& v) const; 359 360 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 361 }; 362 363 364 /** 365 * 366 * zorba:insert-nodes 367 * 368 * Author: Zorba Team 369 */ 370 class ZorbaInsertNodesIterator : public ZorbaCollectionIteratorHelper<ZorbaInsertNodesIterator, PlanIteratorState> 371 { 372 public: 373 SERIALIZABLE_CLASS(ZorbaInsertNodesIterator); 374 375 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaInsertNodesIterator, 376 ZorbaCollectionIteratorHelper<ZorbaInsertNodesIterator, PlanIteratorState>); 377 378 void serialize( ::zorba::serialization::Archiver& ar); 379 ZorbaInsertNodesIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic,bool needToCopy)380 ZorbaInsertNodesIterator( 381 static_context* sctx, 382 const QueryLoc& loc, 383 std::vector<PlanIter_t>& children, 384 bool isDynamic, 385 bool needToCopy) 386 : 387 ZorbaCollectionIteratorHelper<ZorbaInsertNodesIterator, PlanIteratorState>(sctx, loc, children, isDynamic, needToCopy) 388 {} 389 390 virtual ~ZorbaInsertNodesIterator(); 391 392 public: 393 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 394 void accept(PlanIterVisitor& v) const; 395 396 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 397 }; 398 399 400 /** 401 * 402 * zorba:insert-nodes-first 403 * 404 * Author: Zorba Team 405 */ 406 class ZorbaInsertNodesFirstIterator : public ZorbaCollectionIteratorHelper<ZorbaInsertNodesFirstIterator, PlanIteratorState> 407 { 408 public: 409 SERIALIZABLE_CLASS(ZorbaInsertNodesFirstIterator); 410 411 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaInsertNodesFirstIterator, 412 ZorbaCollectionIteratorHelper<ZorbaInsertNodesFirstIterator, PlanIteratorState>); 413 414 void serialize( ::zorba::serialization::Archiver& ar); 415 ZorbaInsertNodesFirstIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic,bool needToCopy)416 ZorbaInsertNodesFirstIterator( 417 static_context* sctx, 418 const QueryLoc& loc, 419 std::vector<PlanIter_t>& children, 420 bool isDynamic, 421 bool needToCopy) 422 : 423 ZorbaCollectionIteratorHelper<ZorbaInsertNodesFirstIterator, PlanIteratorState>(sctx, loc, children, isDynamic, needToCopy) 424 {} 425 426 virtual ~ZorbaInsertNodesFirstIterator(); 427 428 public: 429 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 430 void accept(PlanIterVisitor& v) const; 431 432 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 433 }; 434 435 436 /** 437 * 438 * zorba:insert-nodes-last 439 * 440 * Author: Zorba Team 441 */ 442 class ZorbaInsertNodesLastIterator : public ZorbaCollectionIteratorHelper<ZorbaInsertNodesLastIterator, PlanIteratorState> 443 { 444 public: 445 SERIALIZABLE_CLASS(ZorbaInsertNodesLastIterator); 446 447 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaInsertNodesLastIterator, 448 ZorbaCollectionIteratorHelper<ZorbaInsertNodesLastIterator, PlanIteratorState>); 449 450 void serialize( ::zorba::serialization::Archiver& ar); 451 ZorbaInsertNodesLastIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic,bool needToCopy)452 ZorbaInsertNodesLastIterator( 453 static_context* sctx, 454 const QueryLoc& loc, 455 std::vector<PlanIter_t>& children, 456 bool isDynamic, 457 bool needToCopy) 458 : 459 ZorbaCollectionIteratorHelper<ZorbaInsertNodesLastIterator, PlanIteratorState>(sctx, loc, children, isDynamic, needToCopy) 460 {} 461 462 virtual ~ZorbaInsertNodesLastIterator(); 463 464 public: 465 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 466 void accept(PlanIterVisitor& v) const; 467 468 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 469 }; 470 471 472 /** 473 * 474 * zorba:insert-nodes-before 475 * 476 * Author: Zorba Team 477 */ 478 class ZorbaInsertNodesBeforeIterator : public ZorbaCollectionIteratorHelper<ZorbaInsertNodesBeforeIterator, PlanIteratorState> 479 { 480 public: 481 SERIALIZABLE_CLASS(ZorbaInsertNodesBeforeIterator); 482 483 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaInsertNodesBeforeIterator, 484 ZorbaCollectionIteratorHelper<ZorbaInsertNodesBeforeIterator, PlanIteratorState>); 485 486 void serialize( ::zorba::serialization::Archiver& ar); 487 ZorbaInsertNodesBeforeIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic,bool needToCopy)488 ZorbaInsertNodesBeforeIterator( 489 static_context* sctx, 490 const QueryLoc& loc, 491 std::vector<PlanIter_t>& children, 492 bool isDynamic, 493 bool needToCopy) 494 : 495 ZorbaCollectionIteratorHelper<ZorbaInsertNodesBeforeIterator, PlanIteratorState>(sctx, loc, children, isDynamic, needToCopy) 496 {} 497 498 virtual ~ZorbaInsertNodesBeforeIterator(); 499 500 public: 501 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 502 void accept(PlanIterVisitor& v) const; 503 504 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 505 }; 506 507 508 /** 509 * 510 * zorba:insert-nodes-after 511 * 512 * Author: Zorba Team 513 */ 514 class ZorbaInsertNodesAfterIterator : public ZorbaCollectionIteratorHelper<ZorbaInsertNodesAfterIterator, PlanIteratorState> 515 { 516 protected: 517 bool theIsDynamic; // 518 public: 519 SERIALIZABLE_CLASS(ZorbaInsertNodesAfterIterator); 520 521 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaInsertNodesAfterIterator, 522 ZorbaCollectionIteratorHelper<ZorbaInsertNodesAfterIterator, PlanIteratorState>); 523 524 void serialize( ::zorba::serialization::Archiver& ar); 525 ZorbaInsertNodesAfterIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic,bool needToCopy)526 ZorbaInsertNodesAfterIterator( 527 static_context* sctx, 528 const QueryLoc& loc, 529 std::vector<PlanIter_t>& children, 530 bool isDynamic, 531 bool needToCopy) 532 : 533 ZorbaCollectionIteratorHelper<ZorbaInsertNodesAfterIterator, PlanIteratorState>(sctx, loc, children, isDynamic, needToCopy), 534 theIsDynamic(isDynamic) 535 {} 536 537 virtual ~ZorbaInsertNodesAfterIterator(); 538 539 public: 540 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 541 void accept(PlanIterVisitor& v) const; 542 543 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 544 }; 545 546 547 /** 548 * 549 * zorba:apply-insert-nodes 550 * 551 * Author: Zorba Team 552 */ 553 class ZorbaApplyInsertNodesIteratorState : public PlanIteratorState 554 { 555 public: 556 std::vector<store::Item_t> nodes; //the nodes that have been inserted 557 std::vector<store::Item_t>::const_iterator iterator; //iterator over the nodes 558 559 ZorbaApplyInsertNodesIteratorState(); 560 561 ~ZorbaApplyInsertNodesIteratorState(); 562 563 void init(PlanState&); 564 void reset(PlanState&); 565 }; 566 567 class ZorbaApplyInsertNodesIterator : public ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesIterator, ZorbaApplyInsertNodesIteratorState> 568 { 569 public: 570 SERIALIZABLE_CLASS(ZorbaApplyInsertNodesIterator); 571 572 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaApplyInsertNodesIterator, 573 ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesIterator, ZorbaApplyInsertNodesIteratorState>); 574 575 void serialize( ::zorba::serialization::Archiver& ar); 576 ZorbaApplyInsertNodesIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic,bool needToCopy)577 ZorbaApplyInsertNodesIterator( 578 static_context* sctx, 579 const QueryLoc& loc, 580 std::vector<PlanIter_t>& children, 581 bool isDynamic, 582 bool needToCopy) 583 : 584 ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesIterator, ZorbaApplyInsertNodesIteratorState>(sctx, loc, children, isDynamic, needToCopy) 585 {} 586 587 virtual ~ZorbaApplyInsertNodesIterator(); 588 589 public: 590 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 591 void accept(PlanIterVisitor& v) const; 592 593 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 594 }; 595 596 597 /** 598 * 599 * zorba:apply-insertnodes-first 600 * 601 * Author: Zorba Team 602 */ 603 class ZorbaApplyInsertNodesFirstIteratorState : public PlanIteratorState 604 { 605 public: 606 std::vector<store::Item_t> nodes; //the nodes that have been inserted 607 std::vector<store::Item_t>::const_iterator iterator; //iterator over the nodes 608 609 ZorbaApplyInsertNodesFirstIteratorState(); 610 611 ~ZorbaApplyInsertNodesFirstIteratorState(); 612 613 void init(PlanState&); 614 void reset(PlanState&); 615 }; 616 617 class ZorbaApplyInsertNodesFirstIterator : public ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesFirstIterator, ZorbaApplyInsertNodesFirstIteratorState> 618 { 619 public: 620 SERIALIZABLE_CLASS(ZorbaApplyInsertNodesFirstIterator); 621 622 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaApplyInsertNodesFirstIterator, 623 ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesFirstIterator, ZorbaApplyInsertNodesFirstIteratorState>); 624 625 void serialize( ::zorba::serialization::Archiver& ar); 626 ZorbaApplyInsertNodesFirstIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic,bool needToCopy)627 ZorbaApplyInsertNodesFirstIterator( 628 static_context* sctx, 629 const QueryLoc& loc, 630 std::vector<PlanIter_t>& children, 631 bool isDynamic, 632 bool needToCopy) 633 : 634 ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesFirstIterator, ZorbaApplyInsertNodesFirstIteratorState>(sctx, loc, children, isDynamic, needToCopy) 635 {} 636 637 virtual ~ZorbaApplyInsertNodesFirstIterator(); 638 639 public: 640 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 641 void accept(PlanIterVisitor& v) const; 642 643 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 644 }; 645 646 647 /** 648 * 649 * zorba:apply-insertnodes-last 650 * 651 * Author: Zorba Team 652 */ 653 class ZorbaApplyInsertNodesLastIteratorState : public PlanIteratorState 654 { 655 public: 656 std::vector<store::Item_t> nodes; //the nodes that have been inserted 657 std::vector<store::Item_t>::const_iterator iterator; //iterator over the nodes 658 659 ZorbaApplyInsertNodesLastIteratorState(); 660 661 ~ZorbaApplyInsertNodesLastIteratorState(); 662 663 void init(PlanState&); 664 void reset(PlanState&); 665 }; 666 667 class ZorbaApplyInsertNodesLastIterator : public ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesLastIterator, ZorbaApplyInsertNodesLastIteratorState> 668 { 669 public: 670 SERIALIZABLE_CLASS(ZorbaApplyInsertNodesLastIterator); 671 672 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaApplyInsertNodesLastIterator, 673 ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesLastIterator, ZorbaApplyInsertNodesLastIteratorState>); 674 675 void serialize( ::zorba::serialization::Archiver& ar); 676 ZorbaApplyInsertNodesLastIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic,bool needToCopy)677 ZorbaApplyInsertNodesLastIterator( 678 static_context* sctx, 679 const QueryLoc& loc, 680 std::vector<PlanIter_t>& children, 681 bool isDynamic, 682 bool needToCopy) 683 : 684 ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesLastIterator, ZorbaApplyInsertNodesLastIteratorState>(sctx, loc, children, isDynamic, needToCopy) 685 {} 686 687 virtual ~ZorbaApplyInsertNodesLastIterator(); 688 689 public: 690 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 691 void accept(PlanIterVisitor& v) const; 692 693 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 694 }; 695 696 697 /** 698 * 699 * zorba:apply-insert-nodes-before 700 * 701 * Author: Zorba Team 702 */ 703 class ZorbaApplyInsertNodesBeforeIteratorState : public PlanIteratorState 704 { 705 public: 706 std::vector<store::Item_t> nodes; //the nodes that have been inserted 707 std::vector<store::Item_t>::const_iterator iterator; //iterator over the nodes 708 709 ZorbaApplyInsertNodesBeforeIteratorState(); 710 711 ~ZorbaApplyInsertNodesBeforeIteratorState(); 712 713 void init(PlanState&); 714 void reset(PlanState&); 715 }; 716 717 class ZorbaApplyInsertNodesBeforeIterator : public ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesBeforeIterator, ZorbaApplyInsertNodesBeforeIteratorState> 718 { 719 public: 720 SERIALIZABLE_CLASS(ZorbaApplyInsertNodesBeforeIterator); 721 722 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaApplyInsertNodesBeforeIterator, 723 ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesBeforeIterator, ZorbaApplyInsertNodesBeforeIteratorState>); 724 725 void serialize( ::zorba::serialization::Archiver& ar); 726 ZorbaApplyInsertNodesBeforeIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic,bool needToCopy)727 ZorbaApplyInsertNodesBeforeIterator( 728 static_context* sctx, 729 const QueryLoc& loc, 730 std::vector<PlanIter_t>& children, 731 bool isDynamic, 732 bool needToCopy) 733 : 734 ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesBeforeIterator, ZorbaApplyInsertNodesBeforeIteratorState>(sctx, loc, children, isDynamic, needToCopy) 735 {} 736 737 virtual ~ZorbaApplyInsertNodesBeforeIterator(); 738 739 public: 740 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 741 void accept(PlanIterVisitor& v) const; 742 743 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 744 }; 745 746 747 /** 748 * 749 * zorba:apply-insertnodes-after 750 * 751 * Author: Zorba Team 752 */ 753 class ZorbaApplyInsertNodesAfterIteratorState : public PlanIteratorState 754 { 755 public: 756 std::vector<store::Item_t> nodes; //the nodes that have been inserted 757 std::vector<store::Item_t>::const_iterator iterator; //iterator over the nodes 758 759 ZorbaApplyInsertNodesAfterIteratorState(); 760 761 ~ZorbaApplyInsertNodesAfterIteratorState(); 762 763 void init(PlanState&); 764 void reset(PlanState&); 765 }; 766 767 class ZorbaApplyInsertNodesAfterIterator : public ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesAfterIterator, ZorbaApplyInsertNodesAfterIteratorState> 768 { 769 public: 770 SERIALIZABLE_CLASS(ZorbaApplyInsertNodesAfterIterator); 771 772 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaApplyInsertNodesAfterIterator, 773 ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesAfterIterator, ZorbaApplyInsertNodesAfterIteratorState>); 774 775 void serialize( ::zorba::serialization::Archiver& ar); 776 ZorbaApplyInsertNodesAfterIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic,bool needToCopy)777 ZorbaApplyInsertNodesAfterIterator( 778 static_context* sctx, 779 const QueryLoc& loc, 780 std::vector<PlanIter_t>& children, 781 bool isDynamic, 782 bool needToCopy) 783 : 784 ZorbaCollectionIteratorHelper<ZorbaApplyInsertNodesAfterIterator, ZorbaApplyInsertNodesAfterIteratorState>(sctx, loc, children, isDynamic, needToCopy) 785 {} 786 787 virtual ~ZorbaApplyInsertNodesAfterIterator(); 788 789 public: 790 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 791 void accept(PlanIterVisitor& v) const; 792 793 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 794 }; 795 796 797 /** 798 * 799 * zorba:delete-nodes 800 * 801 * Author: Zorba Team 802 */ 803 class ZorbaDeleteNodesIterator : public NaryBaseIterator<ZorbaDeleteNodesIterator, PlanIteratorState> 804 { 805 protected: 806 bool theIsDynamic; // 807 public: 808 SERIALIZABLE_CLASS(ZorbaDeleteNodesIterator); 809 810 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaDeleteNodesIterator, 811 NaryBaseIterator<ZorbaDeleteNodesIterator, PlanIteratorState>); 812 813 void serialize( ::zorba::serialization::Archiver& ar); 814 ZorbaDeleteNodesIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic)815 ZorbaDeleteNodesIterator( 816 static_context* sctx, 817 const QueryLoc& loc, 818 std::vector<PlanIter_t>& children, 819 bool isDynamic) 820 : 821 NaryBaseIterator<ZorbaDeleteNodesIterator, PlanIteratorState>(sctx, loc, children), 822 theIsDynamic(isDynamic) 823 {} 824 825 virtual ~ZorbaDeleteNodesIterator(); 826 827 public: 828 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 829 void accept(PlanIterVisitor& v) const; 830 831 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 832 }; 833 834 835 /** 836 * 837 * zorba:delete-node-first 838 * 839 * Author: Zorba Team 840 */ 841 class ZorbaDeleteNodesFirstIterator : public NaryBaseIterator<ZorbaDeleteNodesFirstIterator, PlanIteratorState> 842 { 843 protected: 844 bool theIsDynamic; // 845 public: 846 SERIALIZABLE_CLASS(ZorbaDeleteNodesFirstIterator); 847 848 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaDeleteNodesFirstIterator, 849 NaryBaseIterator<ZorbaDeleteNodesFirstIterator, PlanIteratorState>); 850 851 void serialize( ::zorba::serialization::Archiver& ar); 852 ZorbaDeleteNodesFirstIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic)853 ZorbaDeleteNodesFirstIterator( 854 static_context* sctx, 855 const QueryLoc& loc, 856 std::vector<PlanIter_t>& children, 857 bool isDynamic) 858 : 859 NaryBaseIterator<ZorbaDeleteNodesFirstIterator, PlanIteratorState>(sctx, loc, children), 860 theIsDynamic(isDynamic) 861 {} 862 863 virtual ~ZorbaDeleteNodesFirstIterator(); 864 865 public: 866 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 867 void accept(PlanIterVisitor& v) const; 868 869 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 870 }; 871 872 873 /** 874 * 875 * zorba:delete-node-last 876 * 877 * Author: Zorba Team 878 */ 879 class ZorbaDeleteNodesLastIterator : public NaryBaseIterator<ZorbaDeleteNodesLastIterator, PlanIteratorState> 880 { 881 protected: 882 bool theIsDynamic; // 883 public: 884 SERIALIZABLE_CLASS(ZorbaDeleteNodesLastIterator); 885 886 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaDeleteNodesLastIterator, 887 NaryBaseIterator<ZorbaDeleteNodesLastIterator, PlanIteratorState>); 888 889 void serialize( ::zorba::serialization::Archiver& ar); 890 ZorbaDeleteNodesLastIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic)891 ZorbaDeleteNodesLastIterator( 892 static_context* sctx, 893 const QueryLoc& loc, 894 std::vector<PlanIter_t>& children, 895 bool isDynamic) 896 : 897 NaryBaseIterator<ZorbaDeleteNodesLastIterator, PlanIteratorState>(sctx, loc, children), 898 theIsDynamic(isDynamic) 899 {} 900 901 virtual ~ZorbaDeleteNodesLastIterator(); 902 903 public: 904 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 905 void accept(PlanIterVisitor& v) const; 906 907 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 908 }; 909 910 911 /** 912 * 913 * zorba:truncate 914 * 915 * Author: Zorba Team 916 */ 917 class ZorbaTruncateCollectionIterator : public NaryBaseIterator<ZorbaTruncateCollectionIterator, PlanIteratorState> 918 { 919 protected: 920 bool theIsDynamic; // 921 public: 922 SERIALIZABLE_CLASS(ZorbaTruncateCollectionIterator); 923 924 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaTruncateCollectionIterator, 925 NaryBaseIterator<ZorbaTruncateCollectionIterator, PlanIteratorState>); 926 927 void serialize( ::zorba::serialization::Archiver& ar); 928 ZorbaTruncateCollectionIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children,bool isDynamic)929 ZorbaTruncateCollectionIterator( 930 static_context* sctx, 931 const QueryLoc& loc, 932 std::vector<PlanIter_t>& children, 933 bool isDynamic) 934 : 935 NaryBaseIterator<ZorbaTruncateCollectionIterator, PlanIteratorState>(sctx, loc, children), 936 theIsDynamic(isDynamic) 937 {} 938 939 virtual ~ZorbaTruncateCollectionIterator(); 940 941 public: 942 const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; 943 void accept(PlanIterVisitor& v) const; 944 945 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 946 }; 947 948 949 /** 950 * 951 * dc:is-available-index 952 * 953 * Author: Zorba Team 954 */ 955 class IsAvailableIndexIterator : public NaryBaseIterator<IsAvailableIndexIterator, PlanIteratorState> 956 { 957 public: 958 SERIALIZABLE_CLASS(IsAvailableIndexIterator); 959 960 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsAvailableIndexIterator, 961 NaryBaseIterator<IsAvailableIndexIterator, PlanIteratorState>); 962 963 void serialize( ::zorba::serialization::Archiver& ar); 964 IsAvailableIndexIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)965 IsAvailableIndexIterator( 966 static_context* sctx, 967 const QueryLoc& loc, 968 std::vector<PlanIter_t>& children) 969 : 970 NaryBaseIterator<IsAvailableIndexIterator, PlanIteratorState>(sctx, loc, children) 971 {} 972 973 virtual ~IsAvailableIndexIterator(); 974 975 void accept(PlanIterVisitor& v) const; 976 977 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 978 }; 979 980 981 /** 982 * 983 * dc:available-indexes 984 * 985 * Author: Zorba Team 986 */ 987 class AvailableIndexesIteratorState : public PlanIteratorState 988 { 989 public: 990 store::Iterator_t nameItState; //the current iterator 991 992 AvailableIndexesIteratorState(); 993 994 ~AvailableIndexesIteratorState(); 995 996 void init(PlanState&); 997 void reset(PlanState&); 998 }; 999 1000 class AvailableIndexesIterator : public NaryBaseIterator<AvailableIndexesIterator, AvailableIndexesIteratorState> 1001 { 1002 public: 1003 SERIALIZABLE_CLASS(AvailableIndexesIterator); 1004 1005 SERIALIZABLE_CLASS_CONSTRUCTOR2T(AvailableIndexesIterator, 1006 NaryBaseIterator<AvailableIndexesIterator, AvailableIndexesIteratorState>); 1007 1008 void serialize( ::zorba::serialization::Archiver& ar); 1009 AvailableIndexesIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)1010 AvailableIndexesIterator( 1011 static_context* sctx, 1012 const QueryLoc& loc, 1013 std::vector<PlanIter_t>& children) 1014 : 1015 NaryBaseIterator<AvailableIndexesIterator, AvailableIndexesIteratorState>(sctx, loc, children) 1016 {} 1017 1018 virtual ~AvailableIndexesIterator(); 1019 1020 void accept(PlanIterVisitor& v) const; 1021 1022 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 1023 }; 1024 1025 1026 /** 1027 * 1028 * dc:is-activated-integrity-constraint 1029 * 1030 * Author: Zorba Team 1031 */ 1032 class IsActivatedICIterator : public NaryBaseIterator<IsActivatedICIterator, PlanIteratorState> 1033 { 1034 public: 1035 SERIALIZABLE_CLASS(IsActivatedICIterator); 1036 1037 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsActivatedICIterator, 1038 NaryBaseIterator<IsActivatedICIterator, PlanIteratorState>); 1039 1040 void serialize( ::zorba::serialization::Archiver& ar); 1041 IsActivatedICIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)1042 IsActivatedICIterator( 1043 static_context* sctx, 1044 const QueryLoc& loc, 1045 std::vector<PlanIter_t>& children) 1046 : 1047 NaryBaseIterator<IsActivatedICIterator, PlanIteratorState>(sctx, loc, children) 1048 {} 1049 1050 virtual ~IsActivatedICIterator(); 1051 1052 void accept(PlanIterVisitor& v) const; 1053 1054 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 1055 }; 1056 1057 1058 /** 1059 * 1060 * dc:activated-integrity-constraints 1061 * 1062 * Author: Zorba Team 1063 */ 1064 class ActivatedICsIteratorState : public PlanIteratorState 1065 { 1066 public: 1067 store::Iterator_t nameItState; // 1068 1069 ActivatedICsIteratorState(); 1070 1071 ~ActivatedICsIteratorState(); 1072 1073 void init(PlanState&); 1074 void reset(PlanState&); 1075 }; 1076 1077 class ActivatedICsIterator : public NaryBaseIterator<ActivatedICsIterator, ActivatedICsIteratorState> 1078 { 1079 public: 1080 SERIALIZABLE_CLASS(ActivatedICsIterator); 1081 1082 SERIALIZABLE_CLASS_CONSTRUCTOR2T(ActivatedICsIterator, 1083 NaryBaseIterator<ActivatedICsIterator, ActivatedICsIteratorState>); 1084 1085 void serialize( ::zorba::serialization::Archiver& ar); 1086 ActivatedICsIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)1087 ActivatedICsIterator( 1088 static_context* sctx, 1089 const QueryLoc& loc, 1090 std::vector<PlanIter_t>& children) 1091 : 1092 NaryBaseIterator<ActivatedICsIterator, ActivatedICsIteratorState>(sctx, loc, children) 1093 {} 1094 1095 virtual ~ActivatedICsIterator(); 1096 1097 void accept(PlanIterVisitor& v) const; 1098 1099 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 1100 }; 1101 1102 1103 /** 1104 * 1105 * sc:is-declared-collection 1106 * 1107 * Author: Zorba Team 1108 */ 1109 class IsDeclaredCollectionIterator : public NaryBaseIterator<IsDeclaredCollectionIterator, PlanIteratorState> 1110 { 1111 public: 1112 SERIALIZABLE_CLASS(IsDeclaredCollectionIterator); 1113 1114 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsDeclaredCollectionIterator, 1115 NaryBaseIterator<IsDeclaredCollectionIterator, PlanIteratorState>); 1116 1117 void serialize( ::zorba::serialization::Archiver& ar); 1118 IsDeclaredCollectionIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)1119 IsDeclaredCollectionIterator( 1120 static_context* sctx, 1121 const QueryLoc& loc, 1122 std::vector<PlanIter_t>& children) 1123 : 1124 NaryBaseIterator<IsDeclaredCollectionIterator, PlanIteratorState>(sctx, loc, children) 1125 {} 1126 1127 virtual ~IsDeclaredCollectionIterator(); 1128 1129 void accept(PlanIterVisitor& v) const; 1130 1131 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 1132 }; 1133 1134 1135 /** 1136 * 1137 * sc:declared-collections 1138 * 1139 * Author: Zorba Team 1140 */ 1141 class DeclaredCollectionsIteratorState : public PlanIteratorState 1142 { 1143 public: 1144 store::Iterator_t nameItState; // 1145 1146 DeclaredCollectionsIteratorState(); 1147 1148 ~DeclaredCollectionsIteratorState(); 1149 1150 void init(PlanState&); 1151 void reset(PlanState&); 1152 }; 1153 1154 class DeclaredCollectionsIterator : public NaryBaseIterator<DeclaredCollectionsIterator, DeclaredCollectionsIteratorState> 1155 { 1156 public: 1157 SERIALIZABLE_CLASS(DeclaredCollectionsIterator); 1158 1159 SERIALIZABLE_CLASS_CONSTRUCTOR2T(DeclaredCollectionsIterator, 1160 NaryBaseIterator<DeclaredCollectionsIterator, DeclaredCollectionsIteratorState>); 1161 1162 void serialize( ::zorba::serialization::Archiver& ar); 1163 DeclaredCollectionsIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)1164 DeclaredCollectionsIterator( 1165 static_context* sctx, 1166 const QueryLoc& loc, 1167 std::vector<PlanIter_t>& children) 1168 : 1169 NaryBaseIterator<DeclaredCollectionsIterator, DeclaredCollectionsIteratorState>(sctx, loc, children) 1170 {} 1171 1172 virtual ~DeclaredCollectionsIterator(); 1173 1174 void accept(PlanIterVisitor& v) const; 1175 1176 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 1177 }; 1178 1179 1180 /** 1181 * 1182 * sc:is-declared-index 1183 * 1184 * Author: Zorba Team 1185 */ 1186 class IsDeclaredIndexIterator : public NaryBaseIterator<IsDeclaredIndexIterator, PlanIteratorState> 1187 { 1188 public: 1189 SERIALIZABLE_CLASS(IsDeclaredIndexIterator); 1190 1191 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsDeclaredIndexIterator, 1192 NaryBaseIterator<IsDeclaredIndexIterator, PlanIteratorState>); 1193 1194 void serialize( ::zorba::serialization::Archiver& ar); 1195 IsDeclaredIndexIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)1196 IsDeclaredIndexIterator( 1197 static_context* sctx, 1198 const QueryLoc& loc, 1199 std::vector<PlanIter_t>& children) 1200 : 1201 NaryBaseIterator<IsDeclaredIndexIterator, PlanIteratorState>(sctx, loc, children) 1202 {} 1203 1204 virtual ~IsDeclaredIndexIterator(); 1205 1206 void accept(PlanIterVisitor& v) const; 1207 1208 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 1209 }; 1210 1211 1212 /** 1213 * 1214 * sc:declared-indexes 1215 * 1216 * Author: Zorba Team 1217 */ 1218 class DeclaredIndexesIteratorState : public PlanIteratorState 1219 { 1220 public: 1221 store::Iterator_t nameItState; //the current iterator 1222 1223 DeclaredIndexesIteratorState(); 1224 1225 ~DeclaredIndexesIteratorState(); 1226 1227 void init(PlanState&); 1228 void reset(PlanState&); 1229 }; 1230 1231 class DeclaredIndexesIterator : public NaryBaseIterator<DeclaredIndexesIterator, DeclaredIndexesIteratorState> 1232 { 1233 public: 1234 SERIALIZABLE_CLASS(DeclaredIndexesIterator); 1235 1236 SERIALIZABLE_CLASS_CONSTRUCTOR2T(DeclaredIndexesIterator, 1237 NaryBaseIterator<DeclaredIndexesIterator, DeclaredIndexesIteratorState>); 1238 1239 void serialize( ::zorba::serialization::Archiver& ar); 1240 DeclaredIndexesIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)1241 DeclaredIndexesIterator( 1242 static_context* sctx, 1243 const QueryLoc& loc, 1244 std::vector<PlanIter_t>& children) 1245 : 1246 NaryBaseIterator<DeclaredIndexesIterator, DeclaredIndexesIteratorState>(sctx, loc, children) 1247 {} 1248 1249 virtual ~DeclaredIndexesIterator(); 1250 1251 void accept(PlanIterVisitor& v) const; 1252 1253 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 1254 }; 1255 1256 1257 /** 1258 * 1259 * sc:is-declared-integrity-constraint 1260 * 1261 * Author: Zorba Team 1262 */ 1263 class IsDeclaredICIterator : public NaryBaseIterator<IsDeclaredICIterator, PlanIteratorState> 1264 { 1265 public: 1266 SERIALIZABLE_CLASS(IsDeclaredICIterator); 1267 1268 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsDeclaredICIterator, 1269 NaryBaseIterator<IsDeclaredICIterator, PlanIteratorState>); 1270 1271 void serialize( ::zorba::serialization::Archiver& ar); 1272 IsDeclaredICIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)1273 IsDeclaredICIterator( 1274 static_context* sctx, 1275 const QueryLoc& loc, 1276 std::vector<PlanIter_t>& children) 1277 : 1278 NaryBaseIterator<IsDeclaredICIterator, PlanIteratorState>(sctx, loc, children) 1279 {} 1280 1281 virtual ~IsDeclaredICIterator(); 1282 1283 void accept(PlanIterVisitor& v) const; 1284 1285 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 1286 }; 1287 1288 1289 /** 1290 * 1291 * sc:declared-integrity-constrints 1292 * 1293 * Author: Zorba Team 1294 */ 1295 class DeclaredICsIteratorState : public PlanIteratorState 1296 { 1297 public: 1298 store::Iterator_t nameItState; // 1299 1300 DeclaredICsIteratorState(); 1301 1302 ~DeclaredICsIteratorState(); 1303 1304 void init(PlanState&); 1305 void reset(PlanState&); 1306 }; 1307 1308 class DeclaredICsIterator : public NaryBaseIterator<DeclaredICsIterator, DeclaredICsIteratorState> 1309 { 1310 public: 1311 SERIALIZABLE_CLASS(DeclaredICsIterator); 1312 1313 SERIALIZABLE_CLASS_CONSTRUCTOR2T(DeclaredICsIterator, 1314 NaryBaseIterator<DeclaredICsIterator, DeclaredICsIteratorState>); 1315 1316 void serialize( ::zorba::serialization::Archiver& ar); 1317 DeclaredICsIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)1318 DeclaredICsIterator( 1319 static_context* sctx, 1320 const QueryLoc& loc, 1321 std::vector<PlanIter_t>& children) 1322 : 1323 NaryBaseIterator<DeclaredICsIterator, DeclaredICsIteratorState>(sctx, loc, children) 1324 {} 1325 1326 virtual ~DeclaredICsIterator(); 1327 1328 void accept(PlanIterVisitor& v) const; 1329 1330 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 1331 }; 1332 1333 1334 /** 1335 * 1336 * Returns a sequence of xs:anyURI values representing the document URIs of the 1337 * documents in a collection. 1338 * 1339 * Author: Zorba Team 1340 */ 1341 class FnURICollectionIteratorState : public PlanIteratorState 1342 { 1343 public: 1344 store::Iterator_t theIterator; //the current iterator 1345 bool theIteratorOpened; //flag indicating whether theIterator was opened 1346 1347 FnURICollectionIteratorState(); 1348 1349 ~FnURICollectionIteratorState(); 1350 1351 void init(PlanState&); 1352 void reset(PlanState&); 1353 }; 1354 1355 class FnURICollectionIterator : public NaryBaseIterator<FnURICollectionIterator, FnURICollectionIteratorState> 1356 { 1357 public: 1358 SERIALIZABLE_CLASS(FnURICollectionIterator); 1359 1360 SERIALIZABLE_CLASS_CONSTRUCTOR2T(FnURICollectionIterator, 1361 NaryBaseIterator<FnURICollectionIterator, FnURICollectionIteratorState>); 1362 1363 void serialize( ::zorba::serialization::Archiver& ar); 1364 FnURICollectionIterator(static_context * sctx,const QueryLoc & loc,std::vector<PlanIter_t> & children)1365 FnURICollectionIterator( 1366 static_context* sctx, 1367 const QueryLoc& loc, 1368 std::vector<PlanIter_t>& children) 1369 : 1370 NaryBaseIterator<FnURICollectionIterator, FnURICollectionIteratorState>(sctx, loc, children) 1371 {} 1372 1373 virtual ~FnURICollectionIterator(); 1374 1375 void accept(PlanIterVisitor& v) const; 1376 1377 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; 1378 }; 1379 1380 1381 } 1382 #endif 1383 /* 1384 * Local variables: 1385 * mode: c++ 1386 * End: 1387 */ 1388