/* * Copyright (c) 2001, DecisionSoft Limited All rights reserved. * Please see LICENSE.TXT for more information. */ #ifndef _DataItemNav_HPP #define _DataItemNav_HPP #include #include #include #include class NavStepImpl; ///this class calculates a node list based on a context class PATHAN_EXPORT DataItemNav : public DataItemImpl { public: DataItemNav(XPath2MemoryManager* memMgr); virtual ~DataItemNav(); /** Add a new NavigationStep to the sequence of navigation steps to be performed. This operation is used by parse tree classes to turn themselves into an optimised, reusable navigation. **/ void addStep(DataItem* step); /** Add a new NavigationStep to the sequence of navigation steps to be performed. This operation is used by parse tree classes to turn themselves into an optimised, reusable navigation. **/ void addStep(NavStepImpl* step); /** Add a new NavigationStep to the start of the sequence of navigation steps to be performed.**/ void addStepFront(DataItem* step); ///set the "go to root of tree first" flag. void setGotoRootFirst(bool gotoRoot); //collapase the compiled expression based on context virtual Sequence collapseTreeInternal(DynamicContext* context, int flags=0) const; virtual DataItem* staticResolution(StaticContext *context, StaticResolutionContext *src); bool getGotoRootFirst() const; const VectorOfDataItems &getSteps() const; protected: void stepIteration(const DataItem *step, Sequence &candidateList, DynamicContext *context, int flags) const; ///returns a node list that has no duplicates in Sequence removeDuplicates(const Sequence &nodeList, DynamicContext* context) const; bool _gotoRoot; //list of steps to be performed. VectorOfDataItems _steps; }; #endif